webalizer-2.23-05/0000755000175000017500000000000011551757724012266 5ustar bradbradwebalizer-2.23-05/CHANGES0000644000175000017500000006067711453023104013254 0ustar bradbrad-------------------------------------------------------------------- 2.23-xx changes from 2.21-xx -------------------------------------------------------------------- Fixes: o Fix sporadic eol problem with some IIS/W3C logs o Fix compiler directive syntax error (broke some 64 bit systems) Changes/Additions: o Modest speed improvements in hash table code -------------------------------------------------------------------- 2.21-xx changes from 2.20-xx -------------------------------------------------------------------- Fixes: o Added missing memory deallocation call in DNS lookup code. o Minor fixes to configure script Changes/Additions: o Added "YearTotals" config option for main index page totals o Rename local stricmp() function to ouricmp() to prevent name confilict on systems that happen to provide it already. -------------------------------------------------------------------- 2.20-xx changes from 2.01-xx -------------------------------------------------------------------- Fixes: o Fixed problem with timing totals. o Fixed referrer linking to avoid possible xss injection. o Fixed month change detection error that caused incorrect report dates when logs had a 'gap' longer than a year. o Fixed buffer overrun possibility in parsing code and user agent mangle logic. o Added symbolic link checks for file I/O to prevent possible privilege escalation exploits. Disallows reading from or writing to any file that is a symlink. Thanks to Julien Danjou. o Added code to preserve the history and incremental data files in the event of a crash before writing to them completely. Thanks to Robert Millan for the idea and initial code. Changes/Additions: o Added native geolocation services, which fully supports both IPv4 and IPv6 lookups. Adds the configuration keywords 'GeoDB' and 'GeoDBDatabase' along with the '-j' and '-J' command line options. o Added 'wcmgr', "The Webalizer (DNS) Cache file Manager" to the distribution to provide cache file maintenance. See the supplied man page for a description and usage information. o Changed history code and main index page to allow for more than 12 months of reports to be displayed. Added the config keywords 'IndexMonths' (-K command line option), 'GraphMonths' (-k command line option) and 'YearHeaders' to control how index is displayed. o Changed Berkeley DB code to use current 4.x APIs. o Added support for bzip2 compressed log files (.bz2) as a compile time option (--enable-bz2). If enabled, bzipped files will be decompressed automatically during processing. o Added support for W3C formatted logs. Based on code submitted by Klaus Reimer. o Added GeoIP support as compile time option (--enable-geoip). Adds 'GeoIP' and 'GeoIPDatabase' config keywords, '-w' and '-W' command line options. (http://www.maxmind.com/) o Added IPv6 support. Based on initial code by Jose Carlos Meneiros and modified to support Solaris and other problematic platforms. o Added 'CacheIPs' config option to allow saving unresolved addresses in the DNS cache. o Added 'CacheTTL' config option which allows the DNS cache time to live (TTL) value to be specified at run-time. o Added 'SearchCaseI' config option to specify if search strings should be treated as case insensitive or not. The default value, 'yes', causes search strings to be treated as case insensitive. o Added 'HTAccess' config option. Allows writing a default .htaccess file to the output directory. o Added ability to display flags in the top country table. Adds the config keywords 'CountryFlags' and 'FlagDir', and -z command line option. o Added 'StripCGI' config option to configure how CGI variables on the end of URLs are treated (can now be stripped or left in place). o Added 'DefaultIndex' config option to enable/disable the use of "index." as a default index name to be stripped from the end of URLs. o Added 'TrimSquidURL' config option to allow squid log URLs to be reduced in granularity by a user definable amount. Thanks to code submitted by Stuart Gall. o Added 'OmitPage' config option (and the '-O' command line switch) to prevent specified URLs from being counted as pages even if they otherwise would be. Thanks to code submitted by Adam Morton. o Added 'IgnoreState' config option (and the -b command line switch) to allow ignoring any existing incremental data file (similar to the IgnoreHist/-i option). o Changed logic to always generate summary report (index.html), even if no records were processed. o Added color support to allow changing graph colors. Based on the Webalizer-usecolor code submitted by Benoit Rouits. Adds 11 new config options, see the README file for complete descriptions. o Added language 'lang=' specification in generated HTML files. o Added 'LinkReferrer' config option to allow/disallow links in the top referrers table. o Added 'PagePrefix' config option to allow URL prefix matches to be counted as pages, regardless of file extension or type. Thanks to code submitted by Remco Van de Meent. o Enabled large file support (LFS) to support logs greater than 2Gb in size on systems that support LFS. Also increased the size of most internal counters to handle larger sites. o Minor changes to generated HTML output o Updated language files country codes for current IANA TLDs o Changed the meaning of the -v command line switch. It now causes verbose information to be displayed at run-time (Informational and Debug messages). o Changed Group* config options to allow a quoted string for the match string. This allows spaces to be embedded in the string. o Changed log record parsing logic to allow spaces in URLs. o Made configuration keywords, boolean configuration values (yes/no), and log file types case insensitive. Also fixed defaults for invalid values to reflect documented defaults. o Changed configure script to use --sysconfdir to specify the location of the default webalizer.conf configuration file. Also added support for DESTDIR during install to aid binary package builds. -------------------------------------------------------------------- 2.01-xx changes from 1.30-04 -------------------------------------------------------------------- Fixes: o Fix posible obscure buffer overflow bug in DNS resolver code o Added additional extended character fixes o Let code accept partial content response codes along with 200's o Added code to catch blank hostnames (yes, they have been found!) Will convert them into 'Unknown' o Security fix for cross-site scripting vulnerability found by Flavio Veloso (www.magnux.com). o Fixed a TOTAL_RC off by one error, which would prevent the last response code from being saved when using incremental mode. o Fixed possible segfault condition in MangleAgent code on some malformed user agent names. o Fixed DNS to prevent hangs on blank and malformed hostnames. o Fixed problem calculating visits. Changed timestamps to use seconds since epoch (1/1/1970) which results in more accurate analysis. Also changed normal out of sequence code to handle up to 1 hour of 'slop' in the timestamps. This changed the semantics of the VisitTimeout and -m configuration options, as the values are now specified in number of seconds. o Fixed hostname lowercase problem (wasn't) when using DNS lookups. o Fixed problem with incremental datafile which could cause a read error under certain circumstances (removes control characters). Also changed code to now abort on a read error. o Fixed problem with hash table node creation where objects that were exactly the maximum length would wind up leaving a garbage byte at the end of the memory space allocated. This was causing some very infrequent and widely different problems. o Fixed problem where country graph could be produced incorrectly if using a non-english language and the country name overlapped the pie chart. o Found and fixed a problem with a possible 32-bit wrap around problem using incremental mode on large sites. The problem would cause the KBytes data on large groups to become inaccuate. Changes/Additions: o Modified configure to allow specification of the default config directory. If not given, will use /etc (/etc/webalizer.conf). o Added DailyGraph and DailyStats configuration options to enable or disable the Daily usage graph and stats table from output. o Improved visit calculation logic to reduce 'false' counts generated by external image referrals. o Added reverse DNS lookup capability. This adds the command line switchs -D and -N, and configuration keywords "DNSCache" and "DNSChildren". See the DNS.README for additional info. Based in part on code submitted by Henning P. Schmiedehausen (hps@tanstaafl.de). o Added ability to dump Sites, URLs, Referrers, User Agents, Usernames and Search Strings to tab delimited files, suitable for import into most database and spreadsheet programs. The location of this file may be specified using the "DumpPath" configuration keyword, allowing the data to be kept someplace outside the web servers document tree. The configuration keywords "DumpSites", "DumpURLs", "DumpReferrers", "DumpAgents", "DumpUsers" and "DumpSearchStr" have been added to control the file dumps. Column headers can be included in the file with the "DumpHeader" keyword. Dump filename extensions may be specified using the "DumpExtension" keyword (default is .tab). o Added username analysis, based on usernames found in the log, and only available if username information is present in the log (ie: http authentication or wu-ftpd xferlog). The keywords 'GroupUser', 'HideUser', 'IgnoreUser', 'IncludeUser', 'AllUsers', and 'TopUsers' have been added to the configuration file code. This change also modified the format of the incremental data file. o Added the ability to display ALL sites, URLs, Referrers, User Agents and Search Strings on a seperate HTML page from the normal statistics page. This adds the configuration keywords 'AllSites', 'AllURLs', 'AllReferrers', 'AllAgents' and 'AllSearchStr', which can have either a "yes" or "no" value (default is "no"). Will add a "View All..." link to the bottom of the appropriate "Top" table if enabled. o Added support for squid proxy logs, thanks to code submitted by Steinar H. Gunderson (sgunderson@bigfoot.com). To use squid logs, specify a LogType of 'squid' in the configuration file. This also changed the behaviour of the '-F' command line switch, which now requires a second argument of either 'clf', 'ftp' or 'squid'. o Completely modified the way the various TOP tables are handled and sorted, which now allows extremely large top tables without any performance degredation. Previously, tables greater than a few hundred elements produced a noticable perfomance penalty during processing. o Added the ability to group domains automatically and to hide individual host names from the report, using the 'GroupDomains' and 'HideAllSites' configuration keywords (-g and -X command line options). Domain Grouping is configurable as to the level of grouping (second level domain, third, etc...). HideAllSites forces only grouped site records to be displayed if any. Based on ideas/code by Michael Klemme (mklemme@gmx.de). This changes the behaviour of the '-g' switch, which previously was used to force the use of GMT time for reports. o Added user configurable search engine specification, used for search string analysis. This adds the 'SearchEngine' keyword in configuration files. Based on idea/code by Alexey Kizilov. o Changed code to use the latest version of GD which supports PNG images instead of GIF images. Also included changes in configure script to ensure the presence of the libpng and libz libraries. o Added ability to override log file to STDIN by use of '-' on the command line. o Added gzipped logfile support. The program will automatically detect logfiles with a '.gz' extension and uncompress on the fly. Uses gz file support of zlib, since it's required for our gd/png stuff anyway. Please note that using gzipped logs will incur a small performance penality. o Minor changes to search string code to increase accuracy. This also removes a previous condition that would occasionally cause search strings to incorrectly be counted twice or to be counted as different search strings when only differing by a space. o Minor changes to URL parse code to allow additional characters. Also changed unescape code to properly handle extended chars. o Major changes to hash table node format for reduced memory usage. Instead of fixed size strings, the new format will dynamically allocate string memory and use pointers to existing table data under certain circumstances. The memory savings is significant and will be greatly noticed with large sites. Because of these changes, the formatting of the incremental data file had to be changed, therefore it is incompatible with previous versions. o Major code reorganization and cleanup. This was to facilitate future developent and make things more managable. o Usual documentation updates for new features/functions. -------------------------------------------------------------------- 1.30-xx changes from 1.22-06 -------------------------------------------------------------------- Fixes: o Fixed minor bug that would allow incorrect site totals for the first day of the month under certain conditions. Changes/Additions: o Added Top Entry and Exit Page tables. Added configuration file keywords TopEntry (-e command line) and TopExit (-E command line) to specify the number of entries to display for each table. The default for both is 10. See README for additional information. o Added 'Group' labels. Allows display of a specified label for grouped entries (in 'Top' tables). Based on patch submitted by Oliver Graf (ograf@rhein-zeitung.de). See sample.conf for examples. o Added 'Visits' totals. The length of time that constitutes a 'visit' can be set using the VisitTimeout configuration keyword (-m command line option). The value must be given in HHMMSS format, you can omit leading zeros. Default is 30 minutes (3000). o Added 'Pages' totals, based on user specified extensions. Changes made to generated graphs as well. Configuration keyword PageType (and command line -P switch) allows specification of extensions to use (defaults to 'htm*' and 'cgi'). Also called "pageviews". o Added Search String analysis. Keyword 'TopSearch' defines how many of the top search strings to display. Default is 20. Can be disabled by using zero (0). o Added native support for ftp logs (xferlog ala wu-ftpd). Added 'LogType' configuration file keyword (-F command line option) to specify log type. Values can be either 'web' or 'ftp', with the default of 'web'. o Changed graphs to handle pages and visits totals. Also added color coded legends, which can be disabled using the GraphLegend configuration keyword (-L command line option). Default is to display them. o Added background lines to graphs. Default is 2 lines, and can be set to any number using the GraphLines configuration keyword (-l command line option). Can use anywhere from none (0) to twenty lines. They will be drawn in all but the country graph. o Added CountryGraph configuration file keyword (-Y command line option) to enable/disable display of country usage pie chart. o Added FoldSeqErr keyword (-f command line option). Normally, the program will ignore log records that are out of sequence (chronological order). This option lets them be folded into the analysis anyway, as if the were the same date/time as the last good record. Apache users can safely ignore :) o Added additonal 'Top' tables for SITES and URLs, sorted by KBytes instead of hits. Two new configuration file keywords, TopKSites and TopKURLs, can be used to specify the number of entries for each (zero to disable). Default for both is 10. o Added additional calculations for max/avg files, pages, visits and KBytes in monthly statistics. o Updated generated HTML code to fully comply with the HTML 4.0 Transitional spec. DOCTYPE header reflects this change as well. o Changed code to use 4 digit years in filenames. Purely for the Y2K phobes who couldn't deal with only two digits (even though it was _purely_ for humans, the program couldn't care less). Unfortunately, this means that you will have to rename previous month files to the new format. Not a big deal if you plan on re-running all your logs to take advantage of the new features. o Major changes to both history file and incremental file formats to handle additional totals (pages/visits data). As a result, this version is INCOMPATABLE with previous versions. See the file README.FIRST for important information on upgrading. o Language files and documentation updated for new functions. -------------------------------------------------------------------- 1.22-xx changes from 1.20-11 -------------------------------------------------------------------- Fixes: o Fixed bug in country total generation. Caused country table to show bogus entries if logs contain hostnames that were not fully qualified (ie: don't have the domain name/TLD portion). o Changed/fixed incremental data I/O routines to better detect and handle error conditions. This involved some minor incremental data file format changes as well. Fixes problem large sites were having where random tables were getting munged. o Fixed record parse code to better detect and strip query portion from URLs and Referrer strings. o Fixed segfault condition when more than MAX_CTRY entries were specified for the "Top Countries" table. Changes/Additions: o Added code to detect negative byte transfer sizes in logs (another netscape server kludge :) Could cause KByte xfer sizes to become corrupt. o Several small changes (mostly ifdef/endif's) to make code compile clean 'out-of-the-box' across more platforms (ala SunOS). Also added a GNU autoconf 'configure' script which helps a bit as well. o Added Include* keywords. Allows forcing the inclusion of specified log records. Takes precedence over counterpart Ignore* keywords. o Added HTMLPre, HTMLBody, HTMLEnd and HTMLExtension keywords, and changed behaviour of HTMLHead keyword. Previous versions need only change the 'HTMLHead' keword in existing files to 'HTMLBody' to upgrade. Thanks to Colin Viebrock for the idea and code examples. o Changed mangle agent code to support Opera and other browsers. Also updated response codes to IETF HTTP/1.1 Rev 6 draft. Thanks to Yves Lafon for this these. o Added HistoryName and IncrementalName keywords, which allow the specification of the history and incremental data filenames. o Added UseHTTPS keyword, which allows using 'https://' instead of 'http://' for links to URLS in the 'Top URLs' table. Also added check for URLs that already have the protocol specified (such as on virtual web and proxy servers), and to use unmodified if found (will only force to lowercase for matching). o Added code to ignore out-of-sequence log records. o Added code to force hostnames to lowercase (was causing country skew). o Disabled display of blank (zero hit) days at start of daily stat table. o Added records per second calculation to timing totals. o ALT= tags now use translated strings instead of forcing english. o Updated documentation for new functions/features. -------------------------------------------------------------------- 1.20-xx changes from 1.12-10 -------------------------------------------------------------------- Fixes: o Modified record parse routine to not touch stuff between quotes ("). Was causing problems parsing some malformed request fields. o Fixed memory leak in MangleAgent code, and relocated to elimitate un-necessary processing (causing segfault on some machines). Changes/Additions: o Changed transfer totals on host/url structures to support large groupings (such as *.gif) on heavly hit servers. Hopefully, this should cure the 32bit overflow problem large sites were having. o Changed daily transfer totals to support transfers greater than roughly 4.2 gigabytes a day. o Added some missing HTML tags and altered the way totals are calculated on the 'Top' tables (to correct for grouped records). o Added incremental run capability (-p command line option or "Incremental" configuration file keyword). -------------------------------------------------------------------- 1.1x-xx changes from 1.00-05 -------------------------------------------------------------------- Fixes: o Re-wrote the Group* logic, fixing a bug that allowed hiding of objects when they shouldn't be. o Fixed broken IgnoreReferrer code. o Modified config parse code to handle extended characters. o Misc. minor bug fixes/changes. Added a missing fclose. o Cleaned up generated HTML. o Fixed duplicate warnings on large referrer fields. o Fixed country table bug adding grouped records to totals. Changes/Additions: o Added GroupSite, GroupReferrer and GroupAgent keywords to round out the Group* configuration options. o Added GroupShading and GroupHighlight keywords to allow selective highlight and shading on grouped rows in table. o Removed the '-L' command line option. Groupings can now only be specified from a configuration file. Language files changed to reflect change. o Added '-V' command line option (identical to '-v') for version. o Added additional language support. Language files will be marked /* New for 1.1 */ where changes have been made. o Various rewrites to streamline the code, accomidate the new group options and make things easier down the road when I implement incremental (partial log) processing. o Usual README and CHANGES documentation updates. -------------------------------------------------------------------- 1.00-xx changes from 0.99-06 -------------------------------------------------------------------- Fixes: o Modify record parser so that spaces in usernames (auth field) don't cause record to be skipped (w/'Bad Record' message). o Included various error conditions that were being ignored in the timing statistics ('bad records' value) totals. Changes/Additions: o Added GMTTime (-g) option to force display of timestamps in GMT (UTC) time instead of local timezone. o Added GroupURL (-L) option for grouping of URLs as if they were a single object. See README for details. o Language support in the form of a language specific header file containing all strings used by The Webalizer. English file is used by default unless changed. Support for other languages will be distributed as I receive them. -------------------------------------------------------------------- 0.99-xx changes from 0.98-16 -------------------------------------------------------------------- 0.99 is mostly a bug-fix release, with a few added extra goodies. Fixes: o Fixed monthly total transfer size (silent) overflow problem. o Fixed the numerous fprintf format errors. Only seemed to wreak havok on non-intel machines though. o Fixed core dump condition on certain machines when using stdin for input. o Fixed floating point code that caused divide by zero errors on some platforms (most noticably on SCO OpenServer). o Netscape server kludges: Added code to deal with Netscape log header record gracefully. Also added workaround for timestamp error where Netscape sometimes makes a day have 0-24 hours instead of 0-23. The Webalizer will now treat anything greater than 23 as 0. o Resized some fixed field sizes to gain memory usage improvements. Changes/Additions: o Ignore* config keywords added. This allows you to completely ignore certain log records based on site name, URL, user agent or referrer. * Use will cause inaccurate statistics results. See documentation. o ReallyQuiet config keyword (-Q command line option) added. Causes The Webalizer to supress _all_ messages. Useful for cron jobs. o Removed the "Sites" total at the bottom of the summary by month. The total for sites is a useless number and produces a misleadingly high value which detracts from the accuracy of the other totals. o Updated README and CHANGES webalizer-2.23-05/COPYING0000644000175000017500000004310610771016751013314 0ustar bradbrad GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19yy name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. webalizer-2.23-05/Copyright0000644000175000017500000000167711510253063014152 0ustar bradbrad webalizer - a web server log analysis program Copyright (C) 1997-2011 Bradford L. Barrett This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version, and provided that the above copyright and permission notice is included with all distributed copies of this or derived software. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA webalizer-2.23-05/DNS.README0000644000175000017500000003414011032254167013556 0ustar bradbradThe Webalizer - A log file analysis program -- DNS information The webalizer has the ability to perform reverse DNS lookups, and fully supports both IPv4 and IPv6 addressing schemes. This document attempts to explain how it works, and some things that you should be aware of when using the DNS lookup features. Note: The Reverse DNS feature may be enabled or disabled at compile time. DNS lookup code is enabled by default. You can run The Webalizer using the '-vV' command line options to determine what options are enabled in the version you are using. How it works ------------ DNS lookups are made against a DNS cache file containing IP addresses and resolved names. If the IP address is not found in the cache file, it will be left as an IP address. In order for this to happen, a cache file MUST be specified when the Webalizer is run, either using the '-D' command line switch, or a "DNSCache" configuration file keyword. If no cache file is specified, no attempts to perform DNS lookups will be done. The cache file can be made three different ways. 1) You can have the Webalizer pre-process the specified log file at run-time, creating the cache file before processing the log file normally. This is done by setting the number of DNS Children processes to run, either by using the '-N' command line switch or the "DNSChildren" configuration keyword. This will cause the Webalizer to spawn the specified number of processes which will be used to do reverse DNS lookups.. generally, a larger number of processes will result in faster resolution of the log, however if set too high may cause overall system degradation. A setting of between 5 and 20 should be acceptable, and there is a maximum limit of 100. If used, a cache filename MUST be specified also, using either the '-D' command line switch, or the "DNSCache" configuration keyword. Using this method, normal processing will continue only after all IP addresses have been processed, and the cache file is created/updated. 2) You can pre-process the log file as a standalone process, creating the cache file that will be used later by the Webalizer. This is done by running the Webalizer with a name of 'webazolver' (ie: the name 'webazolver' is a symbolic link to 'webalizer') and specifying the cache filename (either with '-D' or DNSCache). If the number of child processes is not given, the default of 5 will be used. In this mode, the log will be read and processed, creating a DNS cache file or updating an existing one, and the program will then exit without any further processing. 3) You can use The Webalizer (DNS) Cache file Manager program 'wcmgr' to create and manipulate a cache file. A blank cache file can be created which would be later populated, or data for the cache file can be imported using tab delimited text files. See the wcmgr(1) man page for usage information. Run-time DNS cache file creation/update --------------------------------------- The creation/update of a DNS cache file at run-time occurs as follows: 1) The log file is read, creating a list of all IP addresses that are not already cached (or cached but expired) and need to be resolved. Addresses are expired based on the TTL value specified using the 'CacheTTL' configuration option or after 7 days (default) if no TTL is specified. 2) The specified number of children processes are forked, and are used to perform DNS lookups. 3) Each IP address is given, one at a time, to the next available child process until all IP addresses have been processed. Each child will update the cache file when a result is returned. This may be either a resolved name or a failed lookup, in which case the address will be left unresolved. Unresolved addresses are not normally cached, but can be, if enabled using the 'CacheIPs' configuration file keyword. 4) Once all IP addresses have been processed and the cache file updated, the Webalizer will process the log normally. Each record it finds that has an unresolved IP address will be looked up in the cache file to see if a hostname is available (ie: was previously found). Because there may be a significant amount of time between the initial unresolved IP list and normal processing, the Webalizer should not be run against live log files (ie: a log file that is actively being written to by a server), otherwise there may be additional records present that were not resolved. Stand-Alone DNS cache file creation/update ------------------------------------------ The creation/update of the DNS cache file, when run in stand-alone mode, occurs as follows: 1) The log file is read, creating a list of all IP addresses that are not already cached (or cached but expired) and need to be resolved. 2) The specified number of children processes are forked, and are used to perform DNS lookups. If the number of processes was not specified, the default of 5 will be used. 3) Each IP address is given, one at a time, to the next available child process until all IP addresses have been processed. Each child will update the cache file when a result is returned. 4) Once all IP addresses have been processed and the cache file updated, the program will terminate without any further processing. Larger sites may prefer to use a stand-alone process to create the DNS cache file, and then run the Webalizer against the cache file. This allows a single cache file to be used for many virtual hosts, and reduces the processing needed if many sites are being processed. The Webalizer can be used in stand alone mode by running it as 'webazolver'. When run in this fashion, it will only create the cache file and then exit without any further processing. A cache filename MUST be specified, however unlike when running the Webalizer normally, the number of child processes does not have to be given (will default to 5). All normal configuration and command line options are recognized, however, many of them will simply be ignored.. this allows the use of a standard configuration file for both normal use and stand alone use. Examples: --------- webalizer -c test.conf -N 10 -D dns_cache.db /var/log/my_www_log This will use the configuration file 'test.conf' to obtain normal configuration options such as hostname and output directory.. it will then either create or update the file 'dns_cache.db' in the default output directory (using 10 child processes) based on the IP addresses it finds in the log /var/lib/my_www_log, and then process that log file normally. webalizer -o out -D dns_cache.db /var/log/my_www_log This will process the log file /var/log/my_www_log, resolving IP addresses from the cache file 'dns_cache.db' found in the default output directory "out". The cache file must be present as it will not be created with this command. for i in /var/log/*/access_log; do webazolver -N 20 -D /var/lib/dns_cache.db $i done The above is an example of how to run through multiple log files creating a single DNS cache file.. this might be typically used on a larger site that has many virtual hosts, all keeping their log files in a separate directory. It will process each access_log it finds in /var/log/* and create a cache file (var/lib/dns_cache.db). This cache file can then be used to process the logs normally with with the Webalizer in a read-only fashion (see next example). for i in /etc/webalizer/*.conf; do webalizer -c $i -D /etc/cache.db; done This will process each configuration file found in /etc/webalizer, using the DNS cache file /etc/cache.db. This will also typically be used on a larger site with multiple hosts.. Each configuration file will specify a site specific log file, hostname, output directory, etc. The cache file used will typically be created using a command similar to the one previous to this example. Cache File Maintenance ---------------------- The Webalizer DNS cache files generally require very little or no special attention. There are times though when some maintenance is required, such as occasional purging of very old cache entries. The Webalizer never removes a record once it's inserted into the cache. If a record expires based on its timestamp, the next time that address is seen in a log, its name is looked up again and the timestamp is updated. However, there will always be addresses that are never seen again, which will cause the cache files to continue to grow in size over time. On extremely busy sites or sites that attract many one time visitors, the cache file may grow extremely large, yet only contain a small amount of valid entries. Using The Webalizer (DNS) Cache file Manager ('wcmgr'), cache files can be purged, removing expired entries and shrinking the file size. A TTL (time to live) value can be specified, so the length of time an entry remains in the cache can be varied depending on individual site requirements. In addition to purging cache files, 'wcmgr' can also be used to list cache file contents, import/export cache data, lookup/add/delete individual entries and gather overall statistics regarding the cache file (number of records, number expired, etc..). To purge a cache file using 'wcmgr', an example command would be: wcmgr -p31 /path/to/dns.cache This would purge the 'dns.cache' cache file of any records that are over 31 days old, and would reclaim the space that those records were using in the file. If you would like to see the records that get purged, adding the command line option '-v' (verbose) will cause the program to print each entry and its age as they are removed. You can also use the 'wcmgr' to display statistics on cache files to aid in determining when a cache file should be purged. See the 'wcmgr' man page (wcmgr.1) for additional information on the various options available. Stupid Cache Tricks ------------------- The DNS cache files used by The Webalizer allow for efficient IP address to name translations. Resolved names are normally generated by using an existing DNS name server to query the address, either locally or over the Internet. However, using The Webalizer (DNS) Cache file Manager, almost any IP address to Name translation can be included in the cache. One such example would be for mapping local network addresses to real names, even though those addresses may not have real DNS entries on the network (or may be 'local' addresses prohibited from use on the Internet). A simple tab delimited text file can be created and imported into a cache for use by The Webalizer, which will then be used to convert the local IP addresses to real names. Additional configuration options for The Webalizer can then be used as would be normally. For example, consider a small business with 10 computers and a DSL router to the Internet. Each machine on the local network would use a private IP address that would not be resolved using an external (public) DNS server, so would always be reported by The Webalizer as 'unknown/unresolved'. A simple cache file could be created to map those unresolved addresses into more meaningful names, which could then be further processed by the Webalizer. An example might look something like: # Local machines 192.168.123.254 0 0 gw.widgetsareus.lan 192.168.123.253 0 0 mail.widgetsareus.lan 192.168.123.250 0 0 sales.widgetsareus.lan 192.168.123.240 0 0 service.widgetsareus.lan 192.168.123.237 0 0 mgr.widgetsareus.lan 192.168.123.235 0 0 support1.widgetsareus.lan 192.168.123.234 0 0 support2.widgetsareus.lan 192.168.123.232 0 0 pres.widgetsareus.lan 192.168.123.230 0 0 vp.widgetsareus.lan 192.168.123.225 0 0 reception.widgetsareus.lan 192.168.123.224 0 0 finance.widgetsareus.lan 127.0.0.1 0 1 127.0.0.1 There are a couple of things here that should be noted. The first is that the timestamps (first zero on each line above) are set to zero. This tells The Webalizer that these cached entries are to be considered 'permanent', and should never be expired (infinite TTL or time to live). The second thing to note is that the resolved names are using a non-standard TLD (top level domain) of '.lan'. The Webalizer will map this special TLD to mean "Local Network" in its reports, which allows local traffic to be grouped separately from normal Internet traffic. Lastly, you may notice that the last line of the file contains an entry with the same IP address where a name should be. This entry will prevent the Webalizer from ever trying to lookup 127.0.0.1, which is the 'localhost' address, when it is found in a log. The second number after the IP address (1) tells the Webalizer that it is an unresolved entry, not a resolved hostname (ie: has no name). Entries such as this one can be used to reduce DNS lookups on addresses that are known not to resolve. Considerations -------------- Processing of live log files is discouraged, as the chances of log records being written between the time of DNS resolution and normal processing will cause problems. If you are using STDIN for the input stream (log file) and have run-time DNS cache file creation/update enabled.. the program will exit after the cache file has been created/updated and no output will be produced. If you must use STDIN for the input log, you will need to process the stream twice, once to create/update the cache file, and again to produce the reports. The reason for this is that stream inputs from STDIN cannot be 'rewound' to the beginning like files can, so must be given twice. Cached DNS addresses have a default TTL (time to live) of 7 days. This may now be changed using the CacheTTL config file keyword to any value from 1 to 100 (days). You may also now specify if unresolved addresses should be stored in the DNS cache. Normally, unresolved IP addresses are NOT saved in the cache and are looked up each time the program is run. There is an absolute maximum of 100 child processes that may be created, however the actual number of children should be significantly less than the maximum.. typical usage should be between 5 and 20. Special thanks to Henning P. Schmiedehausen for the original dns-resolver code he submitted, which was the basis for this implementation. Also thanks to Jose Carlos Medeiros for the inital IPv6 support code. webalizer-2.23-05/INSTALL0000644000175000017500000003453511035334420013306 0ustar bradbradInstallation instructions for The Webalizer The Webalizer is distributed in either source or binary distributions, and installation is different for each type. Regardless of the type of installation, you need to obtain and un-tar/un-zip the distribution. For binary distributions, you should create a directory somewhere and chdir to it before unpacking the file. Source distributions will automagically create a directory for you (webalizer-x.xx-xx). If you are upgrading from a previous version, check the CHANGES file, and the README.FIRST file for important upgrade information. For Binary distributions ------------------------ You should have all the files you need in the directory you created when you un-tarred/un-zipped the distribution file. The file 'webalizer' in this directory is the binary executable. Copy this someplace useful, like /usr/local/bin or /usr/bin. A man page for The Webalizer is also supplied... If desired, copy the file 'webalizer.1' to your local man directory (ie: /usr/local/man/man1). (You may also need to run 'makeinfo' or similar) Note: There may also be platform specific installation instructions and/or usage notes supplied with the binary distribution. You should read them, as that will be your starting point if problems are encountered. Most of the binary distributions are submitted by users, and I cannot support them the same way I can the Linux binary distribution and the source code itself. For Source distributions ------------------------ The Webalizer requires, at a minimum, the GD graphics library (http://www.libgd.org/), the PNG (portable network graphics) graphics library ( http://www.libpng.org/pub/png/ ), the Zlib compression library ( http://www.zlib.net/ ) and associated header files for these libraries. Most modern systems will have these libraries, but may or may not have the required header files for them unless you installed the 'dev' (development) versions (which include the required header files along with the libraries). Consult your systems documentation for specifics. For native DNS and Geolocation (GeoDB) support, the Berkeley DB library (by sleepycat, now owned by Oracle) v4.1 or higher and associated header file is required. http://www.oracle.com/technology/products/berkeley-db/ For BZip2 support, the bzip2 compression library and header file is required. http://www.bzip.org/ For GeoIP geolocation support, the GeoIP library (by MaxMind, Inc.) and header file is required, along with a Country Edition database. http://www.maxmind.com/app/ip-location New style build: The Webalizer source distribution now comes packaged with a GNU autoconf 'configure' script, which should allow you to simply type: ./configure make make install Normal configure options apply, type ./configure --help to get a complete list. A few options in particular may be useful: --sysconfdir=/etc The sysconfdir switch specifies where the default configuration file (webalizer.conf) should be looked for. If not specified, the default of ${prefix}/etc is used. --with-language= Allows you to specify the language to use. Check the /lang directory to see the available language choices. As an example, you could use ./configure --with-language=french to compile the program using french (webalizer_lang.french) for output. You can also use the --without-language switch, which will use the default language (english). --enable-dns DNS lookup and native geolocation features are added if the required library (libdb) and header file (db.h) are found. DNS/GeoDB code is enabled at compile time by using the -DUSE_DNS compiler switch. For GeoDB lookups, a current geodb database is also required (available at ftp://ftp.mrunix.net/pub/webalizer/geodb). --with-geodb= The default location for the GeoDB database is /usr/share/GeoDB but may be changed using this option. --enable-bz2 BZip2 compression support will be added if the required library (libbz2) and header file (bzlib.h) are found. BZip2 code is enabled at compile time using the -DUSE_BZIP compiler switch. --enable-geoip GeoIP geolocation support will be added if the required library (libGeoIP) and header file (GeoIP.h) are found. No attempt is made to locate a valid Country Edition database, which is also required for GeoIP lookups to be performed. GeoIP code is enabled at compile time using the -DUSE_GEOIP compiler switch. Some systems may require unusual settings that the configure script cannot determine. You can pass values to the script by setting environment variables. For example: CC=c89 CFLAGS=-O LIBS=-lposix ./configure --with-language=german Would allow you to set the compiler (c89) and various flags and libraries to use, which would then be passed to the configure script and eventually to the Makefile generated. It also will cause the program to be compiled using German instead of the English default. Additionally, the various --with- and --with- options allow specification of non-standard locations for the various libraries and headers. For example, if you built the bzip2 library in /src/bzip2, you could use: ./configure --with-bz2=/src/bzip2 --with-bz2lib=/src/bzip2 --enable-bz2 to specify where the bz2 header files (--with-bz2) and library (--with-bz2lib) are located. They should then be detected by the configure script and enabled. Please note that if you are linking against a shared library (ie: libbz2.so), then even though configure script finds the library, and The Webalizer compiles successfully, the program may FAIL when run because the systems run-time linking loader cannot find the library. If this happens, then you need to tell the loader where the library is, and is dependent upon what type system is being used. Some platforms require the path to the library to be placed in the LD_LIBRARY_PATH environment variable.. some (such as linux based platforms) use the ld.so.conf file and ldconfig program to configure the dynamic linker run-time bindings. Consult the documentation for your system specific requirements. For package maintainers, the environment variable DESTDIR can be used to specify a root directory for installation. This is the top level directory under which all other directories will be placed when 'make install' is invoked, and allows binary packages to be easily built outside the normal root directory tree. For example, if you wish to build a binary package of The Webalizer under the /usr/pkg/webalizer-2.20 directory, you could type: make install DESTDIR=/usr/pkg/webalizer-2.20 Which would then create the following directory tree: /usr/pkg/webalizer-2.20/ /usr/pkg/webalizer-2.20/etc/ /usr/pkg/webalizer-2.20/etc/webalizer.conf.sample /usr/pkg/webalizer-2.20/usr/ /usr/pkg/webalizer-2.20/usr/bin/ /usr/pkg/webalizer-2.20/usr/bin/webalizer /usr/pkg/webalizer-2.20/usr/bin/webazolver -> webalizer /usr/pkg/webalizer-2.20/usr/bin/wcmgr /usr/pkg/webalizer-2.20/usr/man/ /usr/pkg/webalizer-2.20/usr/man/man1/ /usr/pkg/webalizer-2.20/usr/man/man1/webalizer.1 /usr/pkg/webalizer-2.20/usr/man/man1/webazolver.1 -> webalizer.1 /usr/pkg/webalizer-2.20/usr/man/man1/wcmgr.1 If the configure script doesn't work for you.. please let me know (along with relevant info like system type, compiler, etc..) If you are able and can tweak something to make it work, let me know as well. Old style build: If you have a platform that the configure script won't work on, or some other situation where you have to configure and build the source yourself, the file 'Makefile.std' is a "stock" Makefile that you can use to build the Webalizer. Copy or rename the file to 'Makefile', edit to match your system, and do the usual 'make'. This is a very generic Makefile, so expect to have to tweak it for your particular platform and configuration. If everything seems to have gone well, next type 'make install' to do a stock install. Again, you may want to tweak the Makefile for the install, or skip the 'make install' step completely (see below). This will install the Webalizer on your system, and put a sample configuration file in /etc (named 'webalizer.conf.sample'). If you don't want to use the 'make install' method... just copy the file 'webalizer' to someplace useful, and you are ready to go :) Usage ----- When run, The Webalizer will read the specified log file and produce HTML output in the directory specified (or current directory if none). You may specify various configuration options either on the command line or in a configuration file. The format of the command line is: webalizer [options] [log_file] Where 'options' may be any of the valid command line options described in the README file. If a log filename is not given, input is taken from stdin. A typical command line might look something similar to: webalizer /var/lib/httpd/logs/access_log This will produce output in the current directory based on the logfile /var/lib/httpd/logs/access_log. Another example: webalizer -c somehost.conf This will read the configuration file somehost.conf, which should specify, among other things, the log filename and output directory to use. You can use 'webalizer -h' to get a list of available command line options, or view the file README for complete instructions on all available configuration options. You should note that The Webalizer will _always_ look for a configuration file named 'webalizer.conf' in either the current directory or in /etc/, and will process that file _before_ any other configuration or command line options. If you run a single server, you may want to create a default configuration file and place it in the /etc/ directory. This will allow you to simply type 'webalizer' without the need to specify additional command line options. Configuration ------------- The Webalizer can be customized in many ways using either the command line or configuration files. To test The Webalizer, type: 'webalizer /var/lib/httpd/logs/access_log', changing the directory to wherever your log files are. After processing, you should have the output and a file named index.html which can be viewed with any browser. The Webalizer can accept many command line options as well, type 'webalizer -h' to view them. In addition to the command line options, The Webalizer can be customized using configuration files. There is a sample.conf file that is part of both the source and binary distributions that can be used as a 'template' for creating your own site configuration file. Just make a copy of the file and name it something like 'mysite.conf'. Edit the new file to match your particular setup and taste. To test the new configuration file, type 'webalizer -c mysite.conf' (or whatever your configuration file is named). Fire up the browser and look at the results. If you rename your new configuration file to 'webalizer.conf', you will only need to type 'webalizer', and The Webalizer will use it as the default. See the README file for more on configuration and use of configuration files. Language Support ---------------- Language support is provided as language specific header files that must be compiled into the program. If you don't have the source code, get it. If you can't compile the program yourself, ask a friend. The /lang/ directory of the distribution contains all supported languages at the time of release. Additional/updated language files will be found at ftp://ftp.webalizer.org/pub/webalizer/lang and are always the most current versions. To build with language support, use the --with-language option of the configure script. This will automagically do for you the steps described below. If you can't use the configure script, you can manually select the language file to use. In the webalizer source directory, you will find a symbolic link for the file webalizer_lang.h, and it will be pointing to the file webalizer_lang.english which is the default. Delete the link (ie: rm webalizer_lang.h) and create a new one to the language file you want The Webalizer to use (ie: ln -s lang/webalizer_lang.spanish webalizer_lang.h) and re-compile the program. Note: The source distribution of The Webalizer contains all language support files that were available at the time. Additional/updated language files can be found at: ftp://ftp.webalizer.org/pub/webalizer/lang where I will put them as I receive them. Common Questions ---------------- Q: Will it run on [some platform] A: If it is a *nix platform, it should without a problem. If it's something different, probably not and your on your own if you want to try to make it work. Q: When I compile, I get "file not found" errors? A: Most likely, the compiler cant find the header files for one the required libraries. If they are someplace other than the standard locations (ie: /usr/include), then you probably need to specify an alternate location to look using one of the --with- command line switches when you run configure, or edit the Makefile and specify the location with an '-I' compiler flag. Q: I get "libgd not found' errors? A: You don't have the GD graphics located in a standard library path, or you don't have the GD graphics library at all. If the later, go to http://www.boutell.com/gd/ and grab a copy. If you do have it, add a -L switch in the Makefile to point to the proper location. Q: I get unresolved symbol errors when compiling, why? A: This most often occurs when the GD library was built with additional support for such things as TrueType fonts or X11 graphics. The configure script for The Webalizer only checks that the gd library is available, and does not check any other dependencies it may have. Typically, to fix this problem, you need to edit the Makefile and add the dependent libraries to a compiler switch (or pass them on the command line when running the configure script). For example, if you are getting errors about not finding truetype routines, you may need to add '-lttf' (for 'libttf', the truetype library) to the "LIBS" variable. Hint: I usually find it easier to just grab the GD library source, and compile it myself locally as a static library, in a directory just above where I compile The Webalizer. Then, at configure time, just add the '-with-gd=../gd' and '--with-gdlib=../gd' switches, and the GD graphic stuff will be statically linked into The Webalizer, eliminating any other library dependencies that the normal, shared library on my system may have. webalizer-2.23-05/Makefile.in0000644000175000017500000000774611510253210014321 0ustar bradbrad# # Makefile for webalizer - a web server log analysis program # # Copyright (C) 1997-2011 Bradford L. Barrett # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version, and provided that the above # copyright and permission notice is included with all distributed # copies of this or derived software. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details (file "COPYING"). # prefix = @prefix@ exec_prefix = @exec_prefix@ datadir = @datarootdir@ BINDIR = @bindir@ MANDIR = ${datadir}/man/man1 ETCDIR = @sysconfdir@ GEODB = @GEODB_LOC@ CC = @CC@ CFLAGS = @CFLAGS@ @CPPFLAGS@ LIBS = @LIBS@ WCMGR_LIBS = @WCMGR_LIBS@ DEFS = -DETCDIR=\"${ETCDIR}\" -DGEODB_LOC=\"${GEODB}\" @DEFS@ @OPTS@ LDFLAGS = @LDFLAGS@ INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ DEFLANG = @DEFAULT_LANG@ # Shouldn't have to touch below here! all: webalizer wcmgr webalizer: webalizer.o webalizer.h hashtab.o hashtab.h \ linklist.o linklist.h preserve.o preserve.h \ dns_resolv.o dns_resolv.h parser.o parser.h \ output.o output.h graphs.o graphs.h lang.h \ webalizer_lang.h $(CC) ${LDFLAGS} -o webalizer webalizer.o hashtab.o linklist.o preserve.o parser.o output.o dns_resolv.o graphs.o ${LIBS} rm -f webazolver @LN_S@ webalizer webazolver webalizer.o: webalizer.c webalizer.h parser.h output.h preserve.h \ graphs.h dns_resolv.h webalizer_lang.h $(CC) ${CFLAGS} ${DEFS} -c webalizer.c parser.o: parser.c parser.h webalizer.h lang.h $(CC) ${CFLAGS} ${DEFS} -c parser.c hashtab.o: hashtab.c hashtab.h dns_resolv.h webalizer.h lang.h $(CC) ${CFLAGS} ${DEFS} -c hashtab.c linklist.o: linklist.c linklist.h webalizer.h lang.h $(CC) ${CFLAGS} ${DEFS} -c linklist.c output.o: output.c output.h webalizer.h preserve.h \ hashtab.h graphs.h lang.h $(CC) ${CFLAGS} ${DEFS} -c output.c preserve.o: preserve.c preserve.h webalizer.h parser.h \ hashtab.h graphs.h lang.h $(CC) ${CFLAGS} ${DEFS} -c preserve.c dns_resolv.o: dns_resolv.c dns_resolv.h lang.h webalizer.h $(CC) ${CFLAGS} ${DEFS} -c dns_resolv.c graphs.o: graphs.c graphs.h webalizer.h lang.h $(CC) ${CFLAGS} ${DEFS} -c graphs.c wcmgr: wcmgr.o $(CC) ${LDFLAGS} -o wcmgr wcmgr.o ${WCMGR_LIBS} wcmgr.o: wcmgr.c $(CC) ${CFLAGS} ${DEFS} -c wcmgr.c clean: rm -f webalizer webazolver wcmgr *.o usage*.png daily*.png hourly*.png rm -f ctry*.png *.html *.hist *.current core *.gif distclean: clean rm -f webalizer.conf *.tar *.tgz *.Z *.tar.gz rm -f Makefile webalizer_lang.h config.cache config.log config.status @LN_S@ lang/webalizer_lang.@DEFAULT_LANG@ webalizer_lang.h install: all mkdir -p ${DESTDIR}${BINDIR} mkdir -p ${DESTDIR}${MANDIR} mkdir -p ${DESTDIR}${ETCDIR} $(INSTALL_PROGRAM) webalizer ${DESTDIR}${BINDIR}/webalizer $(INSTALL_PROGRAM) wcmgr ${DESTDIR}${BINDIR}/wcmgr rm -f ${DESTDIR}${BINDIR}/webazolver @LN_S@ webalizer ${DESTDIR}${BINDIR}/webazolver $(INSTALL_DATA) webalizer.1 ${DESTDIR}${MANDIR}/webalizer.1 $(INSTALL_DATA) wcmgr.1 ${DESTDIR}${MANDIR}/wcmgr.1 rm -f ${DESTDIR}${MANDIR}/webazolver.1 @LN_S@ webalizer.1 ${DESTDIR}${MANDIR}/webazolver.1 $(INSTALL_DATA) sample.conf ${DESTDIR}${ETCDIR}/webalizer.conf.sample uninstall: rm -f ${DESTDIR}${BINDIR}/webalizer rm -f ${DESTDIR}${BINDIR}/webazolver rm -f ${DESTDIR}${BINDIR}/wcmgr rm -f ${DESTDIR}${MANDIR}/webalizer.1 rm -f ${DESTDIR}${MANDIR}/webazolver.1 rm -f ${DESTDIR}${MANDIR}/wcmgr.1 rm -f ${DESTDIR}${ETCDIR}/webalizer.conf.sample rm -f webalizer_lang.h @LN_S@ lang/webalizer_lang.${DEFLANG} webalizer_lang.h webalizer-2.23-05/Makefile.std0000644000175000017500000001044411510253251014477 0ustar bradbrad# # Makefile for webalizer - a web server logfile analysis thingie # # (c)1997-2011 by Bradford L. Barrett # Distributed under the GNU GPL. See "README" and "Copyright" # files supplied with this distribution for more information. # # This works on my Linux and Solaris systems, and should work # out of the box on other GCC based systems. Tweek the values # below for your environment if needed before running make. # # Use these for SCO (and maybe others) #BINDIR = /usr/bin #MANDIR = /usr/man/man1 #ETCDIR = /etc #CC = cc #CFLAGS = -b elf #LDFLAGS= -L../usr/local/lib #LIBS = -lgd -lm -lpng -lz #DEFS = -DETCDIR=\"${ETCDIR}\" -DHAVE_MATH_H # These will build The Webalizer with DNS support # on my Linux system. GD is statically built and # is located in the ../gd directory. This system # also has a stock install of the berkeley db lib # (libdb in /usr/lib and db.h in /usr/include). BINDIR = /usr/local/bin MANDIR = /usr/local/man/man1 ETCDIR = /etc CC = gcc CFLAGS = -Wall -O2 -I../gd LDFLAGS= -L/usr/local/lib -L../gd LIBS = -lgd -lpng -lz -lm -ldb DEFS = -DETCDIR=\"${ETCDIR}\" -DHAVE_MATH_H -DUSE_DNS # Some might need this instead (Solaris?!?) #LIBS = -lgd -lpng -lz -lm -ldb -lnsl -lsocket -lrt # if you want to use a different default directory for the # GeoDB database, add this to DEFS: -DGEODB_LOC=\"/usr/share/GeoDB\" # if you have header files in a non-standard place, you # should specify them on the CFLAGS line, like: #CFLAGS = -Wall -O2 -I../gd -I/src/bzip2 # similar with library locations. add non-standard paths # using the LDFLAGS variable, like this: #LDFLAGS = -L/usr/local/lib -L/src/bzip2 # If your GD lib was compiled with X/truetype, you may need # to use this or some variation of it: #LIBS = -lgd -lpng -lz -lm -ldb -lX11 -lXpm -lttf # If you want bzip2 support, you need to define USE_BZIP # and add the bz2 library like below: #LIBS = -lgd -lpng -lz -lm -lbz2 #DEFS = -DETCDIR=\"${ETCDIR}\" -DHAVE_MATH_H -DUSE_BZIP # GeoIP support? You need USE_GEOIP and -lGeoIP #LIBS = -lgd -lpng -lz -lm -lGeoIP #DEFS = -DETCDIR=\"${ETCDIR}\" -DHAVE_MATH_H -DUSE_GEOIP # want it all?!? Give this a whirl: #LIBS = -lgd -lpng -lz -lm -lGeoIP -lbz2 -ldb #DEFS = -DETCDIR=\"${ETCDIR}\" -DHAVE_MATH_H -DUSE_GEOIP -DUSE_DNS -DUSE_BZIP # Shouldn't have to touch below here! all: webalizer wcmgr webalizer: webalizer.o webalizer.h hashtab.o hashtab.h \ linklist.o linklist.h preserve.o preserve.h \ dns_resolv.o dns_resolv.h parser.o parser.h \ output.o output.h graphs.o graphs.h lang.h \ webalizer_lang.h $(CC) ${LDFLAGS} -o webalizer webalizer.o hashtab.o linklist.o preserve.o parser.o output.o dns_resolv.o graphs.o ${LIBS} rm -f webazolver ln -s webalizer webazolver rm -f webazolver.1 ln -s webalizer.1 webazolver.1 webalizer.o: webalizer.c webalizer.h parser.h output.h preserve.h \ graphs.h dns_resolv.h webalizer_lang.h $(CC) ${CFLAGS} ${DEFS} -c webalizer.c parser.o: parser.c parser.h webalizer.h lang.h $(CC) ${CFLAGS} ${DEFS} -c parser.c hashtab.o: hashtab.c hashtab.h dns_resolv.h webalizer.h lang.h $(CC) ${CFLAGS} ${DEFS} -c hashtab.c linklist.o: linklist.c linklist.h webalizer.h lang.h $(CC) ${CFLAGS} ${DEFS} -c linklist.c output.o: output.c output.h webalizer.h preserve.h \ hashtab.h graphs.h lang.h $(CC) ${CFLAGS} ${DEFS} -c output.c preserve.o: preserve.c preserve.h webalizer.h parser.h \ hashtab.h graphs.h lang.h $(CC) ${CFLAGS} ${DEFS} -c preserve.c dns_resolv.o: dns_resolv.c dns_resolv.h lang.h webalizer.h $(CC) ${CFLAGS} ${DEFS} -c dns_resolv.c graphs.o: graphs.c graphs.h webalizer.h lang.h $(CC) ${CFLAGS} ${DEFS} -c graphs.c wcmgr: wcmgr.o $(CC) ${LDFLAGS} -o wcmgr wcmgr.o ${LIBS} wcmgr.o: wcmgr.c webalizer.h $(CC) ${CFLAGS} ${DEFS} -c wcmgr.c clean: rm -f webalizer *.o usage*.png daily*.png hourly*.png ctry*.png rm -f *.html *.hist *.current core *.gif distclean: clean rm -f webalizer.conf *.tar *.tgz *.Z *.tar.gz rm -f Makefile webalizer_lang.h config.cache config.log config.status ln -s lang/webalizer_lang.english webalizer_lang.h install: all cp webalizer.1 ${MANDIR}/webalizer.1 cp webalizer ${BINDIR}/webalizer cp sample.conf ${ETCDIR}/webalizer.conf.sample uninstall: rm -f ${MANDIR}/webalizer.1 rm -f ${BINDIR}/webalizer rm -f ${BINDIR}/webalizer.conf.sample webalizer-2.23-05/README0000644000175000017500000031032311510253275013133 0ustar bradbradThe Webalizer - A web server log file analysis tool Copyright 1997-2011 by Bradford L. Barrett Distributed under the GNU GPL. See the files "COPYING" and "Copyright" supplied with the distribution for additional info. What is The Webalizer? ---------------------- The Webalizer is a web server log file analysis program which produces usage statistics in HTML format for viewing with a browser. The results are presented in both columnar and graphical format, which facilitates interpretation. Yearly, monthly, daily and hourly usage statistics are presented, along with the ability to display usage by site, URL, referrer, user agent (browser), search string, entry/exit page, username and country (some information is only available if supported and present in the log files being processed). Processed data may also be exported into most database and spreadsheet programs that support tab delimited data formats. The Webalizer supports CLF (common log format) log files, as well as Combined log formats as defined by NCSA and others, and variations of these which it attempts to handle intelligently. In addition, The Webalizer supports wu-ftpd xferlog (FTP) formatted logs, squid proxy logs and W3C extended format logs. Gzip compressed logs may be used as input directly. Any log filename that ends with a '.gz' extension will be assumed to be in gzip format and uncompressed on the fly as it is being read. The Webalizer now also has the ability to handle BZip2 compressed logs, if enabled at compile time. Similar to gzipped logs, any log filename that ends with a '.bz2' will be assumed to be in bzip2 format and uncompressed on the fly as it is being read. For sites that do not enable hostname lookups (DNS resolution) on their web servers (and have only IP addresses in their logs), The Webalizer provides its own internal DNS lookup capability as well as geolocation services (GeoDB). The optional GeoIP library from MaxMind Inc. is also supported and may be used instead of the native GeoDB database. A utility program, "The Webalizer (DNS) Cache file Manager", or 'wcmgr' is also provided which allows the creation and manipulation of the DNS cache files used and produced by the webalizer. See the file DNS.README for additional information regarding DNS support. This documentation applies to The Webalizer Version 2.21 Running the Webalizer --------------------- The Webalizer was designed to be run from a Unix command line prompt or as a cron job. There are several command line options which will modify the results it produces, and configuration files can be used as well. The format of the command line is: webalizer [options ...] [log-file] Where 'options' can be one or more of the supported command line switches described below. 'log-file' is the name of the log file to process (see below for more detailed information). If a dash ("-") is specified for the log-file name, STDIN will be used. Once executed, the general flow of the program follows: o A default configuration file is scanned for. A file named 'webalizer.conf' is searched for in the current directory, and if found, its configuration data is parsed. If the file is not present in the current directory, the file '/etc/webalizer.conf' is searched for and, if found, is used instead. o Any command line arguments given to the program are parsed. This may include the specification of a configuration file, which is processed at the time it is encountered. o If a log file was specified, it is opened and made ready for processing. If no log file was given, or the filename '-' is specified on the command line, STDIN is used for input. o If an output directory was specified, the program does a 'chdir' to that directory in preparation for generating output. If no output directory was given, the current directory is used. o If a non-zero number of DNS Children processes were specified, they will be started, and the specified log file will be processed, either creating or updating the specified DNS cache file. o If no hostname was given, the program attempts to get the hostname using a uname system call. If that fails, 'localhost' is used. o A history file is searched for. This file keeps previous month totals used on the main index.html page. The default file is named 'webalizer.hist', kept in the specified output directory, however may be changed using the "HistoryName" configuration file keyword. o If incremental processing was specified, a data file is searched for and loaded if found, containing the 'internal state' data of the program at the end of a previous run. The default file is named 'webalizer.current', kept in the specified output directory, however may be changed using the "IncrementalName" configuration file keyword. o Main processing begins on the log file. If the log spans multiple months, a separate HTML document is created for each month. o After main processing, the main 'index.html' page is created, which has totals by month and links to each months HTML document. o A new history file is saved to disk, which includes totals generated by The Webalizer during the current run. o If incremental processing was specified, a data file is written that contains the 'internal state' data at the end of this run. Incremental Processing ---------------------- Version 1.2x of The Webalizer adds incremental run capability. Simply put, this allows processing large log files by breaking them up into smaller pieces, and processing these pieces instead. What this means in real terms is that you can now rotate your log files as often as you want, and still be able to produce monthly usage statistics without the loss of any detail. This is accomplished by saving and restoring all relevant internal data to a disk file between runs. Doing so allows the program to 'start where it left off' so to speak, and allows the preservation of detail from one run to the next. Some special precautions need to be taken when using the incremental run capability of The Webalizer. Configuration options should not be changed between runs, as that could cause corruption of the internal stored data. For example, changing the MangleAgents level will cause different representations of user agents to be stored, producing invalid results in the user agents section of the report. If you need to change configuration options, do it at the end of the month after normal processing of the previous month and before processing the current month. You may also want to delete the 'webalizer.current' file as well (or whatever name was specified using the "IncrementalName" configuration option). The Webalizer also attempts to prevent data duplication by keeping track of the timestamp of the last record processed. This timestamp is then compared to current records being processed, and any records that were logged previous to that timestamp are ignored. This, in theory, should allow you to re-process logs that have already been processed, or process logs that contain a mix of processed/not yet processed records, and not produce duplication of statistics. The only time this may break is if you have duplicate timestamps in two separate log files... any records in the second log file that do have the same timestamp as the last record in the previous log file processed, will be discarded as if they had already been processed. There are lots of ways to prevent this however, for example, stopping the web server before rotating logs will prevent this situation. This setup also necessitates that you always process logs in chronological order, otherwise data loss will occur as a result of the timestamp compare. Output Produced --------------- The Webalizer produces several reports (html) and graphics for each month processed. In addition, a summary page is generated for the current and previous months (up to 12), a history file is created and if incremental mode is used, the current month's processed data. The exact location and names of these files can be changed using configuration files and command line options. The files produced, (default names) are: index.html - Main summary page (extension may be changed) usage.png - Yearly graph displayed on the main index page usage_YYYYMM.html - Monthly summary page (extension may be changed) usage_YYYYMM.png - Monthly usage graph for specified month/year daily_usage_YYYYMM.png - Daily usage graph for specified month/year hourly_usage_YYYYMM.png - Hourly usage graph for specified month/year site_YYYYMM.html - All sites listing (if enabled) url_YYYYMM.html - All urls listing (if enabled) ref_YYYYMM.html - All referrers listing (if enabled) agent_YYYYMM.html - All user agents listing (if enabled) search_YYYYMM.html - All search strings listing (if enabled) webalizer.hist - Previous month history (may be changed) webalizer.current - Incremental Data (may be changed) site_YYYYMM.tab - tab delimited sites file url_YYYYMM.tab - tab delimited urls file ref_YYYYMM.tab - tab delimited referrers file agent_YYYYMM.tab - tab delimited user agents file user_YYYYMM.tab - tab delimited usernames file search_YYYYMM.tab - tab delimited search string file The yearly (index) report shows statistics for a 12 month period, and links to each month. The monthly report has detailed statistics for that month with additional links to any URLs and referrers found. The various totals shown are explained below. Hits Any request made to the server which is logged, is considered a 'hit'. The requests can be for anything... html pages, graphic images, audio files, CGI scripts, etc... Each valid line in the server log is counted as a hit. This number represents the total number of requests that were made to the server during the specified report period. Files Some requests made to the server, require that the server then send something back to the requesting client, such as a html page or graphic image. When this happens, it is considered a 'file' and the files total is incremented. The relationship between 'hits' and 'files' can be thought of as 'incoming requests' and 'outgoing responses'. Pages Pages are, well, pages! Generally, any HTML document, or anything that generates an HTML document, would be considered a page. This does not include the other stuff that goes into a document, such as graphic images, audio clips, etc... This number represents the number of 'pages' requested only, and does not include the other 'stuff' that is in the page. What actually constitutes a 'page' can vary from server to server. The default action is to treat anything with the extension '.htm', '.html' or '.cgi' as a page. A lot of sites will probably define other extensions, such as '.phtml', '.php3' and '.pl' as pages as well. Some people consider this number as the number of 'pure' hits... I'm not sure if I totally agree with that viewpoint. Some other programs (and people :) refer to this as 'Pageviews'. Sites Each request made to the server comes from a unique 'site', which can be referenced by a name or ultimately, an IP address. The 'sites' number shows how many unique IP addresses made requests to the server during the reporting time period. This DOES NOT mean the number of unique individual users (real people) that visited, which is impossible to determine using just logs and the HTTP protocol (however, this number might be about as close as you will get). Visits Whenever a request is made to the server from a given IP address (site), the amount of time since a previous request by the address is calculated (if any). If the time difference is greater than a pre-configured 'visit timeout' value (or has never made a request before), it is considered a 'new visit', and this total is incremented (both for the site, and the IP address). The default timeout value is 30 minutes (can be changed), so if a user visits your site at 1:00 in the afternoon, and then returns at 3:00, two visits would be registered. Note: in the 'Top Sites' table, the visits total should be discounted on 'Grouped' records, and thought of as the "Minimum number of visits" that came from that grouping instead. Note: Visits only occur on PageType requests, that is, for any request whose URL is one of the 'page' types defined with the PageType and PagePrefix option, and not excluded by the OmitPage option. Due to the limitation of the HTTP protocol, log rotations and other factors, this number should not be taken as absolutely accurate, rather, it should be considered a pretty close "guess". KBytes The KBytes (kilobytes) value shows the amount of data, in KB, that was sent out by the server during the specified reporting period. This value is generated directly from the log file, so it is up to the web server to produce accurate numbers in the logs (some web servers do stupid things when it comes to reporting the number of bytes). In general, this should be a fairly accurate representation of the amount of outgoing traffic the server had, regardless of the web servers reporting quirks. Note: A kilobyte is 1024 bytes, not 1000 :) Top Entry and Exit Pages The Top Entry and Exit tables give a rough estimate of what URLs are used to enter your site, and what the last pages viewed are. Because of limitations in the HTTP protocol, log rotations, etc... this number should be considered a good "rough guess" of the actual numbers, however will give a good indication of the overall trend in where users come into, and exit, your site. Command Line Options -------------------- The Webalizer supports many different configuration options that will alter the way the program behaves and generates output. Most of these can be specified on the command line, while some can only be specified in a configuration file. The command line options are listed below, with references to the corresponding configuration file keywords. -------------------------------------------------------------------------- General Options --------------- -h Display all available command line options and exit program. -v Be Verbose. This will cause the program to print additional information at run time. It is the same as specifying "Quiet no", "ReallyQuiet no" and "Debug yes" config options. -V Display the program version and exit. Additional program specific information will be displayed if 'verbose' mode is also used (e.g. '-vV'), which can be useful when submitting bug reports. -d Display additional 'debugging' information for errors and warnings produced during processing. This normally would not be used except to determine why you are getting all those errors and wanted to see the actual data. Normally The Webalizer will just tell you it found an error, not the actual data. This option will display the data as well. Config file keyword: Debug -F Specify the log file type to process. Normally, the Webalizer expects to find a valid CLF or Combined format we server log file. This option allows you to process wu-ftpd xferlogs, squid and W3C formatted web logs as well. Values can be either 'clf', 'ftp', 'squid' or 'w3c' with 'clf' being the default. Only the first character needs to be specified (eg: -Fs will process a squid log). Config file keyword: LogType -f Fold out of sequence log records back into analysis, by treating them as if they were the same date/time as the last good record. Normally, out of sequence log records are ignored. If you run apache, don't worry about this. Config file keyword: FoldSeqErr -i Ignore history file. USE WITH CAUTION. This causes The Webalizer to ignore any existing history file produced from previous runs and generate its output from scratch. The effect will be as if The Webalizer is being run for the first time and any previous statistics will be lost (although the HTML documents, if any, will not be deleted) on the main index.html (yearly) web page. Config file keyword: IgnoreHist -b Ignore incremental data file. USE WITH CAUTION. This causes The Webalizer to ignore any existing incremental (state) data file produced by previous runs. By ignoring the incremental data file, all previous processing for the current month will be lost, and those logs must be re-processed. Config file keyword: IgnoreState -p Preserve state (incremental processing). This allows the processing of partial logs in increments. At the end of the program, all relevant internal data is saved, so that it may be restored the next time the program is run. This allows sites that must rotate their logs more than once a month to still be able to use The Webalizer, and not worry about having to gather and feed an entire months logs to the program at the end of the month. See the section on "Incremental Processing" below for additional information. The default is to not perform incremental processing. Use this command line option to enable the feature. Config file keyword: Incremental -q Quiet mode. Normally, The Webalizer will produce various messages while it runs letting you know what its doing. This option will suppress those messages. It should be noted that this WILL NOT suppress errors and warnings, which are output to STDERR. Config file keyword: Quiet -Q ReallyQuiet mode. This allows suppression of _all_ messages generated by The Webalizer, including warnings and errors. Useful when The Webalizer is run as a cron job. Config file keyword: ReallyQuiet -T Display timing information. The Webalizer keeps track of the time it begins and ends processing, and normally displays the total processing time at the end of each run. If quiet mode (-q or 'Quiet yes' in configuration file) is specified, this information is not displayed. This option forces the display of timing totals if quiet mode has been specified, otherwise it is redundant and will have no effect. Config file keyword: TimeMe -c file This option specifies a configuration file to use. Configuration files allow greater control over how The Webalizer behaves, and there are several ways to use them. As of version 0.98, The Webalizer searches for a default configuration file in the current directory named "webalizer.conf", and if not found, will search in the /etc/ directory for a file of the same name. In addition, you may specify a configuration file to use with this command line option. -n name This option specifies the hostname for the reports generated. The hostname is used in the title of all reports, and is also prepended to URLs in the reports. This allows The Webalizer to be run on log files for 'virtual' web servers or web servers that are different than the machine the reports are located on, and still allows clicking on the URLs to go to the proper location. If a hostname is not specified, either on the command line or in a configuration file, The Webalizer attempts to determine the hostname using a 'uname' system call. If this fails, "localhost" will be used as the hostname. Config file keyword: HostName -o dir This options specifies the output directory for the reports. If not specified here or in a configuration file, the current default directory will be used for output. Config file keyword: OutputDir -x name This option allows the generated pages to have an extension other than '.html', which is the default. Do not include the leading period ('.') when you specify the extension. Config file keyword: HTMLExtension -P name Specify the file extensions for 'pages'. Pages (sometimes called 'PageViews') are normally html documents and CGI scripts that display the whole page, not just parts of it. Some system will need to define a few more, such as 'phtml', 'php3' or 'pl' in order to have them counted as well. The default is 'htm*' and 'cgi' for web logs and 'txt' for ftp. Config file keyword: PageType -O name Specify URLs which are not counted as 'pages'. Requests matching one of these URLs will not be counted as a page, even if they have an extension matching one of the PageTypes defined above or have no extension at all. Config file keyword: OmitPage -t name This option specifies the title string for all reports. This string is used, in conjunction with the hostname (if not blank) to produce the actual title. If not specified, the default of "Usage Statistics for" will be used. Config file keyword: ReportTitle -Y Suppress Country graph. Normally, The Webalizer produces country statistics in both Graph and Columnar forms. This option will suppress the Country Graph from being generated. Config file keyword: CountryGraph -G Suppress hourly graph. Normally, The Webalizer produces hourly statistics in both Graph and Columnar forms. This option will suppress the Hourly Graph only from being generated. Config file keyword: HourlyGraph -H Suppress Hourly statistics. Normally, The Webalizer produces hourly statistics in both Graph and Columnar forms. This option will suppress the Hourly Statistics table only from being generated. Config file keyword: HourlyStats -K num Specify how many months should be displayed in the main index (yearly summary) table. Default is 12 months. Can be set to anything between 12 and 120 months (1 to 10 years). Config file keyword: IndexMonths -k num Specify how many months should be displayed in the main index (yearly summary) graph. Default is 12 months. Can be set to anything between 12 and 72 months (1 to 6 years). Config file keyword: GraphMonths -L Disable Graph Legends. The color coded legends displayed on the in-line graphs can be disabled with this option. The default is to display the legends. Config file keyword: GraphLegend -l num Graph Lines. Specify the number of background reference lines displayed on the in-line graphics produced. The default is 2 lines, however can range anywhere from zero ('0') for no lines, up to 20 lines (looks funny!). Config file keyword: GraphLines -P name Page type. This is the extension of files you consider to be pages for Pages calculations (sometimes called 'pageviews'). The default is 'htm*' and 'cgi' (plus whatever HTMLExtension you specified if it is different). Don't use a period! -m num Specify a 'visit timeout'. Visits are calculated by looking at the time difference between the current and last request made by a specific host. If the difference is greater that the visit timeout value, the request is considered a new visit. This value is specified in number of seconds. The default is 30 minutes (1800). Config file keyword: VisitTimeout -M num Mangle user agent names. Normally, The Webalizer will keep track of the user agent field verbatim. Unfortunately, there are a ton of different names that user agents go by, and the field also reports other items such as machine type and OS used. For Example, Netscape 4.03 running on Windows 95 will report a different string than Netscape 4.03 running on Windows NT, so even though they are the same browser type, they will be considered as two totally different browsers by The Webalizer. For that matter, Netscape 4.0 running on Windows NT will report different names if one is run on an Alpha and the other on an Intel processor! Internet Exploder is even worse, as it reports itself as if it were Netscape and you have to search the given string a little deeper to discover that it is really MSIE! In order to consolidate generic browser types, this option will cause The Webalizer to 'mangle' the user agent field, attempting to consolidate generic browser types. There are 6 levels that can be specified, each producing different levels of detail. Level 5 displays only the browser name (MSIE or Mozilla) and the major version number. Level 4 will also display the minor version number (single decimal place). Level 3 will display the minor version number to two decimal places. Level 2 will add any sub-level designation (such as Mozilla/3.01Gold or MSIE 3.0b). Level 1 will also attempt to add the system type. The default Level 0 will disable name mangling and leave the user agent field unmodified, producing the greatest amount of detail. Configuration file keyword: MangleAgents -g num This option allows you to specify the level of domains name grouping to be performed. The numeric value represents the level of grouping, and can be thought of as the 'number of dots' to be displayed. The default value of 0 disables any domain name grouping. Configuration file keyword: GroupDomains -D name This allows the specification of a DNS Cache file name. This filename MUST be specified if you have dns lookups enabled (using the -N command line switch or DNSChildren configuration keyword). The filename is relative to the default output directory if an absolute path is not specified (ie: starts with a leading '/'). This option is only available if DNS support was enabled at compile time, otherwise an 'Invalid Keyword' error will be generated. See the DNS.README file for additional information regarding DNS lookups. Configuration file keyword: DNSCache -N num Number of DNS child processes to use for reverse DNS lookups. If specified, a DNSCache name MUST be specified also. If you do not wish a DNS cache file to be generated, specify a value of zero ('0') to disable it. This does not prevent using an existing cache file, only the generation of one at run time. See the DNS.README file for additional information. Configuration file keyword: DNSChildren -j Enable native GeoDB geolocation services. Configuration file keyword: GeoDB -J name Specify an alternate GeoDB database filename to use. This shouldn't normally be needed. If used, the filename 'name' is relative to the output directory being used unless an absolute path is specified (ie: starts with a leading '/'). Configuration file keyword: GeoDBDatabase -w Enable GeoIP support if it is available. Configuration file keyword: GeoIP -W name Specify an alternate GeoIP database filename to use. This shouldn't normally be needed. If used, the filename 'name' is relative to the specified output directory unless an absolute name is given (ie: starts with a leading '/'). Configuration file keyword: GeoIPDatabase -z name Specify location of the country flag graphics and enable their display in the top country table. The directory name is relative to the output directory unless an absolute path is specified (ie: starts with a leading '/'). Configuration file keyword: FlagDir Hide Options ------------ The following options take a string argument to use as a comparison for matching. Except for the IndexAlias option, the string argument can be plain text, or plain text that either starts or ends with the wildcard character '*'. For Example: Given the string "yourmama/was/here", the arguments "was", "*here" and "your*" will all produce a match. -a name This option allows hiding of user agents (browsers) from the "Top User Agents" table in the report. This option really isn't too useful as there are a zillion different names that current browsers go by, depending where they were obtained, however you might have some particular user agents that hit your site a lot that you would like to exclude from the list. You must have a web server that includes user agents in its log files for this option to be of any use. In addition, it is also useless if you disable the user agent table in the report (see the -A command line option or "TopAgents" configuration file keyword). You can specify as many of these as you want on the command line. The wildcard character '*' can be used either in front of or at the end of the string. (ie: Mozilla/4.0* would match anything that starts with the string "Mozilla/4.0"). Config file keyword: HideAgent -r name This option allows hiding of referrers from the "Top Referrer" table in the report. Referrers are URLs, either on your own local site or a remote site, that referred the user to a URL on your web server. This option is normally used to hide your own server from the table, as your own pages are usually the top referrers to your own pages (well, you get the idea). You must have a web server that includes referrer information in the log files for this option to be of any use. In addition, it is also useless if you disable the referrers table in the report (see the -R command line option or "TopReferrers" configuration file keyword). You can specify as many of these as you like on the command line. Config file keyword: HideReferrer -s name This option allows hiding of sites from the "Top Sites" table in the report. Normally, you will only want to hide your own domain name from the report, as it usually is one of the top sites to visit your web server. This option is of no use if you disable the top sites table in the report (see the -S command line option or "TopSites" configuration file option). Config file keyword: HideSite -X This causes all individual sites to be hidden, which results in only grouped sites to be displayed on the report. Config file keyword: HideAllSites -u name This option allows hiding of URLs from the "Top URLs" table in the report. Normally, this option is used to hide images, audio files and other objects your web server dishes out that would otherwise clutter up the table. This option is of no use if you disable the top URLs table in the report (see the -U command line option or "TopURLs" configuration file keyword). Config file keyword: HideURL -I name This option allows you to specify additional index.html aliases. The Webalizer usually strips the string 'index.*' from URLs before processing (unless disabled using the 'DefaultIndex' config option), which has the effect of turning a URL such as /somedir/index.html into just /somedir/ which is really the same URL and should be treated as such. This option allows you to specify _additional_ strings that are to be treated the same way. Use with care, improper use could cause unexpected results. For example, if you specify the alias string of 'home', a URL such as /somedir/homepages/brad/home.html would be converted into just /somedir/ which probably isn't what was intended. This option is useful if your web server uses a different default index page other than the standard 'index.html' or 'index.htm', such as 'home.html' or 'homepage.html'. The string specified is searched for _anywhere_ in the URL, so "home.htm" would turn both "/somedir/home.htm" and "/somedir/home.html" into just "/somedir/". Wildcards are _not_ allowed on this one. Config file keyword: IndexAlias Table Size Options ------------------ -e num This option specifies the number of entries to display in the "Top Entry Pages" table. To disable the table, use a value of zero (0). Config file keyword: TopEntry -E num This option specifies the number of entries to display in the "Top Exit Pages" table. To disable the table, use a value of zero (0). Config file keyword: TopExit -A num This option specifies the number of entries to display in the "Top User Agents" table. To disable the table, use a value of zero (0). Config file keyword: TopAgents -C num This option specifies the number of entries to display in the "Top Countries" table. To disable the table, use a value of zero (0). Config file keyword: TopCountries -R num This option specifies the number of entries to display in the "Top Referrers" table. To disable the table, use a value of zero (0). Config file keyword: TopReferrers -S num This option specifies the number of entries to display in the "Top Sites" table. To disable the table, use a value of zero (0). Config file keyword: TopSites -U num This option specifies the number of entries to display in the "Top URLs" table. To disable the table, use a value of zero (0). Config file keyword: TopURLs -------------------------------------------------------------------------- CONFIGURATION FILES ------------------- The Webalizer allows configuration files to be used in order to simplify life for all. There are several ways that configuration files are accessed by the Webalizer. When The Webalizer first executes, it looks for a default configuration file named "webalizer.conf" in the current directory, and if not found there, will look for "/etc/webalizer.conf". In addition, configuration files may be specified on the command line with the '-c' option. There are lots of different ways you can combine the use of configuration files and command line options to produce various results. The Webalizer always looks for and reads configuration options from a default configuration file before doing anything else. Because of this, you can override options found in the default file by use of additional configuration files specified on the command line or command line options themselves. If you specify a configuration file on the command line, you can override options in it by additional command line options which follow. For example, most users will most likely want to create the default file /etc/webalizer.conf and place options in it to specify the hostname, log file, table options, etc... At the end of the month when a different log file is to be used (the end of month log), you can run The Webalizer as usual, but put the different filename on the end of the command line, which will override the log file specified in the configuration file. It should be noted that you cannot override some configuration file options by the use of command line arguments. For example, if you specify "Quiet yes" in a configuration file, you cannot override this with a command line argument, as the command line option only _enables_ the feature (-q option). The configuration files are standard ASCII text files that may be created or edited using any standard editor. Blank lines and lines that begin with a pound sign ('#') are ignored. Any other lines are considered to be configuration lines, and have the form "Keyword Value", where the 'Keyword' is one of the currently available configuration keywords defined below, and 'Value' is the value to assign to that particular option. Any text found after the keyword up to the end of the line is considered the keyword's value, so you should not include anything after the actual value on the line that is not actually part of the value being assigned. The file "sample.conf" provided with the distribution contains lots of useful documentation and examples as well. It should be noted that you do not have to use any configuration files at all, in which case, default values will be used (which should be sufficient for most sites). -------------------------------------------------------------------------- General Configuration Keywords ------------------------------ LogFile This defines the log file to use. It should be a fully qualified name (ie: contain the path), but relative names will work as well. If not specified, the logfile defaults to STDIN. LogType This specified the log file type being used. Normally, The Webalizer processes web logs in either CLF or Combined format. You may also process wu-ftpd xferlog formatted logs, squid proxy logs or W3C formatted web logs by setting the appropriate type using this keyword. Values may be either 'clf', 'ftp', 'squid' or 'w3c'. Ensure that you specify the proper file type, otherwise you will be presented with a long stream of 'invalid record' messages when the Webalizer is run ;) Command line argument: -F OutputDir This defines the output directory to use for the reports. If it is not specified, the current directory is used. Command line argument: -o HistoryName Allows specification of a history path/filename if desired. The default is to use the file named 'webalizer.hist', kept in the normal output directory (OutputDir above). Any name specified is relative to the normal output directory unless an absolute path name is given (ie: starts with a '/'). ReportTitle This specifies the title to use for the generated reports. It is used in conjunction with the hostname (unless blank) to produce the final report titles. If not defined, the default of "Usage Statistics for" is used. Command line argument: -t HostName This defines the hostname. The hostname is used in the report title as well as being prepended to URLs in the "Top URLs" table. This allows The Webalizer to be run on "virtual" web servers, or servers that do not reside on the local machine, and allows clicking on the URL to go to the right place. If not specified, The Webalizer attempts to get the hostname via a 'uname' system call, and if that fails, will default to "localhost". Command line argument: -n UseHTTPS Causes the links in the 'Top URLs' table to use 'https://' instead of the default 'http://' prefix. Not much use if you run a mix of secure/insecure servers on your machine. Only useful if you run the analysis on a secure servers logs, and want the links in the table to work properly. HTAccess Enables the creation of a default .htaccess file in the output directory. If enabled, the file will be created (with a single "DirectoryIndex" directive), unless one already exists. The default is 'no', which disables the creation of any .htaccess files. Quiet This allows you to enable or disable informational messages while it is running. The values for this keyword can be either 'yes' or 'no'. Using "Quiet yes" will suppress these messages, while "Quiet no" will enable them. The default is 'no' if not specified, which will allow The Webalizer to display informational messages. It should be noted that this option has no effect on Warning or Error messages that may be generated, as they go to STDERR. Command line argument: -q ReallyQuiet This allows all generated output to be suppressed, including warning and error messages. The values for this keyword can be either 'yes' or 'no', with 'no' being the default. Command line argument: -Q TimeMe This allows you to display timing information regardless of any "quiet mode" specified. Useful only if you did in fact tell the webalizer to be quiet either by using the -q command line option or the "Quiet" keyword, otherwise timing stats are normally displayed anyway. Values may be either 'yes' or 'no', with the default being 'no'. Command line argument: -T GMTTime This keyword allows timestamps to be displayed in GMT (UTC) time instead of local time. Normally The Webalizer will display timestamps in the time-zone of the local machine (ie: PST or EDT). This keyword allows you to specify the display of timestamps in GMT (UTC) time instead. Values may be either 'yes' or 'no'. Default is 'no'. Debug This tells The Webalizer to display additional information when it encounters Warnings or Errors. Normally, The Webalizer will just tell you it found a bad record or field. This option will enable the display of the actual data that produced the Warning or Error as well. Useful only if you start getting lots of Warnings or Errors and want to determine the cause. Values may be either 'yes' or 'no', with the default being 'no'. Command line argument: -d IgnoreHist This suppresses the reading of a history file. USE WITH EXTREME CAUTION as the history file is how The Webalizer keeps track of previous months. The effect of this option is as if The Webalizer was being run for the very first time, and any previous data is discarded. Values may be either 'yes' or 'no', with the default being 'no'. Command line argument: -i IgnoreState This suppresses the reading of an existing incremental data file. USE WITH EXTREME CAUTION! By ignoring an existing incremental data file, all previous processing for the current month will be lost, and those logs must be re-processed. Values may be 'yes' or 'no', with the default being 'no'. Command line argument: -b FoldSeqErr Allows log records that are out of sequence to be folded back into the analysis, by treating them as if they had the same date/time as the last good record. Normally, out of sequence log records are simply ignored. If you run apache, don't worry about this. VisitTimeout Set the 'visit timeout' value. Visits are determined by looking at the time difference between the current and last request made by a specific site. If the difference in time is greater than the visit timeout value, the request is considered a new visit. The value is in number of seconds, and defaults to 30 minutes (1800). Command line argument: -m PageType Allows you to define the 'page' type extension. Normally, people consider HTML and CGI scripts as 'pages'. This option allows you to specify what extensions you consider a page. Default is 'htm*' and 'cgi' for web logs, and 'txt' for ftp logs. Command line argument: -P PagePrefix Allows all requests with a specified prefix to be considered as 'pages'. If you want everything under /documents to be treated as pages no matter what their extension is. Also useful if you have cgi-scripts with PATH_INFO. OmitPage Allows specified URLs to not be counted as pages under any circumstance, even if they have an extension matching a PageType or PagePrefix as defined above. GraphLegend Enable/disable the display of color coded legends on the produced graphs. Default is 'yes', to display them. Command line argument: -L GraphLines Specify the number of background reference lines to display on produced graphs. The default is 2. To disable the use of background lines, use zero ('0'). Command line argument: -l IndexMonths Specify the number of months to display in the main index (yearly summary) table. Default is 12 months. Can be set to anything between 12 and 120 months (1 to 10 years). Command line argument: -K YearHeaders Enable/disable the display of year headers in the main index (yearly summary) table. If enabled, year headers will be shown when the table is displaying more than 16 months worth of data. Values can be 'yes' or 'no'. Default is 'yes'. GraphMonths Specify the number of months to display in the main index (yearly summary) graph. Default is 12 months. Can be set to anything between 12 and 72 months (1 to 6 years). Command line argument: -k CountryGraph This keyword is used to either enable or disable the creation and display of the Country Usage graph. Values may be either 'yes' or 'no', with the default being 'yes'. Command line argument: -Y CountryFlags Enables or disables the display of flags in the top country table. If enabled, the default directory 'flags' directly under the output directory will be used unless a different path is specified with the 'FlagDir' option below. Command line argument: -zflags FlagDir Specifies the location of flag graphics. If not specified, the default is in the 'flags' directory directly under the output directory being used for the reports. If specified, the display of flags will be enabled by default. Command line argument: -z DailyGraph This keyword is used to either enable or disable the creation and display of the Daily Usage graph. Values may be either 'yes' or 'no', with the default being 'yes'. DailyStats This keyword is used to either enable or disable the creation and display of the Daily Usage statistics table. Values may be either 'yes' or 'no', with the default being 'yes'. HourlyGraph This keyword is used to either enable or disable the creation and display of the Hourly Usage graph. Values may be either 'yes' or 'no', with the default being 'yes'. Command line argument: -G HourlyStats This keyword is used to either enable or disable the creation and display of the Hourly Usage statistics table. Values may be either 'yes' or 'no', with the default being 'yes'. Command line argument: -H IndexAlias This allows additional 'index.html' aliases to be defined. Normally, The Webalizer scans for and strips the string "index." from URLs before processing them (unless disabled using the DefaultIndex config option below). This turns a URL such as /somedir/index.html into just /somedir/ which is really the same URL. This keyword allows _additional_ names to be treated in the same fashion for sites that use different default names, such as "home.html". The string is scanned for anywhere in the URL, so care should be used if and when you define additional aliases. For example, if you were to use an alias such as 'home', the URL /somedir/homepages/brad/home.html would be turned into just /somedir/ which probably isn't the intended result. Instead, you should have specified 'home.htm' which would correctly turn the URL into /somedir/homepages/brad/ like intended. It should also be noted that specified aliases are scanned for in EVERY log record... A bunch of aliases will noticeably degrade performance as each record has to be scanned for every alias defined. You don't have to specify 'index.' as it is always the default (unless disabled with the config option "DefaultIndex" described below). Command line argument: -I DefaultIndex This option is used to enable/disable the use of "index." as a default index name to be stripped from the end of a URL. Most sites should not need to use this option, however some may find it useful, particularly those whose default index file name is something different, or those sites that use 'index.php' or similar URLs to generate dynamic content. This option does not effect any of the names that may be defined using the IndexAlias option, and those names will still function as described. Values may be 'yes' or 'no', with 'yes' being the default. MangleAgents The MangleAgents keyword specifies the level of user agent name mangling, if any. There are 6 levels that may be specified, each producing a different level of detail displayed. Level 5 displays only the browser name (MSIE or Mozilla) and the major version number. Level 4 adds the minor version (single decimal place). Level 3 adds the minor version to two decimal places. Level 2 will also add any sub-level designation (such as Mozilla/3.01Gold or MSIE 3.0b). Level 1 will also attempt to add the system type. The default level 0 will leave the user agent field unmodified and produces the greatest amount of detail. Command line argument: -M SearchEngine This keyword allows specification of search engines and their query strings. Search strings are obtained from the referrer field in the record, and in order to work properly, the Webalizer needs to know what query strings different search engines use. The SearchEngine allows you to specify the search engine and its query string to parse the search string from. The line is formatted as: "SearchEngine engine-string query-string" where 'engine-string' is a substring for matching the search engine with, such as "yahoo.com" or "altavista". The 'query-string' is the unique query string that is added to the URL for the search engine, such as "search=" or "MT=" with the actual search strings appended to the end. There is no command line option for this keyword. SearchCaseI The SearchCaseI option specifies if search strings should be lowercased (case insensitive) or not. Since most search engines use case insensitive searches (ie: a search for "Hello" is the same as "HELLO" or "hello"), converting to lowercase will improve keyword accuracy, which is the default. If desired, case sensitivity can be forced with this option. The value can be 'yes' or 'no', with 'yes' (case insensitive) being the default. Incremental This allows incremental processing to be enabled or disabled. Incremental processing allows processing partial logs without the loss of detail data from previous runs in the same month. This feature saves the 'internal state' of the program so that it may be restored in following runs. See the section above titled "Incremental Processing" for additional information. The value may be 'yes' or 'no', with the default being 'no'. Command line argument: -p IncrementalName Allows specification of the incremental data filename if desired. Normally, the file named "webalizer.current' is used, kept in the standard output directory. If specified, filenames are relative to the standard output directory, unless an absolute name is given (ie: starts with '/'). StripCGI Determines if CGI variables should be stripped from the end of URLs or not. Normally, these variables are removed from URLs to improve accuracy, however some sites may wish to keep them preserved (particularly on highly dynamic sites). Values may be either 'yes' or 'no', with 'yes' being the default. TrimSquidURL Allows squid log URLs to be reduced in granularity by truncating them after a specified number of '/' path separators after the http:// portion. A value of 1 will cause all URLs to be summarized by domain only. The default value is zero (0), which leaves URLs unmodified. DNSCache Specifies the DNS cache filename. This name is relative to the default output directory unless an absolute name is given (ie: starts with '/'). See the DNS.README file for additional information. Command line argument: -D DNSChildren The number of DNS children processes to run in order to create/update the DNS cache file. If specified, the DNS cache filename must also be specified (see above). Use a value of zero ('0') to disable. See the DNS.README file for additional information. Command line argument: -N CacheIPs Specifies if unresolved addresses should also be cached in the DNS database. If enabled, unresolved IP addresses will be stored along with resolved addresses. This may be useful on some sites that have lots of unresolved IPs visiting so they are not looked up each time the program is run. Values may be 'yes' or 'no'. Default is 'no'. CacheTTL Specifies the Time To Live (TTL) value for cached DNS entries in days. Default value is 7 (1 week). Can be any value between 1 and 100. GeoDB Controls the use of the native GeoDB geolocation services provided by The Webalizer. Values may be 'yes' or 'no' with 'no' being the default. Command line argument: -j GeoDBDatabase Specifies and alternate GeoDB database filename to use. This is relative to the output directory being used unless an absolute path is given (ie: starts with a '/'). Command line argument: -J GeoIP Controls the use of GeoIP geolocation services. If The Webalizer was compiled with GeoIP support, it is used by default. Values may be 'yes' or 'no'. Default is 'yes'. Command line argument: -w GeoIPDatabase Specifies an alternate GeoIP database filename to use. This name is relative to the default output directory unless an absolute name is given (ie: starts with '/'). Command line argument: -W Top Table Keywords ------------------ TopAgents This allows you to specify how many "Top" user agents are displayed in the "Top User Agents" table. The default is 15. If you do not want to display user agent statistics, specify a value of zero (0). The display of user agents will only work if your web server includes this information in its log file (ie: a combined log format file). Command line argument: -A AllAgents Will cause a separate HTML page to be generated for all normally visible User Agents. A link will be added to the bottom of the "Top User Agents" table if enabled. Value can be either 'yes' or 'no', with 'no' being the default. TopCountries This allows you to specify how many "Top" countries are displayed in the "Top Countries" table. The default is 30. If you want to disable the countries table, specify a value of zero (0). Command line argument: -C TopReferrers This allows you to specify how many "Top" referrers are displayed in the "Top Referrers" table. The default is 30. If you want to disable the referrers table, specify a value of zero (0). The display of referrer information will only work if your web server includes this information in its log file (ie: a combined log format file). Command line argument: -R AllReferrers Will cause a separate HTML page to be generated for all normally visible Referrers. A link will be added to the "Top Referrers" table if enabled. Value can be either 'yes' or 'no', with 'no' being the default. TopSites This allows you to specify how many "Top" sites are displayed in the "Top Sites" table. The default is 30. If you want to disable the sites table, specify a value of zero (0). Command line argument: -S TopKSites Identical to TopSites, except for the 'by KByte' table. Default is 10. No command line switch for this one. AllSites Will cause a separate HTML page to be generated for all normally visible Sites. A link will be added to the bottom of the "Top Sites" table if enabled. Value can be either 'yes' or 'no', with 'no' being the default. TopURLs This allows you to specify how many "Top" URLs are displayed in the "Top URLs" table. The default is 30. If you want to disable the URLs table, specify a value of zero (0). Command line argument: -U TopKURLs Identical to TopURLs, except for the 'by KByte' table. Default is 10. No command line switch for this one. AllURLs Will cause a separate HTML page to be generated for all normally visible URLs. A link will be added to the bottom of the "Top URLs" table if enabled. Value can be either 'yes' or 'no', with 'no' being the default. TopEntry Allows you to specify how many "Top Entry Pages" are displayed in the table. The default is 10. If you want to disable the table, specify a value of zero (0). Command line argument: -e TopExit Allows you to specify how many "Top Exit Pages" are displayed in the table. The default is 10. If you want to disable the table, specify a value of zero (0). Command line argument: -E TopSearch Allows you to specify how many "Top Search Strings" are displayed in the table. The default is 20. If you want to disable the table, specify a value of zero (0). Only works if using combined log format (ie: contains referrer information). TopUsers This allows you to specify how many "Top" usernames are displayed in the "Top Usernames" table. Usernames are only available if you use http authentication on your web server, or when processing wu-ftpd xferlogs. The default value is 20. If you want to disable the Username table, specify a value of zero (0). AllUsers Will cause a separate HTML page to be generated for all normally visible usernames. A link will be added to the bottom of the "Top Usernames" table if enabled. Value can be either 'yes' or 'no', with 'no' being the default. AllSearchStr Will create a separate HTML page to be generated for all normally visible Search Strings. A link will be added to the bottom of the "Top Search Strings" table if enabled. Value can be either 'yes' or 'no', with 'no' being the default. Hide Object Keywords -------------------- These keywords allow you to hide user agents, referrers, sites, URLs and usernames from the various "Top" tables. The value for these keywords are the same as those used in their command line counterparts. You can specify as many of these as you want without limit. Refer to the section above on "Command Line Options" for a description of the string formatting used as the value. Values cannot exceed 80 characters in length. HideAgent This allows specified user agents to be hidden from the "Top User Agents" table. Not very useful, since there a zillion different names by which browsers go by today, but could be useful if there is a particular user agent (ie: robots, spiders, real-audio, etc..) that hits your site frequently enough to make it into the top user agent listing. This keyword is useless if 1) your log file does not provide user agent information or 2) you disable the user agent table. Command line argument: -a HideReferrer This allows you to hide specified referrers from the "Top Referrers" table. Normally, you would only specify your own web server to be hidden, as it is usually the top generator of references to your own pages. Of course, this keyword is useless if 1) your log file does not include referrer information or 2) you disable the top referrers table. Command line argument: -r HideSite This allows you to hide specified sites from the "Top Sites" table. Normally, you would only specify your own web server or other local machines to be hidden, as they are usually the highest hitters of your web site, especially if you have their browsers home page pointing to it. Command line argument: -s HideAllSites This allows hiding all individual sites from the display, which can be useful when a lot of groupings are being used (since grouped records cannot be hidden). It is particularly useful in conjunction with the GroupDomain feature, however can be useful in other situations as well. Value can be either 'yes' or 'no', with 'no' the default. Command line argument: -X HideURL This allows you to hide URLs from the "Top URLs" table. Normally, this is used to hide items such as graphic files, audio files or other 'non-html' files that are transferred to the visiting user. Command line argument: -u HideUser This allows you to hide Usernames from the "Top Usernames" table. Usernames are only available if you use http based authentication on your web server. Group Object Keywords --------------------- The Group* keywords allow object grouping based on Site, URL, Referrer, User Agent and Usernames. Combined with the Hide* keywords, you can customize exactly what will be displayed in the 'Top' tables. For example, to only display totals for a particular directory, use a GroupURL and HideURL with the same value (ie: '/help/*'). Group processing is only done after the individual record has been fully processed, so name mangling and site total updates have already been performed. Because of this, groups are not counted in the main site total (as that would cause duplication). Groups can be displayed in bold and shaded as well. Grouped records are not, by default, hidden from the report. This allows you to display a grouped total, while still being able to see the individual records, even if they are part of the group. If you want to hide the detail records, follow the Group* directive with a Hide* one using the same value. There are no command line switches for these keywords. The Group* keywords also accept an optional label to be displayed instead of the actual value used. This label should be separated from the value by at least one whitespace character, such as a space or tab character. If the match string contains whitespace (spaces or tabs), the string should be quoted, using either single or double quotes. See the sample configuration file for examples. GroupReferrer Allows grouping Referrers. Can be handy for some of the major search engines that have multiple host names a referral could come from. GroupURL This keyword allows grouping URLs. Useful for grouping complete directory trees. GroupSite This keywords allows grouping Sites. Most used for grouping top level domains and unresolved IP address for local dial-ups, etc... GroupAgent Groups User Agents. A handy example of how you could use this one is to use "Mozilla" and "MSIE" as the values for GroupAgent and HideAgent keywords. Make sure you put the "MSIE" one first. GroupDomains Allows automatic grouping of domains. The numeric value represents the level of grouping, and can be thought of as 'the number of dots' to display. A 1 will display second level domains only (xxx.xxx), a 2 will display third level domains (xxx.xxx.xxx) etc... The default value of 0 disables any domain grouping. Command line argument: -g GroupUser Allows grouping of usernames. Combined with a group name, this can be handy for displaying statistics on a particular group of users without displaying their real usernames. GroupShading Allows shading of table rows for groups. Value can be 'yes' or 'no', with the default being 'yes'. GroupHighlight Allows bolding of table rows for groups. Value can be 'yes' or 'no', with the default being 'yes'. Ignore/Include Object Keywords ---------------------- These keywords allow you to completely ignore log records when generating statistics, or to force their inclusion regardless of ignore criteria. Records can be ignored or included based on site, URL, user agent, referrer and username. Be aware that by choosing to ignore records, the accuracy of the generated statistics become skewed, making it impossible to produce an accurate representation of load on the web server. These keywords behave identical to the Hide* keywords above, where the value can have a leading or trailing wildcard '*'. These keywords, like the Hide* ones, have an absolute limit of 80 characters for their values. These keywords do not have any command line switch counterparts, so they may only be specified in a configuration file. It should also be pointed out that using the Ignore/Include combination to selectively exclude an entire site while including a particular 'chunk' is _extremely_ inefficient, and should be avoided. Try grep'ing the records into a separate file and process it instead. IgnoreSite This allows specified sites to be completely ignored from the generated statistics. IgnoreURL This allows specified URLs to be completely ignored from the generated statistics. One use for this keyword would be to ignore all hits to a 'temporary' directory where development work is being done, but is not accessible to the outside world. IgnoreReferrer This allows records to be ignored based on the referrer field. IgnoreAgent This allows specified User Agent records to be completely ignored from the statistics. Maybe useful if you really don't want to see all those hits from MSIE :) IgnoreUser This allows specified username records to be completely ignored from the statistics. Usernames can only be used if you use http authentication on your server. IncludeSite Force the record to be processed based on hostname. This takes precedence over the Ignore* keywords. IncludeURL Force the record to be processed based on URL. This takes precedence over the Ignore* keywords. IncludeReferrer Force the record to be processed based on referrer. This takes precedence over the Ignore* keywords. IncludeAgent Force the record to be processed based on user agent. This takes precedence over the Ignore* keywords. IncludeUser Force the record to be processed based on username. Usernames are only available if you use http based authentication on your server. This takes precedence over the Ignore* keywords. Dump Object Keywords -------------------- The Dump* Keywords allow text files to be generated that can then be used for import into most database, spreadsheet and other external programs. The file is a standard tab delimited text file, meaning that each column is separated by a tab (0x09) character. A header record may be included if required, using the 'DumpHeader' keyword. Since these files contain all records that have been processed, including normally hidden records, an alternate location for the files can be specified using the 'DumpPath' keyword, otherwise they will be located in the default output directory. DumpPath Specifies an alternate location for the dump files. The default output location will be used otherwise. The value is the path portion to use, and normally should be an absolute path (ie: has a leading '/' character), however relative path names can be used as well, and will be relative to the output directory location. DumpExtension Allows the dump filename extensions to be specified. The default extension is "tab", however may be changed with this option. DumpHeader Allows a header record to be written as the first record of the file. Value can be either 'yes' or 'no', with the default being 'no'. DumpSites Dump tab delimited sites file. Value can be either 'yes' or 'no', with the default being 'no'. The filename used is site_YYYYMM.tab (YYYY=year, MM=month). DumpURLs Dump tab delimited url file. Value can be either 'yes' or 'no', with the default being 'no'. The filename used is url_YYYYMM.tab (YYYY=year, MM=month). DumpReferrers Dump tab delimited referrer file. Value can be either 'yes' or 'no', with the default being 'no'. Filename used is ref_YYYYMM.tab (YYYY=year, MM=month). Referrer information is only available if present in the log file (ie: combined web server log). DumpAgents Dump tab delimited user agent file. Value can be either 'yes' or 'no', with the default being 'no'. Filename used is agent_YYYYMM.tab (YYYY=year, MM=month). User agent information is only available if present in the log file (ie: combined web server log). DumpUsers Dump tab delimited username file. Value can be either 'yes' or 'no', with the default being 'no'. Filename used is user_YYYYMM.tab (YYYY=year, MM=month). The username data is only available if processing a wu-ftpd xferlog or http authentication is used on the web server and that information is present in the log. DumpSearchStr Dump tab delimited search string file. Value can be either 'yes' or 'no', with the default being 'no'. Filename used is search_YYYYMM.tab (YYYY=year, MM=month). the search string data is only available if referrer information is present in the log being processed and recognized search engines were found and processed. HTML Generation Keywords ------------------------ These keywords allow you to customize the HTML code that The Webalizer produces, such as adding a corporate logo or links to other web pages. You can specify as many of these keywords as you like, and they will be used in the order that they are found in the file. Values cannot exceed 80 characters in length, so you may have to break long lines up into two or more lines. There are no command line counterparts to these keywords. HTMLExtension Allows generated pages to use something other than the default 'html' extension for the filenames. Do not include the leading period ('.') when you specify the extension. Command line argument: -x HTMLPre Allows code to be inserted at the very beginning of the HTML files. Defaults to the standard HTML 3.2 DOCTYPE record. Be careful not to include any HTML here, as it is inserted _before_ the tag in the file. Use it for server-side scripting capabilities, such as php3, to insert scripting files and other directives. HTMLHead Allows you to insert HTML code between the block. There is no default. Useful for adding scripts to the HTML page, such as Javascript or php3, or even just for adding a few META tags to the document. HTMLBody This keyword defines HTML code to be placed immediately after the section of the report, just before the title and "summary period/generated on" lines. If used, the first HTMLHead line MUST include a tag. Put whatever else you want in subsequent lines, but keep in mind the placement of this code in relation to the title and other aspects of the web page. Some typical uses are to change the page colors and possibly add a corporate logo (graphic) in the top right. If not specified, a default tag is used that defines page color, text color and link colors (see "sample.conf" file for example). HTMLPost This keyword defines HTML code that is placed after the title and "summary period/generated on" lines, just before the initial horizontal rule
tag. Normally this keyword isn't needed, but is provided in case you included a large graphic or some other weird formatting tag in the HTMLHead section that needs to be cleaned up or terminated before the main report section. HTMLTail This keyword defines HTML code that is placed at the bottom right side of the report. It is inserted in a section between table data tags, and is top and right aligned within the table. Normally this keyword is used to provide a link back to your home page or insert a small graphic at the bottom right of the page. HTMLEnd This allows insertion of closing code, at the very end of the page. The default is to put the closing and tags. If specified, you _must_ specify these tags yourself. LinkReferrer This specifies if the referrers listed in the top referrer table should be displayed as plain text, or as a link to the referrer. Values can be either 'yes' or 'no', with 'no' being the default. Graph Color Commands -------------------- These keywords allow altering the colors used in the various graphs produced by the Webalizer. The value is specified as a standard HTML RGB hexdecimal color string, without the leading '#' character. The value is case insensitive. If not specified, the default color shown will be used. ColorHit Color used for 'Hits'. Default is '00805C' (green) ColorFile Color used for 'Files'. Default is '0040FF' (blue) ColorSite Color used for 'Sites'. Default is 'FF8000' (orange) ColorKbyte Color used for 'KBytes'. Default is 'FF0000' (red) ColorPage Color used for 'Pages'. Default is '00E0FF' (cyan) ColorVisit Color used for 'Visits'. Default is 'FFFF00' (yellow) ColorMisc Color used for miscellaneous titles in various 'Top' tables (not graphs). Default is '00E0FF' (cyan) PieColor1 Pie Chart color #1. Default is '800080' (purple) PieColor2 Pie Chart color #2. Default is '80FFC0' (lt. green) PieColor3 Pie Chart color #3. Default is 'FF00FF' (lt. purple) PieColor4 Pie Chart color #4. Default is 'FFC080' (tan) -------------------------------------------------------------------------- Notes on Web Log Files ---------------------- The Webalizer supports CLF log formats, which should work for just about everyone. If you want User Agent or Referrer information, you need to make sure your web server supplies this information in its log file, and in a format that the Webalizer can understand. While The Webalizer will try to handle many of the subtle variations in log formats, some will not work at all. Most web servers output CLF format logs by default. For Apache, in order to produce the proper log format, add the following to the httpd.conf file: LogFormat "%h %l %u %t \"%r\" %s %b \"%{Referer}i\" \"%{User-agent}i\"" This instructs the Apache web server to produce a 'combined' log that includes the referrer and user agent information on the end of each record, enclosed in quotes (This is the standard recommended by both Apache and NCSA). Netscape and other web servers have similar capabilities to alter their log formats. (note: the above works for apache servers up to V1.2. V1.3 and higher now have additional ways to specify log formats... refer to included documentation). Notes on FTP Log Files ---------------------- The Webalizer supports ftp logs produced by wu-ftpd, proftpd and others, as a standard 'xferlog'. To process an ftp log, you must either use the -Ff command line option or have "LogType ftp" in your configuration file. It is recommended that you create a separate configuration file for ftp analysis, since the values used for your web server will most likely not be suited for ftp log analysis (ie: page types, hostname, etc.. should be different). Because of the difference in web and ftp logs, there are a few limitations: o Because there is no concept of a 'response code' in ftp world, response codes are restricted to either 200 (OK) or 206 (Partial Content), based on the completion status found in xferlog (for wu-ftpd, 'i'=incomplete and will generate a 206, 'c'=complete and will generate a 200). If your ftp server doesn't supply the completion status, all requests will be assigned a response code of 200. This allows the usage graph to display all transfer requests (hits), and how many of those completed in success (files - ie: 200 response codes). o Page totals won't accurately reflect reality, since there isn't really the concept of a 'page' in regards to ftp services. I have found that setting the PageType value to "README", "FIRST", etc... seems to work fairly well however, and will give a pretty good indication of how many 'non-binary' files were requested. Of course, the content of your ftp site will be different, so your results may vary. o Visit totals also won't accurately reflect reality, since visits are triggered on PageType requests (see above). What you usually wind up with is visits=sites in most cases. o Entry/Exit pages will not be calculated for ftp logs. o For obvious reasons, referrers and user agents are not supported. o You _cannot_ analyze both web and ftp logs at the same time.. they must be done separately in different runs. Notes on Referrers ------------------ Referrers are weird critters... They take many shapes and forms, which makes it much harder to analyze than a typical URL, which at least has some standardization. What is contained in the referrer field of your log files varies depending on many factors, such as what site did the referral, what type of system it comes from and how the actual referral was generated. Why is this? Well, because a user can get to your site in many ways... They may have your site bookmarked in their browser, they may simply type your sites URL field in their browser, they could have clicked on a link on some remote web page or they may have found your site from one of the many search engines and site indexes found on the web. The Webalizer attempts to deal with all this variation in an intelligent way by doing certain things to the referrer string which makes it easier to analyze. Of course, if your web server doesn't provide referrer information, you probably don't really care and are asking yourself why you are reading this section... Most referrers will take the form of "http://somesite.com/somepage.html", which is what you will get if the user clicks on a link somewhere on the web in order to get to your site. Some will be a variation of this, and look something like "file:/some/such/sillyname", which is a reference from a HTML document on the users local machine. Several variations of this can be used, depending on what type of system the user has, if he/she is on a local network, the type of network, etc... To complicate things even more, dynamic HTML documents and HTML documents that are generated by CGI scripts or external programs produce lots of extra information which is tacked on to the end of the referrer string in an almost infinite number of ways. If the user just typed your URL into their browser or clicked on a bookmark, there won't be any information in the referrer field and will take the form "-". In order to handle all these variations, The Webalizer parses the referrer field in a certain way. First, if the referrer string begins with "http", it assumes it is a normal referral and converts the "http://" and following hostname to lowercase in order to simplify hiding if desired. For example, the referrer "HTTP://WWW.MyHost.Com/This/Is/A/HTML/Document.html" will become "http://www.myhost.com/This/Is/A/HTML/Document.html". Notice that only the "http://" and hostname are converted to lower case... The rest of the referrer field is left alone. This follows standard convention, as the actual method (HTTP) and hostname are always case insensitive, while the document name portion is case sensitive. Referrers that came from search engines, dynamic HTML documents, CGI scripts and other external programs usually tack on additional information that it used to create the page. A common example of this can be found in referrals that come from search engines and site indexes common on the web. Sometimes, these referrers URLs can be several hundred characters long and include all the information that the user typed in to search for your site. The Webalizer deals with this type of referrer by stripping off all the query information, which starts with a question mark '?'. The Referrer "http://search.yahoo.com/search?p=usa%26global%26link" will be converted to just "http://search.yahoo.com/search". When a user comes to your site by using one of their bookmarks or by typing in your URL directly into their browser, the referrer field is blank, and looks like "-". Most sites will get more of these referrals than any other type. The Webalizer converts this type of referral into the string "- (Direct Request)". This is done in order to make it easier to hide via a command line option or configuration file option. This is because the character "-" is a valid character elsewhere in a referrer field, and if not turned into something unique, could not be hidden without possibly hiding other referrers that shouldn't be. Notes on Character Escaping --------------------------- The HTTP protocol defines certain ways that URLs can look and behave. To some extent, referrer fields follow most of the same conventions. Character escaping is a technique by which non-printable or other non-ASCII (and even some ASCII) characters can be used in a URL. This is done by placing the Hexadecimal value of the character in the URL, preceded by a percent sign '%'. Since Hex values are made up of ASCII characters, any character can be escaped to ensure only printable ASCII characters are present in the URL. Some systems take this concept to the extreme and escape all sorts of stuff, even characters that don't need to be escaped. To deal with this, The Webalizer will un-escape URLs and referrers before being processed. For Example, the URL "/www.webalizer.org/%7Efoo/bar.html" is the same URL as "/www.webalizer.org/~foo/bar.html", a very common form of a URL to access users web pages. If the URLs were not un-escaped, they would be treated as two separate documents, even though they are really one and the same. Search String Analysis ---------------------- The Webalizer will do a minimal analysis on referrer strings that it finds, looking for well known search string patterns. Most of the major search engines are supported, such as Yahoo!, Altavista, Lycos, etc... Unfortunately, search engines are always changing their internal/CGI query formats, new search engines are coming on line every day, and the ability to detect _all_ search strings is nearly impossible. However, it should be accurate enough to give a good indication of what users were searching for when they stumbled across your site. Note: as of version 1.31, search engines can now be specified within a configuration file. See the sample.conf file for examples of how to specify additional search engines. Notes on Visits/Entry/Exit Figures ---------------------------------- The majority of data analyzed and reported on by The Webalizer is as accurate and correct as possible based on the input log file. However, due to the limitation of the HTTP protocol, the use of firewalls, proxy servers, multi-user systems, the rotation of your log files, and a myriad of other conditions, some of these numbers cannot, without absolute accuracy, be calculated. In particular, Visits, Entry Pages and Exit Pages are suspect to random errors due to the above and other conditions. The reason for this is twofold, 1) Log files are finite in size and time interval, and 2) There is no way to distinguish multiple individual users apart given only an IP address. Because log files are finite, they have a beginning and ending, which can be represented as a fixed time period. There is no way of knowing what happened previous to this time period, nor is it possible to predict future events based on it. Also, because it is impossible to distinguish individual users apart, multiple users that have the same IP address all appear to be a single user, and are treated as such. This is most common where corporate users sit behind a proxy/firewall to the outside world, and all requests appear to come from the same location (the address of the proxy/firewall itself). Dynamic IP assignment (used with dial-up Internet accounts) also present a problem, since the same user will appear as to come from multiple places. For example, suppose two users visit your server from XYZ company, which has their network connected to the Internet by a proxy server 'fw.xyz.com'. All requests from the network look as though they originated from 'fw.xyz.com', even though they were really initiated from two separate users on different PCs. The Webalizer would see these requests as from the same location, and would record only 1 visit, when in reality, there were two. Because entry and exit pages are calculated in conjunction with visits, this situation would also only record 1 entry and 1 exit page, when in reality, there should be 2. As another example, say a single user at XYZ company is surfing around your website.. They arrive at 11:52pm the last day of the month, and continue surfing until 12:30am, which is now a new day (in a new month). Since a common practice is to rotate (save then clear) the server logs at the end of the month, you now have the users visit logged in two different files (current and previous months). Because of this (and the fact that the Webalizer clears history between months), the first page the user requests after midnight will be counted as an entry page. This is unavoidable, since it is the first request seen by that particular IP address in the new month. For the most part, the numbers shown for visits, entry and exit pages are pretty good 'guesses', even though they may not be 100% accurate. They do provide a good indication of overall trends, and shouldn't be that far off from the real numbers to count much. You should probably consider them as the 'minimum' amount possible, since the actual (real) values should always be equal or greater in all cases. Exporting Webalizer Data ------------------------ The Webalizer now has the ability to dump all object tables to tab delimited ASCII text files, which can then be imported into most popular database and spreadsheet programs. The files are not normally produced, as on some sites they could become quite large, and are only enabled by the use of the Dump* configuration keywords. The filename extensions default to '.tab' however may be changed using the 'DumpExtension' keyword. Since this data contains all items, even those normally hidden, it may not be desirable to have them located in the output directory where they may be visible to normal web users.. For this reason, the 'DumpPath' configuration keyword is available, and allows the placement of these files somewhere outside the normal web server document tree. An optional 'header' record may be written to these files as well, and is useful when the data is to be imported into a spreadsheet.. databases will not normally need the header. If enabled, the header is simply the column names as the first record of the file, tab separated. Log files and The Webalizer --------------------------- Most sites will choose to have The Webalizer run from cron at specified intervals. Care should be taken to ensure that data is not lost as a result of log file rotations. A suggested practice is to rotate your web server logs at the end of each month as close to midnight as possible, then have The Webalizer process the 'end of month' log file before running statistics on the new, current log. On our systems, a shell script called 'rotate_logs' is run at midnight, the end of each month. This script file looks like: ------------------------- file: rotate_logs ------------------------------ #!/bin/sh # halt the server kill `cat /var/lib/httpd/logs/httpd.pid` # define backup names OLD_ACCESS_LOG=/var/lib/httpd/logs/old/access_log.`date +%y%m%d-%H%M%S` OLD_ERROR_LOG=/var/lib/httpd/logs/old/error_log.`date +%y%m%d-%H%M%S` # make end of month copy for analyzer cp /var/lib/httpd/logs/access_log /var/lib/httpd/logs/access_log.backup # move files to archive directory mv /var/lib/httpd/logs/access_log `echo $OLD_ACCESS_LOG` mv /var/lib/httpd/logs/error_log `echo $OLD_ERROR_LOG` # restart web server /usr/sbin/httpd # compress the archived files /bin/gzip $OLD_ACCESS_LOG /bin/gzip $OLD_ERROR_LOG ------------------------- end of file ------------------------------------ This script first stops the web server using a 'kill' command. Apache keeps the PID of the server in the file httpd.pid, so we use it as the argument for the kill. Next, it defines some names for the backup files, which are basically the name of the files with the date and time appended to the end of them. It then makes a copy of the log file, appended with '.backup' in the log directory, moves the current log files to an archive directory (/var/lib/httpd/logs/old) and restarts the server. This setup allows the web server to be down for the minimum amount of time needed, which is important for busy sites. If you don't want to stop the server, you can remove the initial 'kill' command, and replace the '/usr/sbin/httpd' line with "kill -1 `cat /var/lib/httpd/logs/httpd.pid`" command instead, On most web servers, this will cause a restart of the server and create the new log files in the process... At this point, we have made copies of the previous months logs, the web server is going about its business as usual, and we have all the time in the world to do any other additional processing we want. The last two lines of the script compress the archived logs using the GNU zip program (gzip). Remember, we still have a copy of the log which we can now run The Webalizer on without having to do any further processing. Next, we define two crontab entries. The first runs the above 'rotate_logs' script at midnight at the end of the month. The second runs The Webalizer on the '.backup' log file created above at 5 minutes after midnight. This gives other end of month processing jobs a chance to run so we don't bog the system down too much. If you have lots of end of month stuff going on, you can change the timing to suit your needs. The crontab entries look something like: ------------------------- crontab entries -------------------------------- # Rotate web server logs and run monthly analysis 0 0 1 * * /usr/local/adm/rotate_logs 5 0 1 * * /usr/bin/webalizer -Q /var/lib/httpd/logs/access_log.backup ------------------------- end of crontab --------------------------------- As you can see, the log rotations occur at midnight, and the analysis is done at 5 minutes after. Once you verify that The Webalizer ran successfully, the access_log.backup file can be deleted as it isn't needed any more. If you need to re-run the analysis, you still have the compressed archive copy that the shell script created. In order for the above analysis to work properly, you should have already created an /etc/webalizer.conf configuration file suitable for your site, or otherwise specify configuration options or a configuration file on the crontab command line above. If you want The Webalizer to be run more often than once a month, you can specify additional crontab entries to do this as well. Care should be taken however to ensure that The Webalizer is not running when the end of month processing above occurs, or unpredictable results may happen (such as an inability to rotate the logs due to a file lock). The easiest way is to run it on the half hour with a crontab entry like: 30 * * * * /usr/bin/webalizer Reverse DNS Lookups ------------------- The Webalizer fully supports both IPv4 and IPv6 DNS lookups, and maintains a cache of those lookups to reduce processing the same addresses in subsequent runs. The cache file can be created at run-time, or may be created before running the webalizer using either the stand alone 'webazolver' program, or The Webalizer (DNS) Cache file Manager program 'wcmgr'. In order to perform reverse lookups, a DNS Cache file must be specified, either on the command line or in a configuration file. In order to create/update the cache file at run-time, the number of DNS Children must also be specified, and can be anything between 1 and 100. This specifies the number of child processes to be forked, each of which will perform network DNS queries in order to lookup up the addresses and update the cache. Cached entries that are older than a specified TTL (time to live) will be expired, and if encountered again in a log, will be looked up at that time in order to 'freshen' them (verify the name is still the same and update its timestamp). The default TTL is 7 days, however may be set to anything between 1 and 100 days. Using the 'wcmgr' program, entries may also be marked as 'permanent', in which case they will persist (with an infinite TTL) in the cache until manually removed. See the file DNS.README for additional information. Geolocation Lookups ------------------- The Webalizer has the ability to perform geolocation lookups on IP addresses using either it's own internal GeoDB database or optionally the GeoIP database from MaxMind, Inc. (www.maxmind.com). If used, unresolved addresses will be searched for in the database and it's country of origin will be returned if found. This actually produces more accurate Country information than DNS lookups, since the DNS address space has additional gcTLDs that do not necessarily map to a specific country (such as '.net' and '.com'). It is possible to use both DNS lookups and geolocation lookups at the same time, which will cause any addresses that could not be resolved using DNS lookups to then be looked up in the database, greatly reducing the number of 'Unknown/Unresolved' entries in the generated reports. The native GeoDB geolocation database provided by The Webalizer fully supports IPv4 and IPv6 lookups, is updated regularly, and is the preferred geolocation method for use with The Webalizer. The most current version of the database can be obtained from our ftp site. Language Support ---------------- Version 1.0x of The Webalizer added language support. This support is only provided at compile time in the form of an include file containing all the strings used by The Webalizer. The source distribution contains all language files that were available at the time, with English being the default as that is the only human language I speak fluently, and me Espanol es muy malo. Several people have already indicated the desire to do translations into various languages, and as I receive the language files, will make them available via ftp at ftp://ftp.mrunix.net/pub/webalizer/lang. Unless there happens to be a binary distribution in the language you need, you will need to grab the source distribution and compile the program yourself. See the file INSTALL that comes in the source distribution for information on how to use a language other than English. It should also be noted that the GD graphics library, used to produce the in-line graphics in the output HTML, doesn't support extended character sets, so if you are translating the language file, you will no doubt encounter this problem. New: You can now specify the language to use when you are building program from source, using the configure script. Just add --with-language=language_name , where 'language_name' is the name of a valid language file in the /lang/ directory. For example, --with-language=french will build using French as the default language. You should consult the INSTALL file for additional information on building the program from source. Known Issues ------------ o Memory Usage. The Webalizer makes liberal use of memory for internal data structures during analysis. Lack of real physical memory will noticeably degrade performance by doing lots of swapping between memory and disk. One user who had a rather large log file noticed that The Webalizer took over 7 hours to run with only 16 Meg of memory. Once memory was increased, the time was reduced to a few minutes. o Performance. The Hide*, Group*, Ignore*, Include* and IndexAlias configuration options can cause a performance decrease if lots of them are used. The reason for this is that every log record must be scanned for each item in each list. For example, if you are Hiding 20 objects, Grouping 20 more, and Ignoring 5, each record is scanned, at most, 46 times (20+20+5 + an IndexAlias scan). On really large log files, this can have a profound impact. It is recommended that you use the least amount of these configuration options that you can, as it will greatly improve performance. Final Notes ----------- A lot of time and effort went into making The Webalizer, and to ensure that the results are as accurate as possible. If you find any abnormalities or inconsistent results, bugs, errors, omissions or anything else that doesn't look right, please let me know so I can investigate the problem or correct the error. This goes for the minimal documentation as well. Suggestions for future versions are also welcome and appreciated. webalizer-2.23-05/README.FIRST0000644000175000017500000000173411454000455014021 0ustar bradbradUpgrade information for the Webalizer Version 2.2x This release is, for the most part, a drop-in replacement for all installations currently running 2.01, and all users are encouraged to upgrade. See the 'CHANGES' file for a full list of changes since version 2.01-10. Note: The history file format has changed in v2.20 in order to keep more than 12 months. Existing history files will be automatically converted to the new format the first time they are read. Note: This version redefines the '-v' command line switch to mean 'verbose', which will cause the program to display additional informational and debugging messages at run-time. This should not cause any major problems, as previously it would simply cause the program to display its version information and then exit. Report bugs to 'brad at mrunix dot net' with "Webalizer" somewhere in the subject. Please do not send HTML formatted e-mails or e-mail containing HTML tags as my mail server will reject them. Thanks! webalizer-2.23-05/configure0000755000175000017500000064321211510253154014164 0ustar bradbrad#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61 for webalizer V2.23. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # PATH needs CR # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac done IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi : (as_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell autoconf@gnu.org about your system, echo including any error possibly output before this echo message } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. Blame Lee # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='webalizer' PACKAGE_TARNAME='webalizer' PACKAGE_VERSION='V2.23' PACKAGE_STRING='webalizer V2.23' PACKAGE_BUGREPORT='' # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir localstatedir includedir oldincludedir docdir infodir htmldir dvidir pdfdir psdir libdir localedir mandir DEFS ECHO_C ECHO_N ECHO_T LIBS build_alias host_alias target_alias OPTS WCMGR_LIBS DEFAULT_LANG CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT LN_S INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CPP GREP EGREP GEODB_LOC LIBOBJS LTLIBOBJS' ac_subst_files='' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute directory names. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || { echo "$as_me: error: Working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures webalizer V2.23 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/webalizer] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of webalizer V2.23:";; esac cat <<\_ACEOF Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --disable-largefile omit support for large files --enable-static Build as static executable [default=no] --enable-debug Compile with debugging code [default=no] --enable-dns Enable DNS/GeoDB lookup code [default=yes] --enable-bz2 Enable BZip2 decompression code [default=no] --enable-geoip Enable GeoIP geolocation code [default=no] --enable-oldhash Use old hash function (slower) [default=no] Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-gd=DIR Alternate location for gd header files --with-gdlib=DIR Alternate location for gd library --with-png=DIR Alternate location for png header files --with-pnglib=DIR Alternate location for png library --with-z=DIR Alternate location for libz header files --with-zlib=DIR Alternate location for z library --with-db=DIR Alternate location for libdb header files --with-dblib=DIR Alternate location for db library --with-bz2=DIR Alternate location for bz2 header files --with-bz2lib=DIR Alternate location for bz2 library --with-geoip=DIR Alternate location for libGeoIP header files --with-geoiplib=DIR Alternate location for geoip library --with-geodb=DIR Default GeoDB data dir [/usr/share/GeoDB] --with-language=name Use language 'name' (default is english) Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF webalizer configure V2.23 generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by webalizer $as_me V2.23, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then set x "$CONFIG_SITE" elif test "x$prefix" != xNONE; then set x "$prefix/share/config.site" "$prefix/etc/config.site" else set x "$ac_default_prefix/share/config.site" \ "$ac_default_prefix/etc/config.site" fi shift for ac_site_file do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu OPTS=${DEFS} LIBS=${LIBS} DEFAULT_LANG="english" IN_CFLAGS=${CFLAGS} ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # # List of possible output files, starting from the most likely. # The algorithm is not robust to junk in `.', hence go to wildcards (a.*) # only as a last resort. b.out is created by i960 compilers. ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' # # The IRIX 6 linker writes into existing files which may not be # executable, retaining their permissions. Remove them first so a # subsequent execution test works. ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { (ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi { echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6; } if test -z "$ac_file"; then echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6; } { echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext { echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT { echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6; } ;; xno) { echo "$as_me:$LINENO: result: unsupported" >&5 echo "${ECHO_T}unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { echo "$as_me:$LINENO: checking whether ln -s works" >&5 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } else { echo "$as_me:$LINENO: result: no, using $LN_S" >&5 echo "${ECHO_T}no, using $LN_S" >&6; } fi ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} { (exit 1); exit 1; }; } fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. { echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done IFS=$as_save_IFS fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' # Check whether --enable-largefile was given. if test "${enable_largefile+set}" = set; then enableval=$enable_largefile; fi if test "$enable_largefile" != no; then { echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5 echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6; } if test "${ac_cv_sys_largefile_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_sys_largefile_CC=no if test "$GCC" != yes; then ac_save_CC=$CC while :; do # IRIX 6.2 and later do not support large files by default, # so use the C compiler's -n32 option if that helps. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext CC="$CC -n32" rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_sys_largefile_CC=' -n32'; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext break done CC=$ac_save_CC rm -f conftest.$ac_ext fi fi { echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5 echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6; } if test "$ac_cv_sys_largefile_CC" != no; then CC=$CC$ac_cv_sys_largefile_CC fi { echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5 echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6; } if test "${ac_cv_sys_file_offset_bits+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_sys_file_offset_bits=no; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #define _FILE_OFFSET_BITS 64 #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_sys_file_offset_bits=64; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_sys_file_offset_bits=unknown break done fi { echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5 echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6; } case $ac_cv_sys_file_offset_bits in #( no | unknown) ;; *) cat >>confdefs.h <<_ACEOF #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits _ACEOF ;; esac rm -f conftest* if test $ac_cv_sys_file_offset_bits = unknown; then { echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5 echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6; } if test "${ac_cv_sys_large_files+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_sys_large_files=no; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #define _LARGE_FILES 1 #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_sys_large_files=1; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_sys_large_files=unknown break done fi { echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5 echo "${ECHO_T}$ac_cv_sys_large_files" >&6; } case $ac_cv_sys_large_files in #( no | unknown) ;; *) cat >>confdefs.h <<_ACEOF #define _LARGE_FILES $ac_cv_sys_large_files _ACEOF ;; esac rm -f conftest* fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Extract the first word of "grep ggrep" to use in msg output if test -z "$GREP"; then set dummy grep ggrep; ac_prog_name=$2 if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS fi GREP="$ac_cv_path_GREP" if test -z "$GREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_GREP=$GREP fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 echo "${ECHO_T}$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else # Extract the first word of "egrep" to use in msg output if test -z "$EGREP"; then set dummy egrep; ac_prog_name=$2 if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS fi EGREP="$ac_cv_path_EGREP" if test -z "$EGREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_EGREP=$EGREP fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done { echo "$as_me:$LINENO: checking whether char is unsigned" >&5 echo $ECHO_N "checking whether char is unsigned... $ECHO_C" >&6; } if test "${ac_cv_c_char_unsigned+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((char) -1) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_c_char_unsigned=no else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_char_unsigned=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_c_char_unsigned" >&5 echo "${ECHO_T}$ac_cv_c_char_unsigned" >&6; } if test $ac_cv_c_char_unsigned = yes && test "$GCC" != yes; then cat >>confdefs.h <<\_ACEOF #define __CHAR_UNSIGNED__ 1 _ACEOF fi { echo "$as_me:$LINENO: checking for u_int64_t" >&5 echo $ECHO_N "checking for u_int64_t... $ECHO_C" >&6; } if test "${ac_cv_type_u_int64_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef u_int64_t ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_u_int64_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_u_int64_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_u_int64_t" >&5 echo "${ECHO_T}$ac_cv_type_u_int64_t" >&6; } if test $ac_cv_type_u_int64_t = yes; then : else cat >>confdefs.h <<_ACEOF #define u_int64_t unsigned long long _ACEOF fi { echo "$as_me:$LINENO: checking whether altzone is declared" >&5 echo $ECHO_N "checking whether altzone is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_altzone+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { #ifndef altzone (void) altzone; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_have_decl_altzone=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_altzone=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_have_decl_altzone" >&5 echo "${ECHO_T}$ac_cv_have_decl_altzone" >&6; } if test $ac_cv_have_decl_altzone = yes; then OPTS="-DHAVE_ALTZONE ${OPTS}" fi if test "$GCC" = "yes"; then # Check whether --enable-static was given. if test "${enable_static+set}" = set; then enableval=$enable_static; LDFLAGS="--static ${LDFLAGS}" fi if test "$IN_CFLAGS" = ""; then CFLAGS="-Wall -O2" fi if test "$ac_cv_c_char_unsigned" = "yes"; then CFLAGS="-fsigned-char ${CFLAGS}" fi # Check whether --enable-debug was given. if test "${enable_debug+set}" = set; then enableval=$enable_debug; CFLAGS="-g ${CFLAGS}" fi else if test "$IN_CFLAGS" = ""; then CFLAGS="-g" fi fi # Check whether --with-gd was given. if test "${with_gd+set}" = set; then withval=$with_gd; S_GD="${withval}"; CPPFLAGS="${CPPFLAGS} -I${withval}" fi # Check whether --with-gdlib was given. if test "${with_gdlib+set}" = set; then withval=$with_gdlib; S_GDLIB="${withval}"; LDFLAGS="-L${withval} ${LDFLAGS}" fi # Check whether --with-png was given. if test "${with_png+set}" = set; then withval=$with_png; S_PNG="${withval}"; CPPFLAGS="${CPPFLAGS} -I${withval}" fi # Check whether --with-pnglib was given. if test "${with_pnglib+set}" = set; then withval=$with_pnglib; S_PNGLIB="${withval}"; LDFLAGS="-L${withval} ${LDFLAGS}" fi # Check whether --with-z was given. if test "${with_z+set}" = set; then withval=$with_z; S_Z="${withval}"; CPPFLAGS="${CPPFLAGS} -I${withval}" fi # Check whether --with-zlib was given. if test "${with_zlib+set}" = set; then withval=$with_zlib; S_ZLIB="${withval}"; LDFLAGS="-L${withval} ${LDFLAGS}" fi # Check whether --with-db was given. if test "${with_db+set}" = set; then withval=$with_db; S_DB="${withval}"; CPPFLAGS="${CPPFLAGS} -I${withval}" fi # Check whether --with-dblib was given. if test "${with_dblib+set}" = set; then withval=$with_dblib; S_DBLIB="${withval}"; LDFLAGS="-L${withval} ${LDFLAGS}" fi { echo "$as_me:$LINENO: checking for main in -l44bsd" >&5 echo $ECHO_N "checking for main in -l44bsd... $ECHO_C" >&6; } if test "${ac_cv_lib_44bsd_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-l44bsd $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_44bsd_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_44bsd_main=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_44bsd_main" >&5 echo "${ECHO_T}$ac_cv_lib_44bsd_main" >&6; } if test $ac_cv_lib_44bsd_main = yes; then LIBS="-l44bsd ${LIBS}" fi for ac_header in getopt.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done { echo "$as_me:$LINENO: checking for main in -lm" >&5 echo $ECHO_N "checking for main in -lm... $ECHO_C" >&6; } if test "${ac_cv_lib_m_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_m_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_m_main=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_m_main" >&5 echo "${ECHO_T}$ac_cv_lib_m_main" >&6; } if test $ac_cv_lib_m_main = yes; then LIBS="-lm ${LIBS}"; HAVE_LIBM="1" fi if test "${HAVE_LIBM}" = "1"; then for ac_header in math.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done fi { echo "$as_me:$LINENO: checking for main in -lz" >&5 echo $ECHO_N "checking for main in -lz... $ECHO_C" >&6; } if test "${ac_cv_lib_z_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lz $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_z_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_z_main=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_z_main" >&5 echo "${ECHO_T}$ac_cv_lib_z_main" >&6; } if test $ac_cv_lib_z_main = yes; then LIBZ="yes"; LIBS="-lz ${LIBS}" fi if test "${LIBZ}" = "yes"; then { echo "$as_me:$LINENO: checking for gzrewind in -lz" >&5 echo $ECHO_N "checking for gzrewind in -lz... $ECHO_C" >&6; } if test "${ac_cv_lib_z_gzrewind+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lz $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gzrewind (); int main () { return gzrewind (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_z_gzrewind=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_z_gzrewind=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_z_gzrewind" >&5 echo "${ECHO_T}$ac_cv_lib_z_gzrewind" >&6; } if test $ac_cv_lib_z_gzrewind = yes; then LIBZ="yes" else LIBZ="no" fi if test "${LIBZ}" = "no"; then { { echo "$as_me:$LINENO: error: Old version of libz found.. please upgrade!" >&5 echo "$as_me: error: Old version of libz found.. please upgrade!" >&2;} { (exit 1); exit 1; }; } fi else { { echo "$as_me:$LINENO: error: z library not found.. please install libz" >&5 echo "$as_me: error: z library not found.. please install libz" >&2;} { (exit 1); exit 1; }; } fi if test "${ac_cv_header_zlib_h+set}" = set; then { echo "$as_me:$LINENO: checking for zlib.h" >&5 echo $ECHO_N "checking for zlib.h... $ECHO_C" >&6; } if test "${ac_cv_header_zlib_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_zlib_h" >&5 echo "${ECHO_T}$ac_cv_header_zlib_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking zlib.h usability" >&5 echo $ECHO_N "checking zlib.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking zlib.h presence" >&5 echo $ECHO_N "checking zlib.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: zlib.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: zlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: zlib.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: zlib.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: zlib.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: zlib.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: zlib.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: zlib.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: zlib.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: zlib.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: zlib.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: zlib.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: zlib.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: zlib.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: zlib.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: zlib.h: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for zlib.h" >&5 echo $ECHO_N "checking for zlib.h... $ECHO_C" >&6; } if test "${ac_cv_header_zlib_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_zlib_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_zlib_h" >&5 echo "${ECHO_T}$ac_cv_header_zlib_h" >&6; } fi if test $ac_cv_header_zlib_h = yes; then HDR="yes" else HDR="no" fi if test "${HDR}" = "no"; then { { echo "$as_me:$LINENO: error: zlib.h header not found.. please install" >&5 echo "$as_me: error: zlib.h header not found.. please install" >&2;} { (exit 1); exit 1; }; } fi { echo "$as_me:$LINENO: checking for main in -lpng" >&5 echo $ECHO_N "checking for main in -lpng... $ECHO_C" >&6; } if test "${ac_cv_lib_png_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpng $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_png_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_png_main=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_png_main" >&5 echo "${ECHO_T}$ac_cv_lib_png_main" >&6; } if test $ac_cv_lib_png_main = yes; then LIBPNG="yes"; LIBS="-lpng ${LIBS}" else LIBPNG="no" fi if test "${LIBPNG}" = "no"; then { { echo "$as_me:$LINENO: error: png library not found.. please install libpng" >&5 echo "$as_me: error: png library not found.. please install libpng" >&2;} { (exit 1); exit 1; }; } fi { echo "$as_me:$LINENO: checking for main in -lgd" >&5 echo $ECHO_N "checking for main in -lgd... $ECHO_C" >&6; } if test "${ac_cv_lib_gd_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lgd $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_gd_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_gd_main=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_gd_main" >&5 echo "${ECHO_T}$ac_cv_lib_gd_main" >&6; } if test $ac_cv_lib_gd_main = yes; then LIBGD="yes"; LIBS="-lgd ${LIBS}" fi if test "${LIBGD}" = "yes"; then { echo "$as_me:$LINENO: checking for gdImagePng in -lgd" >&5 echo $ECHO_N "checking for gdImagePng in -lgd... $ECHO_C" >&6; } if test "${ac_cv_lib_gd_gdImagePng+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lgd $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gdImagePng (); int main () { return gdImagePng (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_gd_gdImagePng=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_gd_gdImagePng=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_gd_gdImagePng" >&5 echo "${ECHO_T}$ac_cv_lib_gd_gdImagePng" >&6; } if test $ac_cv_lib_gd_gdImagePng = yes; then LIBGD="yes" else LIBGD="no" fi if test "${LIBGD}" = "no"; then { { echo "$as_me:$LINENO: error: Old version of libgd found.. please upgrade!" >&5 echo "$as_me: error: Old version of libgd found.. please upgrade!" >&2;} { (exit 1); exit 1; }; } fi else { { echo "$as_me:$LINENO: error: gd library not found.. please install libgd" >&5 echo "$as_me: error: gd library not found.. please install libgd" >&2;} { (exit 1); exit 1; }; } fi if test "${ac_cv_header_gd_h+set}" = set; then { echo "$as_me:$LINENO: checking for gd.h" >&5 echo $ECHO_N "checking for gd.h... $ECHO_C" >&6; } if test "${ac_cv_header_gd_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_gd_h" >&5 echo "${ECHO_T}$ac_cv_header_gd_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking gd.h usability" >&5 echo $ECHO_N "checking gd.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking gd.h presence" >&5 echo $ECHO_N "checking gd.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: gd.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: gd.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: gd.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: gd.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: gd.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: gd.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: gd.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: gd.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: gd.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: gd.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: gd.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: gd.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: gd.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: gd.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: gd.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: gd.h: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for gd.h" >&5 echo $ECHO_N "checking for gd.h... $ECHO_C" >&6; } if test "${ac_cv_header_gd_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_gd_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_gd_h" >&5 echo "${ECHO_T}$ac_cv_header_gd_h" >&6; } fi if test $ac_cv_header_gd_h = yes; then HDR="yes" else HDR="no" fi if test "${HDR}" = "no"; then { { echo "$as_me:$LINENO: error: gd.h header not found.. please install" >&5 echo "$as_me: error: gd.h header not found.. please install" >&2;} { (exit 1); exit 1; }; } fi # Check whether --enable-dns was given. if test "${enable_dns+set}" = set; then enableval=$enable_dns; USE_DNS="${enableval}" else USE_DNS="yes" fi if test "${USE_DNS}" = "yes"; then { echo "$as_me:$LINENO: checking for main in -ldb" >&5 echo $ECHO_N "checking for main in -ldb... $ECHO_C" >&6; } if test "${ac_cv_lib_db_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldb $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_db_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_db_main=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_db_main" >&5 echo "${ECHO_T}$ac_cv_lib_db_main" >&6; } if test $ac_cv_lib_db_main = yes; then USE_DNS="yes" else USE_DNS="no"; { echo "$as_me:$LINENO: WARNING: libdb not found.. DNS/GeoDB code disabled!" >&5 echo "$as_me: WARNING: libdb not found.. DNS/GeoDB code disabled!" >&2;} fi fi if test "${USE_DNS}" = "yes"; then if test "${ac_cv_header_db_h+set}" = set; then { echo "$as_me:$LINENO: checking for db.h" >&5 echo $ECHO_N "checking for db.h... $ECHO_C" >&6; } if test "${ac_cv_header_db_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_db_h" >&5 echo "${ECHO_T}$ac_cv_header_db_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking db.h usability" >&5 echo $ECHO_N "checking db.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking db.h presence" >&5 echo $ECHO_N "checking db.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: db.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: db.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: db.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: db.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: db.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: db.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: db.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: db.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: db.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: db.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: db.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: db.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: db.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: db.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: db.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: db.h: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for db.h" >&5 echo $ECHO_N "checking for db.h... $ECHO_C" >&6; } if test "${ac_cv_header_db_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_db_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_db_h" >&5 echo "${ECHO_T}$ac_cv_header_db_h" >&6; } fi if test $ac_cv_header_db_h = yes; then USE_DNS="yes" else USE_DNS="no"; { echo "$as_me:$LINENO: WARNING: db.h not found.. DNS/GeoDB code disabled!" >&5 echo "$as_me: WARNING: db.h not found.. DNS/GeoDB code disabled!" >&2;} fi fi if test "${USE_DNS}" = "yes"; then OPTS="-DUSE_DNS ${OPTS}" LIBS="-ldb ${LIBS}" WCMGR_LIBS="-ldb" { echo "$as_me:$LINENO: checking for fdatasync" >&5 echo $ECHO_N "checking for fdatasync... $ECHO_C" >&6; } if test "${ac_cv_func_fdatasync+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define fdatasync to an innocuous variant, in case declares fdatasync. For example, HP-UX 11i declares gettimeofday. */ #define fdatasync innocuous_fdatasync /* System header to define __stub macros and hopefully few prototypes, which can conflict with char fdatasync (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef fdatasync /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char fdatasync (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_fdatasync || defined __stub___fdatasync choke me #endif int main () { return fdatasync (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_func_fdatasync=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_fdatasync=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_fdatasync" >&5 echo "${ECHO_T}$ac_cv_func_fdatasync" >&6; } if test $ac_cv_func_fdatasync = yes; then DUMMY="" fi if test "$ac_cv_func_fdatasync" = "no"; then { echo "$as_me:$LINENO: checking for fdatasync in -lrt" >&5 echo $ECHO_N "checking for fdatasync in -lrt... $ECHO_C" >&6; } if test "${ac_cv_lib_rt_fdatasync+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lrt $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char fdatasync (); int main () { return fdatasync (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_rt_fdatasync=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_rt_fdatasync=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_rt_fdatasync" >&5 echo "${ECHO_T}$ac_cv_lib_rt_fdatasync" >&6; } if test $ac_cv_lib_rt_fdatasync = yes; then LIBS="-lrt ${LIBS}";WCMGR_LIBS="-lrt ${WCMGR_LIBS}" fi fi { echo "$as_me:$LINENO: checking for socket" >&5 echo $ECHO_N "checking for socket... $ECHO_C" >&6; } if test "${ac_cv_func_socket+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define socket to an innocuous variant, in case declares socket. For example, HP-UX 11i declares gettimeofday. */ #define socket innocuous_socket /* System header to define __stub macros and hopefully few prototypes, which can conflict with char socket (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef socket /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char socket (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_socket || defined __stub___socket choke me #endif int main () { return socket (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_func_socket=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_socket=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_socket" >&5 echo "${ECHO_T}$ac_cv_func_socket" >&6; } if test $ac_cv_func_socket = yes; then DUMMY="" else DUMMY="" fi if test "$ac_cv_func_socket" = "no"; then { echo "$as_me:$LINENO: checking for main in -lsocket" >&5 echo $ECHO_N "checking for main in -lsocket... $ECHO_C" >&6; } if test "${ac_cv_lib_socket_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_socket_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_socket_main=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_socket_main" >&5 echo "${ECHO_T}$ac_cv_lib_socket_main" >&6; } if test $ac_cv_lib_socket_main = yes; then LIBS="-lsocket ${LIBS}" fi fi for ac_header in sys/socket.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done { echo "$as_me:$LINENO: checking for inet_pton" >&5 echo $ECHO_N "checking for inet_pton... $ECHO_C" >&6; } if test "${ac_cv_func_inet_pton+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define inet_pton to an innocuous variant, in case declares inet_pton. For example, HP-UX 11i declares gettimeofday. */ #define inet_pton innocuous_inet_pton /* System header to define __stub macros and hopefully few prototypes, which can conflict with char inet_pton (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef inet_pton /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char inet_pton (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_inet_pton || defined __stub___inet_pton choke me #endif int main () { return inet_pton (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_func_inet_pton=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_inet_pton=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_inet_pton" >&5 echo "${ECHO_T}$ac_cv_func_inet_pton" >&6; } if test $ac_cv_func_inet_pton = yes; then DUMMY="" else DUMMY="" fi if test "$ac_cv_func_inet_pton" = "no"; then { echo "$as_me:$LINENO: checking for inet_pton in -lnsl" >&5 echo $ECHO_N "checking for inet_pton in -lnsl... $ECHO_C" >&6; } if test "${ac_cv_lib_nsl_inet_pton+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char inet_pton (); int main () { return inet_pton (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_nsl_inet_pton=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_nsl_inet_pton=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_inet_pton" >&5 echo "${ECHO_T}$ac_cv_lib_nsl_inet_pton" >&6; } if test $ac_cv_lib_nsl_inet_pton = yes; then LIBS="-lnsl ${LIBS}" fi fi fi # Check whether --enable-bz2 was given. if test "${enable_bz2+set}" = set; then enableval=$enable_bz2; USE_BZIP="${enableval}" else USE_BZIP="no" fi # Check whether --with-bz2 was given. if test "${with_bz2+set}" = set; then withval=$with_bz2; S_BZ2="${withval}"; CPPFLAGS="${CPPFLAGS} -I${withval}" fi # Check whether --with-bz2lib was given. if test "${with_bz2lib+set}" = set; then withval=$with_bz2lib; S_BZ2LIB="${withval}"; LDFLAGS="-L${withval} ${LDFLAGS}" fi if test "${USE_BZIP}" = "yes"; then { echo "$as_me:$LINENO: checking for main in -lbz2" >&5 echo $ECHO_N "checking for main in -lbz2... $ECHO_C" >&6; } if test "${ac_cv_lib_bz2_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbz2 $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_bz2_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_bz2_main=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_bz2_main" >&5 echo "${ECHO_T}$ac_cv_lib_bz2_main" >&6; } if test $ac_cv_lib_bz2_main = yes; then USE_BZIP="yes" else USE_BZIP="no"; { echo "$as_me:$LINENO: WARNING: libbz2 not found.. bzip2 code will will be disabled!" >&5 echo "$as_me: WARNING: libbz2 not found.. bzip2 code will will be disabled!" >&2;} fi fi if test "${USE_BZIP}" = "yes"; then { echo "$as_me:$LINENO: checking for BZ2_bzopen in -lbz2" >&5 echo $ECHO_N "checking for BZ2_bzopen in -lbz2... $ECHO_C" >&6; } if test "${ac_cv_lib_bz2_BZ2_bzopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbz2 $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char BZ2_bzopen (); int main () { return BZ2_bzopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_bz2_BZ2_bzopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_bz2_BZ2_bzopen=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_bz2_BZ2_bzopen" >&5 echo "${ECHO_T}$ac_cv_lib_bz2_BZ2_bzopen" >&6; } if test $ac_cv_lib_bz2_BZ2_bzopen = yes; then USE_BZIP="yes" else USE_BZIP="no"; { echo "$as_me:$LINENO: WARNING: Old bz2 library found.. bzip2 code will be disabled!" >&5 echo "$as_me: WARNING: Old bz2 library found.. bzip2 code will be disabled!" >&2;} fi fi if test "${USE_BZIP}" = "yes"; then if test "${ac_cv_header_bzlib_h+set}" = set; then { echo "$as_me:$LINENO: checking for bzlib.h" >&5 echo $ECHO_N "checking for bzlib.h... $ECHO_C" >&6; } if test "${ac_cv_header_bzlib_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_bzlib_h" >&5 echo "${ECHO_T}$ac_cv_header_bzlib_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking bzlib.h usability" >&5 echo $ECHO_N "checking bzlib.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking bzlib.h presence" >&5 echo $ECHO_N "checking bzlib.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: bzlib.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: bzlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: bzlib.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: bzlib.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: bzlib.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: bzlib.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: bzlib.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: bzlib.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: bzlib.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: bzlib.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: bzlib.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: bzlib.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: bzlib.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: bzlib.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: bzlib.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: bzlib.h: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for bzlib.h" >&5 echo $ECHO_N "checking for bzlib.h... $ECHO_C" >&6; } if test "${ac_cv_header_bzlib_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_bzlib_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_bzlib_h" >&5 echo "${ECHO_T}$ac_cv_header_bzlib_h" >&6; } fi if test $ac_cv_header_bzlib_h = yes; then USE_BZIP="yes" else USE_BZIP="no"; { echo "$as_me:$LINENO: WARNING: bzlib.h not found.. bzip2 code will be disabled!" >&5 echo "$as_me: WARNING: bzlib.h not found.. bzip2 code will be disabled!" >&2;} fi fi if test "${USE_BZIP}" = "yes"; then OPTS="-DUSE_BZIP ${OPTS}" LIBS="-lbz2 ${LIBS}" fi # Check whether --enable-geoip was given. if test "${enable_geoip+set}" = set; then enableval=$enable_geoip; USE_GEOIP="${enableval}" else USE_GEOIP="no" fi # Check whether --with-geoip was given. if test "${with_geoip+set}" = set; then withval=$with_geoip; S_GEOIP="${withval}"; CPPFLAGS="${CPPFLAGS} -I${withval}" fi # Check whether --with-geoiplib was given. if test "${with_geoiplib+set}" = set; then withval=$with_geoiplib; S_GEOIPLIB="${withval}"; LDFLAGS="-L${withval} ${LDFLAGS}" fi if test "${USE_GEOIP}" = "yes"; then { echo "$as_me:$LINENO: checking for main in -lGeoIP" >&5 echo $ECHO_N "checking for main in -lGeoIP... $ECHO_C" >&6; } if test "${ac_cv_lib_GeoIP_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lGeoIP $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_GeoIP_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_GeoIP_main=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_GeoIP_main" >&5 echo "${ECHO_T}$ac_cv_lib_GeoIP_main" >&6; } if test $ac_cv_lib_GeoIP_main = yes; then USE_GEOIP="yes" else USE_GEOIP="no"; { echo "$as_me:$LINENO: WARNING: libGeoIP not found.. GeoIP code will be disabled!" >&5 echo "$as_me: WARNING: libGeoIP not found.. GeoIP code will be disabled!" >&2;} fi fi if test "${USE_GEOIP}" = "yes"; then if test "${ac_cv_header_GeoIP_h+set}" = set; then { echo "$as_me:$LINENO: checking for GeoIP.h" >&5 echo $ECHO_N "checking for GeoIP.h... $ECHO_C" >&6; } if test "${ac_cv_header_GeoIP_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_GeoIP_h" >&5 echo "${ECHO_T}$ac_cv_header_GeoIP_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking GeoIP.h usability" >&5 echo $ECHO_N "checking GeoIP.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking GeoIP.h presence" >&5 echo $ECHO_N "checking GeoIP.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: GeoIP.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: GeoIP.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: GeoIP.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: GeoIP.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: GeoIP.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: GeoIP.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: GeoIP.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: GeoIP.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: GeoIP.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: GeoIP.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: GeoIP.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: GeoIP.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: GeoIP.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: GeoIP.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: GeoIP.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: GeoIP.h: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for GeoIP.h" >&5 echo $ECHO_N "checking for GeoIP.h... $ECHO_C" >&6; } if test "${ac_cv_header_GeoIP_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_GeoIP_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_GeoIP_h" >&5 echo "${ECHO_T}$ac_cv_header_GeoIP_h" >&6; } fi if test $ac_cv_header_GeoIP_h = yes; then USE_GEOIP="yes" else USE_GEOIP="no"; { echo "$as_me:$LINENO: WARNING: GeoIP.h not found.. GeoIP code will be disabled!" >&5 echo "$as_me: WARNING: GeoIP.h not found.. GeoIP code will be disabled!" >&2;} fi fi if test "${USE_GEOIP}" = "yes"; then OPTS="-DUSE_GEOIP ${OPTS}" LIBS="-lGeoIP ${LIBS}" fi # Check whether --with-geodb was given. if test "${with_geodb+set}" = set; then withval=$with_geodb; GEODB_LOC="${withval}" else GEODB_LOC="/usr/share/GeoDB" fi # Check whether --enable-oldhash was given. if test "${enable_oldhash+set}" = set; then enableval=$enable_oldhash; OLDHASH=${enableval} else OLDHASH="no" fi if test "$OLDHASH" = "yes"; then OPTS="-DUSE_OLDHASH"; fi LANG_CACHE=yes # Check whether --with-language was given. if test "${with_language+set}" = set; then withval=$with_language; WEBALIZER_LANG="${withval}"; LANG_CACHE=no else LANG_CACHE=yes fi if test "$WEBALIZER_LANG" = "no"; then WEBALIZER_LANG=english; fi { echo "$as_me:$LINENO: checking for language file" >&5 echo $ECHO_N "checking for language file... $ECHO_C" >&6; } if test "$LANG_CACHE" = "yes"; then if test "${ac_cv_language+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_language=$DEFAULT_LANG fi WEBALIZER_LANG=$ac_cv_language fi if test -f lang/webalizer_lang.${WEBALIZER_LANG}; then { echo "$as_me:$LINENO: result: yes - ${WEBALIZER_LANG}" >&5 echo "${ECHO_T}yes - ${WEBALIZER_LANG}" >&6; } else if test -f lang/webalizer_lang.${DEFAULT_LANG}; then { echo "$as_me:$LINENO: result: '${WEBALIZER_LANG}' not found - using ${DEFAULT_LANG}" >&5 echo "${ECHO_T}'${WEBALIZER_LANG}' not found - using ${DEFAULT_LANG}" >&6; } WEBALIZER_LANG=${DEFAULT_LANG} else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } { { echo "$as_me:$LINENO: error: language files not found... fix before continuing" >&5 echo "$as_me: error: language files not found... fix before continuing" >&2;} { (exit 1); exit 1; }; } fi fi ac_cv_language=${WEBALIZER_LANG} ac_sources="lang/webalizer_lang.${WEBALIZER_LANG}" ac_dests="webalizer_lang.h" while test -n "$ac_sources"; do set $ac_dests; ac_dest=$1; shift; ac_dests=$* set $ac_sources; ac_source=$1; shift; ac_sources=$* ac_config_links_1="$ac_config_links_1 $ac_dest:$ac_source" done ac_config_links="$ac_config_links $ac_config_links_1" ac_config_files="$ac_config_files Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { echo "$as_me:$LINENO: updating cache $cache_file" >&5 echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. ac_script=' t clear :clear s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote b any :quote s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g s/\[/\\&/g s/\]/\\&/g s/\$/$$/g H :any ${ g s/^\n// s/\n/ /g p } ' DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # PATH needs CR # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. Blame Lee # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 # Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by webalizer $as_me V2.23, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. config_files="$ac_config_files" config_links="$ac_config_links" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE Configuration files: $config_files Configuration links: $config_links Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ webalizer config.status V2.23 configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2006 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --he | --h | --help | --hel | -h ) echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 CONFIG_SHELL=$SHELL export CONFIG_SHELL exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "$ac_config_links_1") CONFIG_LINKS="$CONFIG_LINKS $ac_config_links_1" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_LINKS+set}" = set || CONFIG_LINKS=$config_links fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # # Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "$CONFIG_FILES"; then _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF SHELL!$SHELL$ac_delim PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim PACKAGE_NAME!$PACKAGE_NAME$ac_delim PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim PACKAGE_STRING!$PACKAGE_STRING$ac_delim PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim exec_prefix!$exec_prefix$ac_delim prefix!$prefix$ac_delim program_transform_name!$program_transform_name$ac_delim bindir!$bindir$ac_delim sbindir!$sbindir$ac_delim libexecdir!$libexecdir$ac_delim datarootdir!$datarootdir$ac_delim datadir!$datadir$ac_delim sysconfdir!$sysconfdir$ac_delim sharedstatedir!$sharedstatedir$ac_delim localstatedir!$localstatedir$ac_delim includedir!$includedir$ac_delim oldincludedir!$oldincludedir$ac_delim docdir!$docdir$ac_delim infodir!$infodir$ac_delim htmldir!$htmldir$ac_delim dvidir!$dvidir$ac_delim pdfdir!$pdfdir$ac_delim psdir!$psdir$ac_delim libdir!$libdir$ac_delim localedir!$localedir$ac_delim mandir!$mandir$ac_delim DEFS!$DEFS$ac_delim ECHO_C!$ECHO_C$ac_delim ECHO_N!$ECHO_N$ac_delim ECHO_T!$ECHO_T$ac_delim LIBS!$LIBS$ac_delim build_alias!$build_alias$ac_delim host_alias!$host_alias$ac_delim target_alias!$target_alias$ac_delim OPTS!$OPTS$ac_delim WCMGR_LIBS!$WCMGR_LIBS$ac_delim DEFAULT_LANG!$DEFAULT_LANG$ac_delim CC!$CC$ac_delim CFLAGS!$CFLAGS$ac_delim LDFLAGS!$LDFLAGS$ac_delim CPPFLAGS!$CPPFLAGS$ac_delim ac_ct_CC!$ac_ct_CC$ac_delim EXEEXT!$EXEEXT$ac_delim OBJEXT!$OBJEXT$ac_delim LN_S!$LN_S$ac_delim INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim INSTALL_DATA!$INSTALL_DATA$ac_delim CPP!$CPP$ac_delim GREP!$GREP$ac_delim EGREP!$EGREP$ac_delim GEODB_LOC!$GEODB_LOC$ac_delim LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 57; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b end _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF :end s/|#_!!_#|//g CEOF$ac_eof _ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/ s/:*\${srcdir}:*/:/ s/:*@srcdir@:*/:/ s/^\([^=]*=[ ]*\):*/\1/ s/:*$// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF fi # test -n "$CONFIG_FILES" for ac_tag in :F $CONFIG_FILES :L $CONFIG_LINKS do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 echo "$as_me: error: Invalid tag $ac_tag." >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac ac_file_inputs="$ac_file_inputs $ac_f" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input="Generated from "`IFS=: echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} fi case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin";; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` { as_dir="$ac_dir" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= case `sed -n '/datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p ' $ac_file_inputs` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s&@configure_input@&$configure_input&;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t $ac_datarootdir_hack " $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out"; rm -f "$tmp/out";; *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac ;; :L) # # CONFIG_LINK # { echo "$as_me:$LINENO: linking $srcdir/$ac_source to $ac_file" >&5 echo "$as_me: linking $srcdir/$ac_source to $ac_file" >&6;} if test ! -r "$srcdir/$ac_source"; then { { echo "$as_me:$LINENO: error: $srcdir/$ac_source: file not found" >&5 echo "$as_me: error: $srcdir/$ac_source: file not found" >&2;} { (exit 1); exit 1; }; } fi rm -f "$ac_file" # Try a relative symlink, then a hard link, then a copy. case $srcdir in [\\/$]* | ?:[\\/]* ) ac_rel_source=$srcdir/$ac_source ;; *) ac_rel_source=$ac_top_build_prefix$srcdir/$ac_source ;; esac ln -s "$ac_rel_source" "$ac_file" 2>/dev/null || ln "$srcdir/$ac_source" "$ac_file" 2>/dev/null || cp -p "$srcdir/$ac_source" "$ac_file" || { { echo "$as_me:$LINENO: error: cannot link or copy $srcdir/$ac_source to $ac_file" >&5 echo "$as_me: error: cannot link or copy $srcdir/$ac_source to $ac_file" >&2;} { (exit 1); exit 1; }; } ;; esac done # for ac_tag { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi { echo "$as_me:$LINENO: Done. Type 'make' to continue with build." >&5 echo "$as_me: Done. Type 'make' to continue with build." >&6;} webalizer-2.23-05/configure.in0000644000175000017500000002417211510253130014556 0ustar bradbraddnl dnl The Webalizer - A web server log file analysis program dnl Copyright (C) 1997-2011 by Bradford L. Barrett dnl dnl configure.in template for The Webalizer Version 2.23 dnl Process this file with autoconf to produce a configure script. dnl AC_INIT(webalizer,V2.23) OPTS=${DEFS} LIBS=${LIBS} AC_SUBST(OPTS) AC_SUBST(WCMGR_LIBS) dnl ------------------------------------------ dnl default language (don't change!) dnl ------------------------------------------ DEFAULT_LANG="english" AC_SUBST(DEFAULT_LANG) dnl ------------------------------------------ dnl Checks for required programs. dnl ------------------------------------------ IN_CFLAGS=${CFLAGS} AC_PROG_CC AC_PROG_LN_S AC_PROG_INSTALL dnl ------------------------------------------ dnl check for platform specific settings dnl ------------------------------------------ AC_SYS_LARGEFILE AC_C_CHAR_UNSIGNED AC_CHECK_TYPE(u_int64_t, unsigned long long) AC_CHECK_DECL(altzone,OPTS="-DHAVE_ALTZONE ${OPTS}",,[#include ]) dnl ------------------------------------------ dnl force our own CFLAGS defaults if GCC dnl ------------------------------------------ if test "$GCC" = "yes"; then AC_ARG_ENABLE(static, [ --enable-static Build as static executable [[default=no]]], LDFLAGS="--static ${LDFLAGS}") if test "$IN_CFLAGS" = ""; then CFLAGS="-Wall -O2" fi if test "$ac_cv_c_char_unsigned" = "yes"; then CFLAGS="-fsigned-char ${CFLAGS}" fi AC_ARG_ENABLE(debug, [ --enable-debug Compile with debugging code [[default=no]]], CFLAGS="-g ${CFLAGS}") else if test "$IN_CFLAGS" = ""; then CFLAGS="-g" fi fi dnl ------------------------------------------ dnl check command line arguments dnl ------------------------------------------ AC_ARG_WITH(gd, [ --with-gd=DIR Alternate location for gd header files], S_GD="${withval}"; CPPFLAGS="${CPPFLAGS} -I${withval}") AC_ARG_WITH(gdlib, [ --with-gdlib=DIR Alternate location for gd library], S_GDLIB="${withval}"; LDFLAGS="-L${withval} ${LDFLAGS}") AC_ARG_WITH(png, [ --with-png=DIR Alternate location for png header files], S_PNG="${withval}"; CPPFLAGS="${CPPFLAGS} -I${withval}") AC_ARG_WITH(pnglib, [ --with-pnglib=DIR Alternate location for png library], S_PNGLIB="${withval}"; LDFLAGS="-L${withval} ${LDFLAGS}") AC_ARG_WITH(z, [ --with-z=DIR Alternate location for libz header files], S_Z="${withval}"; CPPFLAGS="${CPPFLAGS} -I${withval}") AC_ARG_WITH(zlib, [ --with-zlib=DIR Alternate location for z library], S_ZLIB="${withval}"; LDFLAGS="-L${withval} ${LDFLAGS}") AC_ARG_WITH(db, [ --with-db=DIR Alternate location for libdb header files], S_DB="${withval}"; CPPFLAGS="${CPPFLAGS} -I${withval}") AC_ARG_WITH(dblib, [ --with-dblib=DIR Alternate location for db library], S_DBLIB="${withval}"; LDFLAGS="-L${withval} ${LDFLAGS}") dnl ------------------------------------------ dnl these are needed on some platforms dnl ------------------------------------------ AC_CHECK_LIB(44bsd, main, LIBS="-l44bsd ${LIBS}") AC_CHECK_HEADERS(getopt.h) AC_CHECK_LIB(m, main, LIBS="-lm ${LIBS}"; HAVE_LIBM="1") if test "${HAVE_LIBM}" = "1"; then AC_CHECK_HEADERS(math.h) fi dnl ------------------------------------------ dnl ensure current libz is present - required! dnl ------------------------------------------ AC_CHECK_LIB(z, main, LIBZ="yes"; LIBS="-lz ${LIBS}") if test "${LIBZ}" = "yes"; then AC_CHECK_LIB(z, gzrewind,LIBZ="yes",LIBZ="no") if test "${LIBZ}" = "no"; then AC_MSG_ERROR(Old version of libz found.. please upgrade!) fi else AC_MSG_ERROR(z library not found.. please install libz) fi AC_CHECK_HEADER(zlib.h, HDR="yes", HDR="no") if test "${HDR}" = "no"; then AC_MSG_ERROR(zlib.h header not found.. please install) fi dnl ------------------------------------------ dnl ensure libpng is present - required! dnl ------------------------------------------ AC_CHECK_LIB(png, main, LIBPNG="yes"; LIBS="-lpng ${LIBS}",LIBPNG="no") if test "${LIBPNG}" = "no"; then AC_MSG_ERROR(png library not found.. please install libpng) fi dnl ------------------------------------------ dnl ensure libgd is present - required! dnl ------------------------------------------ AC_CHECK_LIB(gd, main, LIBGD="yes"; LIBS="-lgd ${LIBS}") if test "${LIBGD}" = "yes"; then AC_CHECK_LIB(gd, gdImagePng, LIBGD="yes", LIBGD="no") if test "${LIBGD}" = "no"; then AC_MSG_ERROR(Old version of libgd found.. please upgrade!) fi else AC_MSG_ERROR(gd library not found.. please install libgd) fi AC_CHECK_HEADER(gd.h, HDR="yes", HDR="no") if test "${HDR}" = "no"; then AC_MSG_ERROR(gd.h header not found.. please install) fi dnl ------------------------------------------ dnl DNS/GeoDB lookup specific tests dnl ------------------------------------------ AC_ARG_ENABLE(dns, [ --enable-dns Enable DNS/GeoDB lookup code [[default=yes]]], USE_DNS="${enableval}", USE_DNS="yes") if test "${USE_DNS}" = "yes"; then AC_CHECK_LIB(db, main, USE_DNS="yes", USE_DNS="no"; AC_MSG_WARN(libdb not found.. DNS/GeoDB code disabled!)) fi if test "${USE_DNS}" = "yes"; then AC_CHECK_HEADER(db.h, USE_DNS="yes", USE_DNS="no"; AC_MSG_WARN(db.h not found.. DNS/GeoDB code disabled!)) fi if test "${USE_DNS}" = "yes"; then dnl we have both library and header.. proceed OPTS="-DUSE_DNS ${OPTS}" LIBS="-ldb ${LIBS}" WCMGR_LIBS="-ldb" AC_CHECK_FUNC(fdatasync,DUMMY="") if test "$ac_cv_func_fdatasync" = "no"; then AC_CHECK_LIB(rt, fdatasync, LIBS="-lrt ${LIBS}";WCMGR_LIBS="-lrt ${WCMGR_LIBS}") fi AC_CHECK_FUNC(socket,DUMMY="",DUMMY="") if test "$ac_cv_func_socket" = "no"; then AC_CHECK_LIB(socket, main, LIBS="-lsocket ${LIBS}") fi AC_CHECK_HEADERS(sys/socket.h) AC_CHECK_FUNC(inet_pton,DUMMY="",DUMMY="") if test "$ac_cv_func_inet_pton" = "no"; then AC_CHECK_LIB(nsl,inet_pton, LIBS="-lnsl ${LIBS}") fi fi dnl ------------------------------------------ dnl BZip2 code specific tests dnl ------------------------------------------ AC_ARG_ENABLE(bz2, [ --enable-bz2 Enable BZip2 decompression code [[default=no]]], USE_BZIP="${enableval}", USE_BZIP="no") AC_ARG_WITH(bz2, [ --with-bz2=DIR Alternate location for bz2 header files], S_BZ2="${withval}"; CPPFLAGS="${CPPFLAGS} -I${withval}") AC_ARG_WITH(bz2lib, [ --with-bz2lib=DIR Alternate location for bz2 library], S_BZ2LIB="${withval}"; LDFLAGS="-L${withval} ${LDFLAGS}") if test "${USE_BZIP}" = "yes"; then AC_CHECK_LIB(bz2, main, USE_BZIP="yes", USE_BZIP="no"; AC_MSG_WARN(libbz2 not found.. bzip2 code will will be disabled!)) fi if test "${USE_BZIP}" = "yes"; then AC_CHECK_LIB(bz2, BZ2_bzopen, USE_BZIP="yes", USE_BZIP="no"; AC_MSG_WARN(Old bz2 library found.. bzip2 code will be disabled!)) fi if test "${USE_BZIP}" = "yes"; then AC_CHECK_HEADER(bzlib.h, USE_BZIP="yes", USE_BZIP="no"; AC_MSG_WARN(bzlib.h not found.. bzip2 code will be disabled!)) fi if test "${USE_BZIP}" = "yes"; then dnl we have both library and header.. proceed OPTS="-DUSE_BZIP ${OPTS}" LIBS="-lbz2 ${LIBS}" fi dnl ------------------------------------------ dnl GeoIP code specific tests dnl ------------------------------------------ AC_ARG_ENABLE(geoip, [ --enable-geoip Enable GeoIP geolocation code [[default=no]]], USE_GEOIP="${enableval}", USE_GEOIP="no") AC_ARG_WITH(geoip, [ --with-geoip=DIR Alternate location for libGeoIP header files], S_GEOIP="${withval}"; CPPFLAGS="${CPPFLAGS} -I${withval}") AC_ARG_WITH(geoiplib, [ --with-geoiplib=DIR Alternate location for geoip library], S_GEOIPLIB="${withval}"; LDFLAGS="-L${withval} ${LDFLAGS}") if test "${USE_GEOIP}" = "yes"; then AC_CHECK_LIB(GeoIP, main, USE_GEOIP="yes", USE_GEOIP="no"; AC_MSG_WARN(libGeoIP not found.. GeoIP code will be disabled!)) fi if test "${USE_GEOIP}" = "yes"; then AC_CHECK_HEADER(GeoIP.h, USE_GEOIP="yes", USE_GEOIP="no"; AC_MSG_WARN(GeoIP.h not found.. GeoIP code will be disabled!)) fi if test "${USE_GEOIP}" = "yes"; then dnl we have both library and header.. proceed OPTS="-DUSE_GEOIP ${OPTS}" LIBS="-lGeoIP ${LIBS}" fi dnl ------------------------------------------ dnl check for default GeoDB directory dnl ------------------------------------------ AC_ARG_WITH(geodb, [ --with-geodb=DIR Default GeoDB data dir [[/usr/share/GeoDB]]], GEODB_LOC="${withval}", GEODB_LOC="/usr/share/GeoDB") AC_SUBST(GEODB_LOC) dnl ------------------------------------------ dnl check which hash function to use dnl ------------------------------------------ AC_ARG_ENABLE(oldhash, [ --enable-oldhash Use old hash function (slower) [[default=no]]], OLDHASH=${enableval}, OLDHASH="no") if test "$OLDHASH" = "yes"; then OPTS="-DUSE_OLDHASH"; fi dnl ------------------------------------------ dnl check language to use (default is english) dnl ------------------------------------------ LANG_CACHE=yes AC_ARG_WITH(language, [ --with-language=name Use language 'name' (default is english)], WEBALIZER_LANG="${withval}"; LANG_CACHE=no, LANG_CACHE=yes) if test "$WEBALIZER_LANG" = "no"; then WEBALIZER_LANG=english; fi dnl ------------------------------------------ dnl check if specfied language is valid dnl ------------------------------------------ AC_MSG_CHECKING(for language file) if test "$LANG_CACHE" = "yes"; then AC_CACHE_VAL(ac_cv_language, ac_cv_language=$DEFAULT_LANG) WEBALIZER_LANG=$ac_cv_language fi if test -f lang/webalizer_lang.${WEBALIZER_LANG}; then AC_MSG_RESULT(yes - ${WEBALIZER_LANG}) else if test -f lang/webalizer_lang.${DEFAULT_LANG}; then AC_MSG_RESULT('${WEBALIZER_LANG}' not found - using ${DEFAULT_LANG}) WEBALIZER_LANG=${DEFAULT_LANG} else AC_MSG_RESULT(no) AC_MSG_ERROR(language files not found... fix before continuing) fi fi ac_cv_language=${WEBALIZER_LANG} dnl ------------------------------------------ dnl create link to language file dnl ------------------------------------------ AC_LINK_FILES(lang/webalizer_lang.${WEBALIZER_LANG}, webalizer_lang.h) dnl ------------------------------------------ dnl done.. write out our Makefile dnl ------------------------------------------ AC_OUTPUT(Makefile) AC_MSG_NOTICE(Done. Type 'make' to continue with build.) webalizer-2.23-05/country-codes.txt0000644000175000017500000001305611016706757015626 0ustar bradbradac Ascension Island ad Andorra ae United Arab Emirates af Afghanistan ag Antigua and Barbuda ai Anguilla al Albania am Armenia an Netherlands Antilles ao Angola aq Antarctica ar Argentina as American Samoa at Austria au Australia aw Aruba ax Aland Islands az Azerbaijan ba Bosnia and Herzegovina bb Barbados bd Bangladesh be Belgium bf Burkina Faso bg Bulgaria bh Bahrain bi Burundi bj Benin bl Saint Barthelemy bm Bermuda bn Brunei Darussalam bo Bolivia br Brazil bs Bahamas bt Bhutan bv Bouvet Island bw Botswana by Belarus bz Belize ca Canada cc Cocos (Keeling) Islands cd Congo, Democratic Republic cf Central African Republic cg Congo ch Switzerland ci Cote D'Ivoire (Ivory Coast) ck Cook Islands cl Chile cm Cameroon cn China co Colombia cr Costa Rica cu Cuba cv Cape Verde cx Christmas Island cy Cyprus cz Czech Republic de Germany dj Djibouti dk Denmark dm Dominica do Dominican Republic dz Algeria ec Ecuador ee Estonia eg Egypt eh Western Sahara er Eritrea es Spain et Ethiopia eu European Union fi Finland fj Fiji fk Falkland Islands (Malvinas) fm Micronesia fo Faroe Islands fr France ga Gabon gb Great Britain (UK) gd Grenada ge Georgia gf French Guiana gg Guernsey gh Ghana gi Gibraltar gl Greenland gm Gambia gn Guinea gp Guadeloupe gq Equatorial Guinea gr Greece gs S. Georgia and S. Sandwich Isls. gt Guatemala gu Guam gw Guinea-Bissau gy Guyana hk Hong Kong hm Heard and McDonald Islands hn Honduras hr Croatia ht Haiti hu Hungary id Indonesia ie Ireland il Israel im Isle of Man in India io British Indian Ocean Territory iq Iraq ir Iran is Iceland it Italy je Jersey jm Jamaica jo Jordan jp Japan ke Kenya kg Kyrgyzstan kh Cambodia ki Kiribati km Comoros kn Saint Kitts and Nevis kp Korea, Democratic Republic of kr Korea, Republic of kw Kuwait ky Cayman Islands kz Kazakhstan la Laos lb Lebanon lc Saint Lucia li Liechtenstein lk Sri Lanka lr Liberia ls Lesotho lt Lithuania lu Luxembourg lv Latvia ly Libya ma Morocco mc Monaco md Moldova me Montenegro mf Saint Martin (French part) mg Madagascar mh Marshall Islands mk Macedonia ml Mali mm Myanmar mn Mongolia mo Macau mp Northern Mariana Islands mq Martinique mr Mauritania ms Montserrat mt Malta mu Mauritius mv Maldives mw Malawi mx Mexico my Malaysia mz Mozambique na Namibia nc New Caledonia ne Niger nf Norfolk Island ng Nigeria ni Nicaragua nl Netherlands no Norway np Nepal nr Nauru nu Niue nz New Zealand (Aotearoa) om Oman pa Panama pe Peru pf French Polynesia pg Papua New Guinea ph Philippines pk Pakistan pl Poland pm St. Pierre and Miquelon pn Pitcairn pr Puerto Rico ps Palestinian Territory, Occupied pt Portugal pw Palau py Paraguay qa Qatar re Reunion ro Romania rs Serbia ru Russian Federation rw Rwanda sa Saudi Arabia sb Solomon Islands sc Seychelles sd Sudan se Sweden sg Singapore sh St. Helena si Slovenia sj Svalbard and Jan Mayen Islands sk Slovakia sl Sierra Leone sm San Marino sn Senegal so Somalia sr Suriname st Sao Tome and Principe su Soviet Union sv El Salvador sy Syrian Arab Republic sz Swaziland tc Turks and Caicos Islands td Chad tf French Southern Territories tg Togo th Thailand tj Tajikistan tk Tokelau tl Timor-Leste tm Turkmenistan tn Tunisia to Tonga tp Portuguese Timor tr Turkey tt Trinidad and Tobago tv Tuvalu tw Taiwan tz Tanzania ua Ukraine ug Uganda uk United Kingdom um US Minor Outlying Islands us United States uy Uruguay uz Uzbekistan va Vatican City State (Holy See) vc Saint Vincent and the Grenadines ve Venezuela vg Virgin Islands (British) vi Virgin Islands (U.S.) vn Viet Nam vu Vanuatu wf Wallis and Futuna Islands ws Samoa ye Yemen yt Mayotte yu Yugoslavia za South Africa zm Zambia zw Zimbabwe com US Commercial (com) edu US Educational (edu) gov US Government (gov) int International (int) mil US Military (mil) net Network (net) org Non-Profit Organization (org) biz Generic Business (biz) cat Catalan Community (cat) pro Professional (pro) tel Ind. Contact Data (tel) aero Air Transport Industry (aero) asia Asia Pacific Community (asia) coop Cooperative Association (coop) info Generic TLD (info) jobs Human Resources (jobs) mobi Generic Mobile TLD (mobi) name Individual (name) arpa Address Routing (arpa) nato Nato field (nato) museum Museums (museum) travel Travel Ind. (travel) a1 Anonymous Proxy a2 Satellite Provider o1 Other ap Asia/Pacific Region lan Local Network (lan) webalizer-2.23-05/dns_resolv.c0000644000175000017500000006452511510252664014610 0ustar bradbrad/* webalizer - a web server log analysis program Copyright (C) 1997-2011 Bradford L. Barrett This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version, and provided that the above copyright and permission notice is included with all distributed copies of this or derived software. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ /*********************************************/ /* STANDARD INCLUDES */ /*********************************************/ #include #include #include #include #include #include /* normal stuff */ #include #include #include /* ensure sys/types */ #ifndef _SYS_TYPES_H #include #endif /* Need socket header? */ #ifdef HAVE_SYS_SOCKET_H #include #endif /* some systems need this */ #ifdef HAVE_MATH_H #include #endif #ifdef USE_DNS /* skip everything in this file if no DNS */ #include /* include stuff we need for dns lookups, */ #include /* DB access, file control, etc... */ #include #include /* ensure getaddrinfo/getnameinfo */ #include #include #include #include #include #include /* DB header ****************/ #include "webalizer.h" /* main header */ #include "lang.h" /* language declares */ #include "hashtab.h" /* hash table functions */ #include "parser.h" /* log parser functions */ #include "dns_resolv.h" /* our header */ /* local data */ DB *dns_db = NULL; /* DNS cache database */ int dns_fd = 0; DB *geo_db = NULL; /* GeoDB database */ DBC *geo_dbc = NULL; /* GeoDB database cursor */ struct dns_child child[MAXCHILD]; /* DNS child pipe data */ DNODEPTR host_table[MAXHASH]; /* hostname/ip hash table */ char buffer[BUFSIZE]; /* log file record buffer */ char tmp_buf[BUFSIZE]; /* used to temp save above */ struct utsname system_info; /* system info structure */ int raiseSigChild = 1; time_t runtime; time_t start_time, end_time; float temp_time; extern char *our_gzgets(void *, char *, int); /* external our_gzgets func */ /* internal function prototypes */ static void process_list(DNODEPTR); static void sigChild(int); static void db_put(char *, char *, int); void set_fl(int, int); void clr_fl(int, int); int iptype(char *, unsigned char *); /*********************************************/ /* RESOLVE_DNS - lookup IP in cache */ /*********************************************/ void resolve_dns(struct log_struct *log_rec) { DBT query, response; int i; /* aligned dnsRecord to prevent Solaris from doing a dump */ /* (not found in debugger, as it can dereference it :( */ struct dnsRecord alignedRecord; if (!dns_db) return; /* ensure we have a dns db */ memset(&query, 0, sizeof(query)); memset(&response, 0, sizeof(response)); query.data = log_rec->hostname; query.size = strlen(log_rec->hostname); if (debug_mode) fprintf(stderr,"Checking %s...", log_rec->hostname); if ( (i=dns_db->get(dns_db, NULL, &query, &response, 0)) == 0) { memcpy(&alignedRecord, response.data, sizeof(struct dnsRecord)); strncpy (log_rec->hostname, ((struct dnsRecord *)response.data)->hostName, MAXHOST); log_rec->hostname[MAXHOST-1]=0; if (debug_mode) fprintf(stderr," found: %s (%ld)\n", log_rec->hostname, alignedRecord.timeStamp); } else /* not found or error occured during get */ { if (debug_mode) { if (i==DB_NOTFOUND) fprintf(stderr," not found\n"); else fprintf(stderr," error (%d)\n",i); } } } /*********************************************/ /* DNS_RESOLVER - read log and lookup IP's */ /*********************************************/ int dns_resolver(void *log_fp) { DNODEPTR h_entries; DNODEPTR l_list = NULL; int i; int save_verbose=verbose; u_int64_t listEntries = 0; struct sigaction sigPipeAction; struct stat dbStat; /* aligned dnsRecord to prevent Solaris from doing a dump */ /* (not found in debugger, as it can dereference it :( */ struct dnsRecord alignedRecord; struct flock tmp_flock; tmp_flock.l_whence=SEEK_SET; /* default flock fields */ tmp_flock.l_start=0; tmp_flock.l_len=0; tmp_flock.l_pid=0; time(&runtime); /* get processing start time */ start_time = time(NULL); /* minimal sanity check on it */ if(stat(dns_cache, &dbStat) < 0) { if(errno != ENOENT) { dns_cache=NULL; dns_db=NULL; return 0; /* disable cache */ } } else { if(!dbStat.st_size) /* bogus file, probably from a crash */ { unlink(dns_cache); /* remove it so we can recreate... */ } } /* open cache file */ if ( (db_create(&dns_db, NULL, 0) != 0) || (dns_db->open(dns_db, NULL, dns_cache, NULL, DB_HASH, DB_CREATE, 0644) != 0) ) { /* Error: Unable to open DNS cache file */ if (verbose) fprintf(stderr,"%s %s\n",msg_dns_nodb,dns_cache); dns_cache=NULL; dns_db=NULL; return 0; /* disable cache */ } /* get file descriptor */ dns_db->fd(dns_db, &dns_fd); tmp_flock.l_type=F_WRLCK; /* set read/write lock type */ if (fcntl(dns_fd,F_SETLK,&tmp_flock) < 0) /* and barf if we cant lock */ { /* Error: Unable to lock DNS cache file */ if (verbose) fprintf(stderr,"%s %s\n",msg_dns_nolk,dns_cache); dns_db->close(dns_db, 0); dns_cache=NULL; dns_db=NULL; return 0; /* disable cache */ } /* Setup signal handlers */ sigPipeAction.sa_handler = SIG_IGN; sigPipeAction.sa_flags = SA_RESTART; sigemptyset(&sigPipeAction.sa_mask); sigaction(SIGPIPE, &sigPipeAction, NULL); /* disable warnings/errors for this run... */ verbose=0; /* Main loop to read log records (either regular or zipped) */ while ( (gz_log)?(our_gzgets((void *)log_fp,buffer,BUFSIZE) != Z_NULL): (fgets(buffer,BUFSIZE,log_fname?(FILE *)log_fp:stdin) != NULL)) { if (strlen(buffer) == (BUFSIZE-1)) { /* get the rest of the record */ while ( (gz_log)?(our_gzgets((void *)log_fp,buffer,BUFSIZE)!=Z_NULL): (fgets(buffer,BUFSIZE,log_fname?(FILE *)log_fp:stdin)!=NULL)) { if (strlen(buffer) < BUFSIZE-1) break; } continue; /* go get next record if any */ } strcpy(tmp_buf, buffer); /* save buffer in case of error */ if(parse_record(buffer)) /* parse the record */ { struct addrinfo hints, *ares; memset(&hints, 0, sizeof(hints)); hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_STREAM; hints.ai_flags = AI_NUMERICHOST; if (0 == getaddrinfo(log_rec.hostname, "0", &hints, &ares)) { DBT q, r; memset(&q, 0, sizeof(q)); memset(&r, 0, sizeof(r)); q.data = log_rec.hostname; q.size = strlen(log_rec.hostname); /* Check if we have it in DB */ if ( (i=dns_db->get(dns_db, NULL, &q, &r, 0)) == 0 ) { /* have a record for this address */ memcpy(&alignedRecord, r.data, sizeof(struct dnsRecord)); if (alignedRecord.timeStamp != 0) /* If it's not permanent, check if it's TTL has expired */ if ( (runtime-alignedRecord.timeStamp ) > (86400*cache_ttl) ) put_dnode(log_rec.hostname, ares->ai_addr, ares->ai_addrlen, host_table); } else { if (i==DB_NOTFOUND) put_dnode(log_rec.hostname, ares->ai_addr, ares->ai_addrlen, host_table); } freeaddrinfo(ares); } } } verbose = save_verbose; /* restore verbosity level... */ listEntries = 0; /* build our linked list l_list */ for(i=0;i < MAXHASH; i++) { for(h_entries=host_table[i]; h_entries ; h_entries = h_entries->next) { h_entries->llist = l_list; l_list = h_entries; listEntries++; } } if(!l_list) { /* No valid addresses found... */ if (verbose>1) printf("%s\n",msg_dns_none); tmp_flock.l_type=F_UNLCK; fcntl(dns_fd, F_SETLK, &tmp_flock); dns_db->close(dns_db, 0); return 0; } /* process our list now... */ process_list(l_list); /* get processing end time */ end_time = time(NULL); /* display DNS processing statistics */ if (time_me || (verbose>1)) { if (verbose<2 && time_me) printf("DNS: "); printf("%llu %s ",listEntries, msg_addresses); /* total processing time in seconds */ temp_time = difftime(end_time,start_time); if (temp_time==0) temp_time=1; printf("%s %.0f %s", msg_in, temp_time, msg_seconds); /* calculate records per second */ if (temp_time) i=( (int)((float)listEntries/temp_time) ); else i=0; if ( (i>0) && (i<=listEntries) ) printf(", %d/sec\n", i); else printf("\n"); } /* processing done, exit */ tmp_flock.l_type=F_UNLCK; fcntl(dns_fd, F_SETLK, &tmp_flock); dns_db->close(dns_db, 0); return 0; } /*********************************************/ /* PROCESS_LIST - do the resoluton... */ /*********************************************/ static void process_list(DNODEPTR l_list) { DNODEPTR trav; char child_buf[MAXHOST+3-((unsigned long)&trav+sizeof(trav))%3]; char dns_buf[MAXHOST]; int i; int pid; int nof_children = 0; fd_set rd_set; char hbuf[NI_MAXHOST]; struct sigaction sigChildAction; sigChildAction.sa_handler = sigChild; sigChildAction.sa_flags = SA_NOCLDSTOP|SA_RESTART; sigemptyset(&sigChildAction.sa_mask); raiseSigChild = 0; sigaction(SIGCHLD, &sigChildAction, NULL); /* fire up our child processes */ for(i=0; i < dns_children; i++) { if(pipe(child[i].inpipe)) { if (verbose) fprintf(stderr,"INPIPE creation error"); return; /* exit(1) */ } if(pipe(child[i].outpipe)) { if (verbose) fprintf(stderr,"OUTPIPE creation error"); return; /* exit(1); */ } /* fork it off */ switch(pid=fork()) { case -1: { if (verbose) fprintf(stderr,"FORK error"); return; /* exit(1); */ } case 0: /* Child */ { int size; close(child[i].inpipe[0]); close(child[i].outpipe[1]); /* get struct sockaddr_storage here */ while((size = read(child[i].outpipe[0], child_buf, MAXHOST))) { if(size < 0) { perror("read error"); exit(1); } else { /* Clear out our buffer */ memset(hbuf,0,NI_MAXHOST); if(0 == getnameinfo((struct sockaddr*)child_buf, size, hbuf, sizeof(hbuf), NULL, 0, NI_NAMEREQD)) { /* must be at least 4 chars */ if (strlen(hbuf)>3) { /* If long hostname, take max domain name part */ if ((size = strlen(hbuf)) > MAXHOST-2) strcpy(child_buf,(hbuf+(size-MAXHOST+1))); else strcpy(child_buf, hbuf); size = strlen(child_buf); } else { if (debug_mode) printf("Child %d getnameinfo bad hbuf!\n",i); } } else { if(debug_mode) printf("Child %d getnameinfo failed!\n",i); } if (write(child[i].inpipe[1], child_buf, size) == -1) { perror("write error"); exit(1); } } } close(child[i].inpipe[1]); close(child[i].outpipe[0]); if(debug_mode) printf( "Child %d got closed input, shutting down\n", i); fflush(stdout); exit(0); } /* case 0 */ default: { child[i].pid = pid; child[i].flags = DNS_CHILD_READY|DNS_CHILD_RUNNING; nof_children++; close(child[i].inpipe[1]); close(child[i].outpipe[0]); set_fl(child[i].inpipe[0], O_NONBLOCK); } } } trav = l_list; while(nof_children) { static struct timeval selectTimeval; int res; int max_fd; FD_ZERO(&rd_set); max_fd = 0; if(raiseSigChild) { int pid; while((pid = waitpid(-1, NULL, WNOHANG)) > 0) { for(i=0;iaddr, trav->addrlen) != -1) { /* We will watch this child */ child[i].cur = trav; FD_SET(child[i].inpipe[0], &rd_set); max_fd = MAX(max_fd, child[i].inpipe[0]); if(debug_mode) printf("Giving %d bytes to Child %d\n", trav->addrlen, i); trav = trav->llist; } else /* write error */ { if(errno != EINTR) /* Could be a signal */ { perror("Could not write to pipe"); close(child[i].outpipe[1]); /* kill */ child[i].flags &= ~DNS_CHILD_RUNNING; /* child */ } } } else /* List is complete */ { close(child[i].outpipe[1]); /* Go away */ child[i].flags &= ~DNS_CHILD_RUNNING; /* Child is dead */ } } else { /* Look, the busy child... */ FD_SET(child[i].inpipe[0], &rd_set); max_fd = MAX(max_fd, child[i].inpipe[0]); } } } selectTimeval.tv_sec = 5; /* This stuff ticks in 5 second intervals */ selectTimeval.tv_usec = 0; switch(res = select(max_fd+1, &rd_set, NULL, NULL, &selectTimeval)) { case -1: { if(errno != EINTR) /* Could be a signal */ perror("Error in select"); break; } case 0: /* Timeout, just fall once through the child loop */ { if(debug_mode) printf("tick\n"); break; } default: { for(i=0; i< dns_children;i++) { if(!res) /* All file descriptors done */ break; if(FD_ISSET(child[i].inpipe[0], &rd_set)) { int size; res--; /* One less... */ switch (size=read(child[i].inpipe[0], dns_buf, MAXHOST)) { case -1: { if(errno != EINTR) perror("Could not read from pipe"); break; } case 0: { /* EOF. Child has closed Pipe. It shouldn't have */ /* done that, could be an error or something. */ /* Reap it */ close(child[i].outpipe[1]); child[i].flags &= ~DNS_CHILD_RUNNING; if(debug_mode) printf("Child %d wants to be reaped\n", i); break; } default: { dns_buf[size] = '\0'; if( strlen(dns_buf) > 1 && memcmp(dns_buf, &(child[i].cur->addr), sizeof(child[i].cur->addr))) { if(debug_mode) printf("Child %d Got a result: %s -> %s\n", i, child[i].cur->string, dns_buf); db_put(child[i].cur->string, dns_buf, 0); } else { if(debug_mode) printf("Child %d could not resolve: %s (%s)\n", i, child[i].cur->string, (cache_ips)?"cache":"no cache"); if (cache_ips) /* Cache non-resolved? */ db_put(child[i].cur->string, child[i].cur->string,1); } if(debug_mode) printf("Child %d back in task pool\n", i); /* Child is back in the task pool */ child[i].flags |= DNS_CHILD_READY; break; } } } } break; } } } return; } /*********************************************/ /* SET_FL - set flag on pipe FD */ /*********************************************/ void set_fl(int fd, int flags) { int val; /* get current flags */ if ((val=fcntl(fd, F_GETFL, 0)) < 0) if (verbose) fprintf(stderr,"set_fl F_GETFL error\n"); /* set them */ val |= flags; /* and write them back */ if ((val=fcntl(fd, F_SETFL, val)) < 0) if (verbose) fprintf(stderr,"set_fl F_SETFL error\n"); } /*********************************************/ /* CLR_FL - clear flag on pipe FD */ /*********************************************/ void clr_fl(int fd, int flags) { int val; /* Get current flags */ if ((val=fcntl(fd, F_GETFL, 0)) < 0) if (verbose) fprintf(stderr,"clr_fl F_GETFL error\n"); /* set them */ val &= ~flags; /* and write them back */ if ((val=fcntl(fd, F_SETFL, val)) < 0) if (verbose) fprintf(stderr,"clr_fl F_SETFL error\n"); } /*********************************************/ /* DB_PUT - put key/val in the cache db */ /*********************************************/ static void db_put(char *key, char *value, int numeric) { DBT k, v; char *cp; struct dnsRecord *recPtr = NULL; int nameLen = strlen(value)+1; /* Align to multiple of eight bytes */ int recSize = (sizeof(struct dnsRecord)+nameLen+7) & ~0x7; /* make sure we have a db ;) */ if(dns_db) { if((recPtr = calloc(1, recSize))) { recPtr->timeStamp = runtime; recPtr->numeric = numeric; memcpy(&recPtr->hostName, value, nameLen); memset(&k, 0, sizeof(k)); memset(&v, 0, sizeof(v)); /* Ensure all data is lowercase */ cp=key; while (*cp++!='\0') *cp=tolower(*cp); cp=value; while (*cp++!='\0') *cp=tolower(*cp); k.data = key; k.size = strlen(key); v.size = recSize; v.data = recPtr; if ( dns_db->put(dns_db, NULL, &k, &v, 0) != 0 ) if (verbose>1) fprintf(stderr,"db_put fail!\n"); free(recPtr); } } } /*********************************************/ /* SIGCHILD - raise our signal */ /*********************************************/ static void sigChild(int signum) { raiseSigChild++; } /*********************************************/ /* OPEN_CACHE - open our cache file RDONLY */ /*********************************************/ int open_cache() { struct stat dbStat; struct flock tmp_flock; tmp_flock.l_whence=SEEK_SET; /* default flock fields */ tmp_flock.l_start=0; tmp_flock.l_len=0; tmp_flock.l_pid=0; tmp_flock.l_type=F_RDLCK; /* double check filename was specified */ if(!dns_cache) { dns_db=NULL; return 0; } /* minimal sanity check on it */ if(stat(dns_cache, &dbStat) < 0) { if(errno != ENOENT) return 0; } else { if(!dbStat.st_size) /* bogus file, probably from a crash */ { unlink(dns_cache); /* remove it so we can recreate... */ } } /* open cache file */ if ( (db_create(&dns_db, NULL, 0) != 0) || (dns_db->open(dns_db, NULL, dns_cache, NULL, DB_HASH, DB_RDONLY, 0644) != 0) ) { /* Error: Unable to open DNS cache file */ if (verbose) fprintf(stderr,"%s %s\n",msg_dns_nodb,dns_cache); return 0; /* disable cache */ } /* get file descriptor */ dns_db->fd(dns_db, &dns_fd); /* Get shared lock on cache file */ if (fcntl(dns_fd, F_SETLK, &tmp_flock) < 0) { if (verbose) fprintf(stderr,"%s %s\n",msg_dns_nolk,dns_cache); dns_db->close(dns_db, 0); return 0; } return 1; } /*********************************************/ /* CLOSE_CACHE - close our RDONLY cache */ /*********************************************/ int close_cache() { struct flock tmp_flock; tmp_flock.l_whence=SEEK_SET; /* default flock fields */ tmp_flock.l_start=0; tmp_flock.l_len=0; tmp_flock.l_pid=0; tmp_flock.l_type=F_UNLCK; /* clear lock and close cache file */ fcntl(dns_fd, F_SETLK, &tmp_flock); dns_db->close(dns_db, 0); return 1; } /*********************************************/ /* GEODB_OPEN - Open GeoDB database/cursor */ /*********************************************/ DB *geodb_open(char *dbname) { char buf[1025]; if (dbname==NULL) snprintf(buf,sizeof(buf),"%s/GeoDB.dat",GEODB_LOC); else strncpy(buf,dbname,sizeof(buf)-1); buf[sizeof(buf)-1]='\0'; /* create database thingie */ if ( db_create(&geo_db, NULL, 0) ) return NULL; /* open the database */ if (geo_db->open(geo_db,NULL,buf,NULL,DB_BTREE,DB_RDONLY,0)) return NULL; /* create our cursor */ if (geo_db->cursor(geo_db,NULL,&geo_dbc,0)) { geo_db->close(geo_db,0); return NULL; } /* all is well in the world */ return geo_db; } /*********************************************/ /* GEODB_VER - Get database version info */ /*********************************************/ char *geodb_ver(DB *db, char *str) { int i; DBT k,v; unsigned char x[16]; memset(&x, 0, sizeof(x)); memset(&k, 0, sizeof(k)); memset(&v, 0, sizeof(v)); k.data=&x; k.size=sizeof(x); i=geo_db->get(geo_db, NULL, &k, &v, 0); if (i) strncpy(str, "Unknown", 8); else strncpy(str, v.data+3, v.size-3); return str; } /*********************************************/ /* GEODB_GET_CC - Get country code for IP */ /*********************************************/ char *geodb_get_cc(DB *db, char *ip, char *buf) { int i; DBT k,v; unsigned char addr[16]; memset(addr, 0, sizeof(addr)); strncpy(buf, "--", 3); /* get IP address */ if (!iptype(ip, addr)) return buf; /* kludge for IPv6 mapped IPv4 */ if (addr[0]==0 && addr[1]==0 && addr[2]==0) { addr[10]=0; addr[11]=0; } /* kludge for IPv6 6to4 (RFC3056) */ if (addr[0]==0x20 && addr[1]==0x02) { memcpy(&addr[12],&addr[2],4); memset(&addr,0,12); } memset(&k, 0, sizeof(k)); memset(&v, 0, sizeof(v)); k.data=&addr; k.size=sizeof(addr); i=geo_dbc->c_get(geo_dbc, &k, &v, DB_SET_RANGE); if (!i) memcpy(buf, v.data, 2); return buf; } /*********************************************/ /* GEODB_CLOSE - close GeoDB database */ /*********************************************/ void geodb_close(DB *db) { db->close(db,0); } /*********************************************/ /* IPTYPE - get IP type and format addr buf */ /*********************************************/ int iptype(char *ip, unsigned char *buf) { if (inet_pton(AF_INET6, ip, buf)>0) return 2; if (inet_pton(AF_INET, ip, buf+12)>0) return 1; else return 0; } #endif /* USE_DNS */ webalizer-2.23-05/dns_resolv.h0000644000175000017500000000252111032254167014600 0ustar bradbrad#ifndef _DNS_RESOLV_H #define _DNS_RESOLV_H #ifdef USE_DNS /* skip whole file if not using DNS stuff... */ struct dnsRecord { time_t timeStamp; /* Timestamp of resolv data */ int numeric; /* 0: Name, 1: IP-address */ char hostName[1]; }; /* Hostname (var length) */ struct dns_child /* Defines the communication with a DNS child */ { int inpipe[2]; /* Pipe Child -> Father */ int outpipe[2]; /* Pipe Father -> Child */ int pid; /* PID of Child */ int flags; /* see below */ struct dnode *cur; /* Currently processed node */ }; extern void resolve_dns(struct log_struct *); extern DB *dns_db; extern int dns_fd; extern int dns_resolver(void *); extern int open_cache(); extern int close_cache(); extern DB *geo_db; extern DB *geodb_open(char *); extern char *geodb_ver(DB *, char *); extern char *geodb_get_cc(DB *, char *, char *); extern void geodb_close(DB *); #define DNS_CHILD_READY 0x1 /* Our child flags */ #define DNS_CHILD_RUNNING 0x2 #define MAXCHILD 100 /* Maximum number of DNS children */ #ifndef GEODB_LOC #define GEODB_LOC "/usr/share/GeoDB" #endif #endif /* USE_DNS */ #endif /* _DNS_RESOLV_H */ webalizer-2.23-05/graphs.c0000644000175000017500000007473011510252672013714 0ustar bradbrad/* graphs.c - produces graphs used by the Webalizer Copyright (C) 1997-2011 Bradford L. Barrett This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version, and provided that the above copyright and permission notice is included with all distributed copies of this or derived software. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #include #include #include #include #include #include #include #include #include #include /* need socket header? */ #ifdef HAVE_SYS_SOCKET_H #include #endif #include "webalizer.h" #include "preserve.h" #include "lang.h" #include "graphs.h" /* Some systems don't define this */ #ifndef PI #define PI 3.14159265358979323846 #endif #define HITCOLOR hit_or_green /* graph color - hits */ #define FILECOLOR file_or_blue /* files */ #define SITECOLOR site_or_orange /* sites */ #define KBYTECOLOR kbyte_or_red /* KBytes */ #define PAGECOLOR page_or_cyan /* Files */ #define VISITCOLOR visit_or_yellow /* Visits */ /* shortcuts to convert ASCII hex color for gdImageColorAllocate() */ #define getred(s) (ashex2int((s[0] == '#')?s+1:s)) /* returns the red base-10 integer value from a html color */ #define getgreen(s) (ashex2int((s[0] == '#')?s+3:s+2)) /* returns the green base-10 integer value from a html color */ #define getblue(s) (ashex2int((s[0] == '#')?s+5:s+4)) /* returns the blue base-10 integer value from a html color */ #define CX 156 /* center x (for pie) */ #define CY 150 /* center y (chart) */ #define XRAD 240 /* X-axis radius */ #define YRAD 200 /* Y-axis radius */ /* forward reference internal routines */ void init_graph(char *, int, int); struct pie_data *calc_arc(float, float); int ashex2int(char *); /* common public declarations */ char *numchar[] = { " 0"," 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"}; gdImagePtr im; /* image buffer */ FILE *out; /* output file for PNG */ struct stat out_stat; /* stat struct for PNG */ char maxvaltxt[32]; /* graph values */ float percent; /* percent storage */ u_int64_t julday; /* julday value */ struct pie_data { int x; int y; /* line x,y */ int mx; int my; }; /* midpoint x,y */ /* colors */ int black, white, grey, dkgrey, kbyte_or_red, file_or_blue, site_or_orange, hit_or_green, page_or_cyan, visit_or_yellow, blue; /*****************************************************************/ /* */ /* YEAR_GRAPH6x - Year graph from array of hist_rec structs */ /* */ /*****************************************************************/ int year_graph6x(char *fname, char *title, struct hist_rec data[HISTSIZE]) { /* local variables */ int i,j,x1,y1,x2; int s_mth,s_year=0; float cw,cs,co,ci; u_int64_t maxval=1; double fmaxval=0.0; /* initalize the graph */ init_graph(title,512,256); /* init as 512 x 256 */ gdImageLine(im, 305,25,305,233,black); /* draw section lines */ gdImageLine(im, 304,25,304,233,white); gdImageLine(im, 305,130,490,130,black); gdImageLine(im, 305,129,490,129,white); /* index lines? */ if (graph_lines) { y1=210/(graph_lines+1); for (i=0;i28) { /* format the year string */ sprintf(maxvaltxt, "%04d", data[i].year); gdImageString(im,gdFontSmall,ci+((i-s_mth)*cs)+(j/2)-12, 236, (unsigned char *)maxvaltxt, black); } s_year=data[i].year; } } if (data[i].hit > maxval) maxval = data[i].hit; if (data[i].files > maxval) maxval = data[i].files; if (data[i].page > maxval) maxval = data[i].page; } if (maxval <= 0) maxval = 1; sprintf(maxvaltxt, "%llu", maxval); gdImageStringUp(im,gdFontSmall,6,26+(strlen(maxvaltxt)*6), (unsigned char *)maxvaltxt,black); /* hits */ for (i=s_mth; i2) gdImageRectangle(im, x1, y1, x2, 232, black); } /* files */ for (i=s_mth; i2) gdImageRectangle(im, x1, y1, x2, 232, black); } /* pages */ for (i=s_mth; i2) gdImageRectangle(im, x1, y1, x2, 232, black); } maxval=0; for (i=s_mth; i maxval) maxval = data[i].site; if (data[i].visit > maxval) maxval = data[i].visit; } if (maxval <= 0) maxval = 1; sprintf(maxvaltxt, "%llu", maxval); gdImageStringUp(im, gdFontSmall,493,26+(strlen(maxvaltxt)*6), (unsigned char *)maxvaltxt, black); cs = 180.0/graph_mths; cw = cs/2; co = (48/graph_mths<1)?1:48/graph_mths; ci = 308+((cw-co)/2); /* visits */ for (i=s_mth; i2) gdImageRectangle(im, x1, y1, x2, 127, black); } /* sites */ for (i=s_mth; i2) gdImageRectangle(im, x1, y1, x2, 127, black); } fmaxval=0.0; for (i=s_mth; i fmaxval) fmaxval = data[i].xfer; if (fmaxval <= 0.0) fmaxval = 1.0; sprintf(maxvaltxt, "%.0f", fmaxval); gdImageStringUp(im, gdFontSmall,493,130+(strlen(maxvaltxt)*6), (unsigned char *)maxvaltxt,black); cs = 180.0/graph_mths; cw = (cs/2)+(co/2); ci = 308+((cw-co)/2); /* xfer */ for (i=s_mth; i2) gdImageRectangle(im, x1, y1, x2, 232, black); } /* stat the file */ if ( !(lstat(fname, &out_stat)) ) { /* check if the file a symlink */ if ( S_ISLNK(out_stat.st_mode) ) { if (verbose) fprintf(stderr,"%s %s (symlink)\n",msg_no_open,fname); return(EBADF); } } /* save PNG image */ if ((out = fopen(fname, "wb")) != NULL) { gdImagePng(im, out); fclose(out); } /* deallocate memory */ gdImageDestroy(im); return (0); } /*****************************************************************/ /* */ /* MONTH_GRAPH6 - Month graph with six data sets */ /* */ /*****************************************************************/ #define YSIZE 400 int month_graph6( char *fname, /* filename */ char *title, /* graph title */ int month, /* graph month */ int year, /* graph year */ u_int64_t data1[31], /* data1 (hits) */ u_int64_t data2[31], /* data2 (files) */ u_int64_t data3[31], /* data3 (sites) */ double data4[31], /* data4 (kbytes) */ u_int64_t data5[31], /* data5 (views) */ u_int64_t data6[31]) /* data6 (visits) */ { /* local variables */ int i,j,s,x1,y1,x2; u_int64_t maxval=0; double fmaxval=0.0; /* calc julian date for month */ julday = (jdate(1, month,year) % 7); /* initalize the graph */ init_graph(title,512,400); gdImageLine(im, 21, 180, 490, 180, black); /* draw section lines */ gdImageLine(im, 21, 179, 490, 179, white); gdImageLine(im, 21, 280, 490, 280, black); gdImageLine(im, 21, 279, 490, 279, white); /* index lines? */ if (graph_lines) { y1=154/(graph_lines+1); for (i=0;i maxval) maxval = data1[i]; /* get max val */ if (data2[i] > maxval) maxval = data2[i]; if (data5[i] > maxval) maxval = data5[i]; } if (maxval <= 0) maxval = 1; sprintf(maxvaltxt, "%llu", maxval); gdImageStringUp(im, gdFontSmall,8,26+(strlen(maxvaltxt)*6), (unsigned char *)maxvaltxt,black); if (graph_legend) /* Print color coded legends? */ { /* Kbytes Legend */ gdImageStringUp(im,gdFontSmall,494,376, (unsigned char *)msg_h_xfer,dkgrey); gdImageStringUp(im,gdFontSmall,493,375, (unsigned char *)msg_h_xfer,KBYTECOLOR); /* Sites/Visits Legend */ i = (strlen(msg_h_sites)*6); gdImageStringUp(im,gdFontSmall,494,276, (unsigned char *)msg_h_sites,dkgrey); gdImageStringUp(im,gdFontSmall,493,275, (unsigned char *)msg_h_sites,SITECOLOR); gdImageStringUp(im,gdFontSmall,494,276-i-3,(unsigned char *)"/",dkgrey); gdImageStringUp(im,gdFontSmall,493,275-i-3,(unsigned char *)"/",black); gdImageStringUp(im,gdFontSmall,494,276-i-12, (unsigned char *)msg_h_visits,dkgrey); gdImageStringUp(im,gdFontSmall,493,275-i-12, (unsigned char *)msg_h_visits,VISITCOLOR); /* Pages/Files/Hits Legend */ s = ( i=(strlen(msg_h_pages)*6) )+ ( j=(strlen(msg_h_files)*6) )+ ( strlen(msg_h_hits)*6 )+ 52; gdImageStringUp(im,gdFontSmall,494,s, (unsigned char *)msg_h_pages,dkgrey); gdImageStringUp(im,gdFontSmall,493,s-1, (unsigned char *)msg_h_pages,PAGECOLOR); gdImageStringUp(im,gdFontSmall,494,s-i-3,(unsigned char *)"/",dkgrey); gdImageStringUp(im,gdFontSmall,493,s-i-4,(unsigned char *)"/",black); gdImageStringUp(im,gdFontSmall,494,s-i-12, (unsigned char *)msg_h_files,dkgrey); gdImageStringUp(im,gdFontSmall,493,s-i-13, (unsigned char *)msg_h_files,FILECOLOR); gdImageStringUp(im,gdFontSmall,494,s-i-j-15,(unsigned char *)"/",dkgrey); gdImageStringUp(im,gdFontSmall,493,s-i-j-16,(unsigned char *)"/",black); gdImageStringUp(im,gdFontSmall,494,s-i-j-24, (unsigned char *)msg_h_hits,dkgrey); gdImageStringUp(im,gdFontSmall,493,s-i-j-25, (unsigned char *)msg_h_hits,HITCOLOR); } /* data1 */ for (i=0; i<31; i++) { percent = ((float)data1[i] / (float)maxval); if (percent <= 0.0) continue; x1 = 25 + (i*15); x2 = x1 + 7; y1 = 176 - (percent * 147); gdImageFilledRectangle(im, x1, y1, x2, 176, HITCOLOR); gdImageRectangle(im, x1, y1, x2, 176, black); } /* data2 */ for (i=0; i<31; i++) { percent = ((float)data2[i] / (float)maxval); if (percent <= 0.0) continue; x1 = 27 + (i*15); x2 = x1 + 7; y1 = 176 - (percent * 147); gdImageFilledRectangle(im, x1, y1, x2, 176, FILECOLOR); gdImageRectangle(im, x1, y1, x2, 176, black); } /* data5 */ for (i=0; i<31; i++) { if (data5[i]==0) continue; percent = ((float)data5[i] / (float)maxval); if (percent <= 0.0) continue; x1 = 29 + (i*15); x2 = x1 + 7; y1 = 176 - (percent * 147); gdImageFilledRectangle(im, x1, y1, x2, 176, PAGECOLOR); gdImageRectangle(im, x1, y1, x2, 176, black); } /* sites / visits */ maxval=0; for (i=0; i<31; i++) { if (data3[i]>maxval) maxval = data3[i]; if (data6[i]>maxval) maxval = data6[i]; } if (maxval <= 0) maxval = 1; sprintf(maxvaltxt, "%llu", maxval); gdImageStringUp(im, gdFontSmall,8,180+(strlen(maxvaltxt)*6), (unsigned char *)maxvaltxt, black); /* data 6 */ for (i=0; i<31; i++) { percent = ((float)data6[i] / (float)maxval); if (percent <= 0.0) continue; x1 = 25 + (i*15); x2 = x1 + 8; y1 = 276 - (percent * 92); gdImageFilledRectangle(im, x1, y1, x2, 276, VISITCOLOR); gdImageRectangle(im, x1, y1, x2, 276, black); } /* data 3 */ for (i=0; i<31; i++) { percent = ((float)data3[i] / (float)maxval); if (percent <= 0.0) continue; x1 = 29 + (i*15); x2 = x1 + 7; y1 = 276 - (percent * 92); gdImageFilledRectangle(im, x1, y1, x2, 276, SITECOLOR); gdImageRectangle(im, x1, y1, x2, 276, black); } /* data4 */ fmaxval=0.0; for (i=0; i<31; i++) if (data4[i]>fmaxval) fmaxval = data4[i]; if (fmaxval <= 0.0) fmaxval = 1.0; sprintf(maxvaltxt, "%.0f", fmaxval/1024); gdImageStringUp(im, gdFontSmall,8,280+(strlen(maxvaltxt)*6), (unsigned char *)maxvaltxt, black); for (i=0; i<31; i++) { percent = data4[i] / fmaxval; if (percent <= 0.0) continue; x1 = 26 + (i*15); x2 = x1 + 10; y1 = 375 - ( percent * 91 ); gdImageFilledRectangle(im, x1, y1, x2, 375, KBYTECOLOR); gdImageRectangle(im, x1, y1, x2, 375, black); } /* stat the file */ if ( !(lstat(fname, &out_stat)) ) { /* check if the file a symlink */ if ( S_ISLNK(out_stat.st_mode) ) { if (verbose) fprintf(stderr,"%s %s (symlink)\n",msg_no_open,fname); return(EBADF); } } /* save PNG image */ if ((out = fopen(fname, "wb")) != NULL) { gdImagePng(im, out); fclose(out); } /* deallocate memory */ gdImageDestroy(im); return (0); } /*****************************************************************/ /* */ /* DAY_GRAPH3 - Day graph with three data sets */ /* */ /*****************************************************************/ int day_graph3( char *fname, char *title, u_int64_t data1[24], u_int64_t data2[24], u_int64_t data3[24]) { /* local variables */ int i,j,s,x1,y1,x2; u_int64_t maxval=0; /* initalize the graph */ init_graph(title,512,256); /* index lines? */ if (graph_lines) { y1=210/(graph_lines+1); for (i=0;i maxval) maxval = data1[i]; /* get max val */ if (data2[i] > maxval) maxval = data2[i]; if (data3[i] > maxval) maxval = data3[i]; } if (maxval <= 0) maxval = 1; sprintf(maxvaltxt, "%llu", maxval); gdImageStringUp(im, gdFontSmall, 8, 26+(strlen(maxvaltxt)*6), (unsigned char *)maxvaltxt, black); if (graph_legend) /* print color coded legends? */ { /* Pages/Files/Hits Legend */ s = ( i=(strlen(msg_h_pages)*6) )+ ( j=(strlen(msg_h_files)*6) )+ ( strlen(msg_h_hits)*6 )+ 52; gdImageStringUp(im,gdFontSmall,494,s, (unsigned char *)msg_h_pages,dkgrey); gdImageStringUp(im,gdFontSmall,493,s-1, (unsigned char *)msg_h_pages,PAGECOLOR); gdImageStringUp(im,gdFontSmall,494,s-i-3,(unsigned char *)"/",dkgrey); gdImageStringUp(im,gdFontSmall,493,s-i-4,(unsigned char *)"/",black); gdImageStringUp(im,gdFontSmall,494,s-i-12, (unsigned char *)msg_h_files,dkgrey); gdImageStringUp(im,gdFontSmall,493,s-i-13, (unsigned char *)msg_h_files,FILECOLOR); gdImageStringUp(im,gdFontSmall,494,s-i-j-15,(unsigned char *)"/",dkgrey); gdImageStringUp(im,gdFontSmall,493,s-i-j-16,(unsigned char *)"/",black); gdImageStringUp(im,gdFontSmall,494,s-i-j-24, (unsigned char *)msg_h_hits,dkgrey); gdImageStringUp(im,gdFontSmall,493,s-i-j-25, (unsigned char *)msg_h_hits,HITCOLOR); } /* data1 */ for (i=0; i<24; i++) { percent = ((float)data1[i] / (float)maxval); /* percent of 100% */ if (percent <= 0.0) continue; x1 = 29 + (i*19); x2 = x1 + 10; y1 = 232 - (percent * 203); gdImageFilledRectangle(im, x1, y1, x2, 232, HITCOLOR); gdImageRectangle(im, x1, y1, x2, 232, black); } /* data2 */ for (i=0; i<24; i++) { percent = ((float)data2[i] / (float)maxval); /* percent of 100% */ if (percent <= 0.0) continue; x1 = 32 + (i*19); x2 = x1 + 10; y1 = 232 - (percent * 203); gdImageFilledRectangle(im, x1, y1, x2, 232, FILECOLOR); gdImageRectangle(im, x1, y1, x2, 232, black); } /* data3 */ for (i=0; i<24; i++) { percent = ((float)data3[i] / (float)maxval); /* percent of 100% */ if (percent <= 0.0) continue; x1 = 35 + (i*19); x2 = x1 + 10; y1 = 232 - (percent * 203); gdImageFilledRectangle(im, x1, y1, x2, 232, PAGECOLOR); gdImageRectangle(im, x1, y1, x2, 232, black); } /* stat the file */ if ( !(lstat(fname, &out_stat)) ) { /* check if the file a symlink */ if ( S_ISLNK(out_stat.st_mode) ) { if (verbose) fprintf(stderr,"%s %s (symlink)\n",msg_no_open,fname); return(EBADF); } } /* save PNG image */ if ((out = fopen(fname, "wb")) != NULL) { gdImagePng(im, out); fclose(out); } /* deallocate memory */ gdImageDestroy(im); return (0); } /*****************************************************************/ /* */ /* PIE_CHART - draw a pie chart (10 data items max) */ /* */ /*****************************************************************/ int pie_chart(char *fname, char *title, u_int64_t t_val, u_int64_t data1[], char *legend[]) { int i,x,percent,y=47; double s_arc=0.0; int purple_or_pie1, ltgreen_or_pie2, ltpurple_or_pie3, brown_or_pie4; int r, g, b; char buffer[128]; struct pie_data gdata; /* init graph and colors */ init_graph(title,512,300); r=getred(pie_color1); g=getgreen(pie_color1); b=getblue(pie_color1); purple_or_pie1 = gdImageColorAllocate(im, r, g, b); r=getred(pie_color2); g=getgreen(pie_color2); b=getblue(pie_color2); ltgreen_or_pie2 = gdImageColorAllocate(im, r, g, b); r=getred(pie_color3); g=getgreen(pie_color3); b=getblue(pie_color3); ltpurple_or_pie3= gdImageColorAllocate(im, r, g, b); r=getred(pie_color4); g=getgreen(pie_color4); b=getblue(pie_color4); brown_or_pie4 = gdImageColorAllocate(im, r, g, b); /* do the circle... */ gdImageArc(im, CX, CY, XRAD, YRAD, 0, 360, black); gdImageArc(im, CX, CY+10, XRAD-2, YRAD-2, 2, 178, black); gdImageFillToBorder(im, CX, CY+(YRAD/2)+1, black, black); /* slice the pie */ gdata=*calc_arc(0.0,0.0); gdImageLine(im,CX,CY,gdata.x,gdata.y,black); /* inital line */ for (i=0;i<10;i++) /* run through data array */ { if ((data1[i]!=0)&&(s_arc<1.0)) /* make sure valid slice */ { percent=(((double)data1[i]/t_val)+0.005)*100.0; if (percent<1) break; if (s_arc+((double)percent/100.0)>=1.0) { gdata=*calc_arc(s_arc,1.0); s_arc=1.0; } else { gdata=*calc_arc(s_arc,s_arc+((double)percent/100.0)); s_arc+=(double)percent/100.0; } gdImageLine(im, CX, CY, gdata.x, gdata.y, black); gdImageFill(im, gdata.mx, gdata.my, i+5); snprintf(buffer,sizeof(buffer),"%s (%d%%)",legend[i], percent); x=480-(strlen(buffer)*7); gdImageString(im,gdFontMediumBold, x+1, y+1, (unsigned char *)buffer, black); gdImageString(im,gdFontMediumBold, x, y, (unsigned char *)buffer, i+5); y+=20; } } if (s_arc < 1.0) /* anything left over? */ { gdata=*calc_arc(s_arc,1.0); gdImageFill(im, gdata.mx, gdata.my, white); snprintf(buffer,sizeof(buffer),"%s (%d%%)", msg_h_other,100-(int)(s_arc*100)); x=480-(strlen(buffer)*7); gdImageString(im,gdFontMediumBold, x+1, y+1, (unsigned char *)buffer, black); gdImageString(im,gdFontMediumBold, x, y, (unsigned char *)buffer, white); } /* stat the file */ if ( !(lstat(fname, &out_stat)) ) { /* check if the file a symlink */ if ( S_ISLNK(out_stat.st_mode) ) { if (verbose) fprintf(stderr,"%s %s (symlink)\n",msg_no_open,fname); return(EBADF); } } /* save PNG image */ if ((out = fopen(fname, "wb")) != NULL) { gdImagePng(im, out); fclose(out); } /* deallocate memory */ gdImageDestroy(im); return (0); } /*****************************************************************/ /* */ /* CALC_ARC - generate x,y coordinates for pie chart */ /* */ /*****************************************************************/ struct pie_data *calc_arc(float min, float max) { static struct pie_data data; double d; /* Calculate max line */ d=max; data.x=cos(d*(2*PI))*((XRAD-2)/2)+CX; data.y=sin(d*(2*PI))*((YRAD-2)/2)+CY; /* Now get mid-point */ d=((min+max)/2); data.mx=cos(d*(2*PI))*(XRAD/3)+CX; data.my=sin(d*(2*PI))*(YRAD/3)+CY; return &data; } /*****************************************************************/ /* */ /* INIT_GRAPH - initalize graph and draw borders */ /* */ /*****************************************************************/ void init_graph(char *title, int xsize, int ysize) { int i, r, g, b; im = gdImageCreate(xsize,ysize); /* allocate color maps, background color first (grey) */ grey = gdImageColorAllocate(im, 192, 192, 192); dkgrey = gdImageColorAllocate(im, 128, 128, 128); black = gdImageColorAllocate(im, 0, 0, 0); white = gdImageColorAllocate(im, 255, 255, 255); blue = gdImageColorAllocate(im, 0, 0, 255); r=getred(hit_color); g=getgreen(hit_color); b=getblue(hit_color); hit_or_green = gdImageColorAllocate(im, r, g, b); r=getred(site_color); g=getgreen(site_color); b=getblue(site_color); site_or_orange = gdImageColorAllocate(im, r, g, b); r=getred(file_color); g=getgreen(file_color); b=getblue(file_color); file_or_blue = gdImageColorAllocate(im, r, g, b); r=getred(kbyte_color); g=getgreen(kbyte_color); b=getblue(kbyte_color); kbyte_or_red = gdImageColorAllocate(im, r, g, b); r=getred(page_color); g=getgreen(page_color); b=getblue(page_color); page_or_cyan = gdImageColorAllocate(im, r, g, b); r=getred(visit_color); g=getgreen(visit_color); b=getblue(visit_color); visit_or_yellow = gdImageColorAllocate(im, r, g, b); /* black outside border */ gdImageRectangle(im, 0, 0, xsize-1, ysize-1, black); /* do shadow effect (bevel) border */ for (i=1; i<5 ;i++) { gdImageLine(im, i, i, xsize-i-2, i, white); gdImageLine(im, i, i, i, ysize-i-2, white); gdImageLine(im, i+1, ysize-i-1, xsize-i-1, ysize-i-1, dkgrey); gdImageLine(im, xsize-i-1, i+1, xsize-i-1, ysize-i-1, dkgrey); } /* generic inside shadow box */ gdImageRectangle(im, 20, 25, xsize-21, ysize-21, black); gdImageRectangle(im, 19, 24, xsize-22, ysize-22, white); /* display the graph title */ gdImageString(im, gdFontMediumBold, 20, 8, (unsigned char *)title, blue); return; } /****************************************************************/ /* */ /* ASHEX2INT - ASCII HEX TO INT CONVERTER */ /* */ /****************************************************************/ int ashex2int(char *str) { /* returns base-10 integer value from a 2 ASCII hex number */ return from_hex(str[1])+(from_hex(str[0])*16); } webalizer-2.23-05/graphs.h0000644000175000017500000000063611020476106013707 0ustar bradbrad#ifndef _GRAPHS_H #define _GRAPHS_H extern int month_graph6(char *, char *, int, int, u_int64_t *, u_int64_t *, u_int64_t *, double *, u_int64_t *, u_int64_t *); extern int year_graph6x(char *, char *, struct hist_rec *); extern int day_graph3(char *, char *, u_int64_t *, u_int64_t *, u_int64_t *); extern int pie_chart(char *, char *, u_int64_t, u_int64_t *, char **); #endif /* _GRAPHS_H */ webalizer-2.23-05/hashtab.c0000644000175000017500000007641011512462505014037 0ustar bradbrad/* webalizer - a web server log analysis program Copyright (C) 1997-2011 Bradford L. Barrett This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version, and provided that the above copyright and permission notice is included with all distributed copies of this or derived software. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ /*********************************************/ /* STANDARD INCLUDES */ /*********************************************/ #include #include #include #include #include /* normal stuff */ #include #include /* ensure sys/types */ #ifndef _SYS_TYPES_H #include #endif /* some need for uint* */ #ifdef HAVE_STDINT_H #include #endif /* need socket header? */ #ifdef HAVE_SYS_SOCKET_H #include #endif /* some systems need this */ #ifdef HAVE_MATH_H #include #endif #include "webalizer.h" /* main header */ #include "lang.h" #include "linklist.h" #include "hashtab.h" /* internal function prototypes */ HNODEPTR new_hnode(char *); /* new host node */ UNODEPTR new_unode(char *); /* new url node */ RNODEPTR new_rnode(char *); /* new referrer node */ ANODEPTR new_anode(char *); /* new user agent node */ SNODEPTR new_snode(char *); /* new search string.. */ INODEPTR new_inode(char *); /* new ident node */ #ifdef USE_DNS DNODEPTR new_dnode(char *); /* new DNS node */ #endif /* USE_DNS */ void update_entry(char *); /* update entry/exit */ void update_exit(char *); /* page totals */ unsigned int hash(char *); /* hash function */ /* local data */ HNODEPTR sm_htab[MAXHASH]; /* hash tables */ HNODEPTR sd_htab[MAXHASH]; UNODEPTR um_htab[MAXHASH]; /* for hits, sites, */ RNODEPTR rm_htab[MAXHASH]; /* referrers and agents... */ ANODEPTR am_htab[MAXHASH]; SNODEPTR sr_htab[MAXHASH]; /* search string table */ INODEPTR im_htab[MAXHASH]; /* ident table (username) */ #ifdef USE_DNS DNODEPTR host_table[MAXHASH]; /* DNS hash table */ #endif /* USE_DNS */ /* Last node pointers */ HNODEPTR lm_hnode=NULL; HNODEPTR ld_hnode=NULL; RNODEPTR l_rnode=NULL; /*********************************************/ /* DEL_HTABS - clear out our hash tables */ /*********************************************/ void del_htabs() { del_hlist(sd_htab); /* Clear out our various */ del_ulist(um_htab); /* hash tables here by */ del_hlist(sm_htab); /* calling the appropriate */ del_rlist(rm_htab); /* del_* fuction for each */ del_alist(am_htab); del_slist(sr_htab); del_ilist(im_htab); #ifdef USE_DNS /* del_dlist(host_table); */ /* delete DNS hash table */ #endif /* USE_DNS */ } /*********************************************/ /* NEW_HNODE - create host node */ /*********************************************/ HNODEPTR new_hnode(char *str) { HNODEPTR newptr; char *sptr; if (strlen(str) >= MAXHOST) { if (verbose) { fprintf(stderr,"[new_hnode] %s (%d)",msg_big_one,strlen(str)); if (debug_mode) fprintf(stderr,":\n--> %s",str); fprintf(stderr,"\n"); } str[MAXHOST-1]=0; } if ( (sptr=malloc(strlen(str)+1))==NULL ) return (HNODEPTR)NULL; strcpy(sptr,str); if (( newptr = malloc(sizeof(struct hnode))) != NULL) { newptr->string =sptr; newptr->visit =0; newptr->tstamp =0; newptr->lasturl =blank_str; } else free(sptr); return newptr; } /*********************************************/ /* PUT_HNODE - insert/update host node */ /*********************************************/ int put_hnode( char *str, /* Hostname */ int type, /* obj type */ u_int64_t count, /* hit count */ u_int64_t file, /* File flag */ double xfer, /* xfer size */ u_int64_t *ctr, /* counter */ u_int64_t visit, /* visits */ u_int64_t tstamp,/* timestamp */ char *lasturl, /* lasturl */ HNODEPTR *htab) /* ptr>next */ { HNODEPTR cptr,nptr; unsigned int hval; /* check if hashed */ hval=hash(str); if ( (cptr = htab[hval]) == NULL) { /* not hashed */ if ( (nptr=new_hnode(str)) != NULL) { if (htab==sm_htab) lm_hnode=nptr; else ld_hnode=nptr; nptr->flag = type; nptr->count = count; nptr->files = file; nptr->xfer = xfer; nptr->next = NULL; htab[hval] = nptr; if (type!=OBJ_GRP) (*ctr)++; if (visit) { nptr->visit=(visit-1); nptr->lasturl=find_url(lasturl); nptr->tstamp=tstamp; return 0; } else { if (ispage(log_rec.url)) { if (htab==sm_htab) update_entry(log_rec.url); nptr->lasturl=find_url(log_rec.url); nptr->tstamp=tstamp; nptr->visit=1; } } } } else { /* hashed (SPEEDUP) */ if (htab==sm_htab) { if (lm_hnode!=NULL && strcmp(lm_hnode->string,str)==0) cptr=lm_hnode; } else { if (ld_hnode!=NULL && strcmp(ld_hnode->string,str)==0) cptr=ld_hnode; } while (cptr != NULL) { if (strcmp(cptr->string,str)==0) { if ((type==cptr->flag)||((type!=OBJ_GRP)&&(cptr->flag!=OBJ_GRP))) { /* found... bump counter */ cptr->count+=count; cptr->files+=file; cptr->xfer +=xfer; if (ispage(log_rec.url)) { if ((tstamp-cptr->tstamp)>=visit_timeout) { cptr->visit++; if (htab==sm_htab) { update_exit(cptr->lasturl); update_entry(log_rec.url); } } cptr->lasturl=find_url(log_rec.url); cptr->tstamp=tstamp; } if (htab==sm_htab) lm_hnode=cptr; else ld_hnode=cptr; return 0; } } cptr = cptr->next; } /* not found... */ if ( (nptr = new_hnode(str)) != NULL) { if (htab==sm_htab) lm_hnode=nptr; else ld_hnode=nptr; nptr->flag = type; nptr->count = count; nptr->files = file; nptr->xfer = xfer; nptr->next = htab[hval]; htab[hval]=nptr; if (type!=OBJ_GRP) (*ctr)++; if (visit) { nptr->visit = (visit-1); nptr->lasturl=find_url(lasturl); nptr->tstamp= tstamp; return 0; } else { if (ispage(log_rec.url)) { if (htab==sm_htab) update_entry(log_rec.url); nptr->lasturl=find_url(log_rec.url); nptr->tstamp= tstamp; nptr->visit=1; } } } } if (nptr!=NULL) { /* set object type */ if (type==OBJ_GRP) nptr->flag=OBJ_GRP; /* is it a grouping? */ else { /* check if it's a hidden object */ if ((hide_sites)||(isinlist(hidden_sites,nptr->string)!=NULL)) nptr->flag=OBJ_HIDE; if (htab==sm_htab) lm_hnode=nptr; else ld_hnode=nptr; } } return nptr==NULL; } /*********************************************/ /* DEL_HLIST - delete host hash table */ /*********************************************/ void del_hlist(HNODEPTR *htab) { /* free memory used by hash table */ HNODEPTR aptr,temp; int i; for (i=0;inext; free (aptr->string); /* free hostname string space */ free (aptr); /* free hostname structure */ aptr = temp; } htab[i]=NULL; } } lm_hnode=NULL; ld_hnode=NULL; } /*********************************************/ /* NEW_UNODE - URL node creation */ /*********************************************/ UNODEPTR new_unode(char *str) { UNODEPTR newptr; char *sptr; if (strlen(str) >= MAXURLH) { if (verbose) { fprintf(stderr,"[new_unode] %s (%d)",msg_big_one,strlen(str)); if (debug_mode) fprintf(stderr,":\n--> %s",str); fprintf(stderr,"\n"); } str[MAXURLH-1]=0; } if ( (sptr=malloc(strlen(str)+1))==NULL) return (UNODEPTR)NULL; strcpy(sptr,str); if (( newptr = malloc(sizeof(struct unode))) != NULL) { newptr->string=sptr; newptr->count = 0; newptr->flag = OBJ_REG; } else free(sptr); return newptr; } /*********************************************/ /* PUT_UNODE - insert/update URL node */ /*********************************************/ int put_unode(char *str, int type, u_int64_t count, double xfer, u_int64_t *ctr, u_int64_t entry, u_int64_t exit, UNODEPTR *htab) { UNODEPTR cptr,nptr; unsigned int hval; if (str[0]=='-') return 0; hval = hash(str); /* check if hashed */ if ( (cptr = htab[hval]) == NULL) { /* not hashed */ if ( (nptr=new_unode(str)) != NULL) { nptr->flag = type; nptr->count= count; nptr->xfer = xfer; nptr->next = NULL; nptr->entry= entry; nptr->exit = exit; htab[hval] = nptr; if (type!=OBJ_GRP) (*ctr)++; } } else { /* hashed */ while (cptr != NULL) { if (strcmp(cptr->string,str)==0) { if ((type==cptr->flag)||((type!=OBJ_GRP)&&(cptr->flag!=OBJ_GRP))) { /* found... bump counter */ cptr->count+=count; cptr->xfer += xfer; return 0; } } cptr = cptr->next; } /* not found... */ if ( (nptr = new_unode(str)) != NULL) { nptr->flag = type; nptr->count= count; nptr->xfer = xfer; nptr->next = htab[hval]; nptr->entry= entry; nptr->exit = exit; htab[hval] = nptr; if (type!=OBJ_GRP) (*ctr)++; } } if (nptr!=NULL) { if (type==OBJ_GRP) nptr->flag=OBJ_GRP; else if (isinlist(hidden_urls,nptr->string)!=NULL) nptr->flag=OBJ_HIDE; } return nptr==NULL; } /*********************************************/ /* DEL_ULIST - delete URL hash table */ /*********************************************/ void del_ulist(UNODEPTR *htab) { /* free memory used by hash table */ UNODEPTR aptr,temp; int i; for (i=0;inext; free (aptr->string); /* free up URL string memory */ free (aptr); /* free up URL struct node */ aptr = temp; } htab[i]=NULL; } } } /*********************************************/ /* NEW_RNODE - Referrer node creation */ /*********************************************/ RNODEPTR new_rnode(char *str) { RNODEPTR newptr; char *sptr; if (strlen(str) >= MAXREFH) { if (verbose) { fprintf(stderr,"[new_rnode] %s (%d)",msg_big_one,strlen(str)); if (debug_mode) fprintf(stderr,":\n--> %s",str); fprintf(stderr,"\n"); } str[MAXREFH-1]=0; } if ( (sptr=malloc(strlen(str)+1))==NULL ) return (RNODEPTR)NULL; strcpy(sptr,str); if (( newptr = malloc(sizeof(struct rnode))) != NULL) { newptr->string= sptr; newptr->count = 1; newptr->flag = OBJ_REG; } else free(sptr); return newptr; } /*********************************************/ /* PUT_RNODE - insert/update referrer node */ /*********************************************/ int put_rnode(char *str, int type, u_int64_t count, u_int64_t *ctr, RNODEPTR *htab) { RNODEPTR cptr,nptr; unsigned int hval; if (str[0]=='-') strcpy(str,"- (Direct Request)"); hval = hash(str); /* check if hashed */ if ( (cptr = htab[hval]) == NULL) { /* not hashed */ if ( (nptr=new_rnode(str)) != NULL) { nptr->flag = type; nptr->count = count; nptr->next = NULL; htab[hval] = nptr; if (type!=OBJ_GRP) (*ctr)++; } } else { /* hashed (SPEEDUP) */ if (l_rnode!=NULL && strcmp(l_rnode->string,str)==0) cptr=l_rnode; while (cptr != NULL) { if (strcmp(cptr->string,str)==0) { if ((type==cptr->flag)||((type!=OBJ_GRP)&&(cptr->flag!=OBJ_GRP))) { /* found... bump counter */ cptr->count+=count; return 0; } } cptr = cptr->next; } /* not found... */ if ( (nptr = new_rnode(str)) != NULL) { nptr->flag = type; nptr->count = count; nptr->next = htab[hval]; htab[hval] = nptr; if (type!=OBJ_GRP) (*ctr)++; } } if (nptr!=NULL) { if (type==OBJ_GRP) nptr->flag=OBJ_GRP; else if (isinlist(hidden_refs,nptr->string)!=NULL) nptr->flag=OBJ_HIDE; l_rnode=nptr; } return nptr==NULL; } /*********************************************/ /* DEL_RLIST - delete referrer hash table */ /*********************************************/ void del_rlist(RNODEPTR *htab) { /* free memory used by hash table */ RNODEPTR aptr,temp; int i; for (i=0;inext; free (aptr->string); free (aptr); aptr = temp; } htab[i]=NULL; } } l_rnode=NULL; } /*********************************************/ /* NEW_ANODE - User Agent node creation */ /*********************************************/ ANODEPTR new_anode(char *str) { ANODEPTR newptr; char *sptr; if (strlen(str) >= MAXAGENT) { if (verbose) { fprintf(stderr,"[new_anode] %s (%d)",msg_big_one,strlen(str)); if (debug_mode) fprintf(stderr,":\n--> %s",str); fprintf(stderr,"\n"); } str[MAXAGENT-1]=0; } if ( (sptr=malloc(strlen(str)+1))==NULL ) return (ANODEPTR)NULL; strcpy(sptr,str); if (( newptr = malloc(sizeof(struct anode))) != NULL) { newptr->string= sptr; newptr->count = 1; newptr->flag = OBJ_REG; } else free(sptr); return newptr; } /*********************************************/ /* PUT_ANODE - insert/update user agent node */ /*********************************************/ int put_anode(char *str, int type, u_int64_t count, u_int64_t *ctr, ANODEPTR *htab) { ANODEPTR cptr,nptr; unsigned int hval; if (str[0]=='-') return 0; /* skip bad user agents */ hval = hash(str); /* check if hashed */ if ( (cptr = htab[hval]) == NULL) { /* not hashed */ if ( (nptr=new_anode(str)) != NULL) { nptr->flag = type; nptr->count= count; nptr->next = NULL; htab[hval] = nptr; if (type!=OBJ_GRP) (*ctr)++; } } else { /* hashed */ while (cptr != NULL) { if (strcmp(cptr->string,str)==0) { if ((type==cptr->flag)||((type!=OBJ_GRP)&&(cptr->flag!=OBJ_GRP))) { /* found... bump counter */ cptr->count+=count; return 0; } } cptr = cptr->next; } /* not found... */ if ( (nptr = new_anode(str)) != NULL) { nptr->flag = type; nptr->count = count; nptr->next = htab[hval]; htab[hval] = nptr; if (type!=OBJ_GRP) (*ctr)++; } } if (type==OBJ_GRP) nptr->flag=OBJ_GRP; else if (isinlist(hidden_agents,nptr->string)!=NULL) nptr->flag=OBJ_HIDE; return nptr==NULL; } /*********************************************/ /* DEL_ALIST - delete user agent hash table */ /*********************************************/ void del_alist(ANODEPTR *htab) { /* free memory used by hash table */ ANODEPTR aptr,temp; int i; for (i=0;inext; free (aptr->string); free (aptr); aptr = temp; } htab[i]=NULL; } } } /*********************************************/ /* NEW_SNODE - Search str node creation */ /*********************************************/ SNODEPTR new_snode(char *str) { SNODEPTR newptr; char *sptr; if (strlen(str) >= MAXSRCHH) { if (verbose) { fprintf(stderr,"[new_snode] %s (%d)",msg_big_one,strlen(str)); if (debug_mode) fprintf(stderr,":\n--> %s",str); fprintf(stderr,"\n"); } str[MAXSRCHH-1]=0; } if ( (sptr=malloc(strlen(str)+1))==NULL ) return (SNODEPTR)NULL; strcpy(sptr,str); if (( newptr = malloc(sizeof(struct snode))) != NULL) { newptr->string= sptr; newptr->count = 1; } else free(sptr); return newptr; } /*********************************************/ /* PUT_SNODE - insert/update search str node */ /*********************************************/ int put_snode(char *str, u_int64_t count, SNODEPTR *htab) { SNODEPTR cptr,nptr; unsigned int hval; if (str[0]==0 || str[0]==' ') return 0; /* skip bad search strs */ hval=hash(str); /* check if hashed */ if ( (cptr = htab[hval]) == NULL) { /* not hashed */ if ( (nptr=new_snode(str)) != NULL) { nptr->count = count; nptr->next = NULL; htab[hval] = nptr; } } else { /* hashed */ while (cptr != NULL) { if (strcmp(cptr->string,str)==0) { /* found... bump counter */ cptr->count+=count; return 0; } cptr = cptr->next; } /* not found... */ if ( (nptr = new_snode(str)) != NULL) { nptr->count = count; nptr->next = htab[hval]; htab[hval] = nptr; } } return nptr==NULL; } /*********************************************/ /* DEL_SLIST - delete search str hash table */ /*********************************************/ void del_slist(SNODEPTR *htab) { /* free memory used by hash table */ SNODEPTR aptr,temp; int i; for (i=0;inext; free (aptr->string); free (aptr); aptr = temp; } htab[i]=NULL; } } } /*********************************************/ /* NEW_INODE - create ident (username) node */ /*********************************************/ INODEPTR new_inode(char *str) { INODEPTR newptr; char *sptr; if (strlen(str) >= MAXIDENT) { if (verbose) { fprintf(stderr,"[new_inode] %s (%d)",msg_big_one,strlen(str)); if (debug_mode) fprintf(stderr,":\n--> %s",str); fprintf(stderr,"\n"); } str[MAXIDENT-1]=0; } if ( (sptr=malloc(strlen(str)+1))==NULL ) return (INODEPTR)NULL; strcpy(sptr,str); if (( newptr = malloc(sizeof(struct inode))) != NULL) { newptr->string =sptr; newptr->visit =1; newptr->tstamp =0; } else free(sptr); return newptr; } /*********************************************/ /* PUT_INODE - insert/update ident node */ /*********************************************/ int put_inode( char *str, /* ident str */ int type, /* obj type */ u_int64_t count, /* hit count */ u_int64_t file, /* File flag */ double xfer, /* xfer size */ u_int64_t *ctr, /* counter */ u_int64_t visit, /* visits */ u_int64_t tstamp,/* timestamp */ INODEPTR *htab) /* hashtable */ { INODEPTR cptr,nptr; unsigned int hval; if ((str[0]=='-') || (str[0]==0)) return 0; /* skip if no username */ hval = hash(str); /* check if hashed */ if ( (cptr = htab[hval]) == NULL) { /* not hashed */ if ( (nptr=new_inode(str)) != NULL) { nptr->flag = type; nptr->count = count; nptr->files = file; nptr->xfer = xfer; nptr->next = NULL; htab[hval] = nptr; if (type!=OBJ_GRP) (*ctr)++; if (visit) { nptr->visit=(visit-1); nptr->tstamp=tstamp; return 0; } else { if (ispage(log_rec.url)) nptr->tstamp=tstamp; } } } else { /* hashed */ while (cptr != NULL) { if (strcmp(cptr->string,str)==0) { if ((type==cptr->flag)||((type!=OBJ_GRP)&&(cptr->flag!=OBJ_GRP))) { /* found... bump counter */ cptr->count+=count; cptr->files+=file; cptr->xfer +=xfer; if (ispage(log_rec.url)) { if ((tstamp-cptr->tstamp)>=visit_timeout) cptr->visit++; cptr->tstamp=tstamp; } return 0; } } cptr = cptr->next; } /* not found... */ if ( (nptr = new_inode(str)) != NULL) { nptr->flag = type; nptr->count = count; nptr->files = file; nptr->xfer = xfer; nptr->next = htab[hval]; htab[hval] = nptr; if (type!=OBJ_GRP) (*ctr)++; if (visit) { nptr->visit = (visit-1); nptr->tstamp= tstamp; return 0; } else { if (ispage(log_rec.url)) nptr->tstamp= tstamp; } } } if (nptr!=NULL) { /* set object type */ if (type==OBJ_GRP) nptr->flag=OBJ_GRP; /* is it a grouping? */ else { /* check if it's a hidden object */ if (isinlist(hidden_users,nptr->string)!=NULL) nptr->flag=OBJ_HIDE; } } return nptr==NULL; } /*********************************************/ /* DEL_ILIST - delete ident hash table */ /*********************************************/ void del_ilist(INODEPTR *htab) { /* free memory used by hash table */ INODEPTR aptr,temp; int i; for (i=0;inext; free (aptr->string); /* free ident string space */ free (aptr); /* free ident structure */ aptr = temp; } htab[i]=NULL; } } } #ifdef USE_DNS /* only add these for DNS */ /*********************************************/ /* NEW_DNODE - DNS resolver node creation */ /*********************************************/ DNODEPTR new_dnode(char *str) { DNODEPTR newptr; char *sptr; if (strlen(str) >= MAXHOST) { if (verbose) { fprintf(stderr,"[new_dnode] %s (%d)",msg_big_one,strlen(str)); if (debug_mode) fprintf(stderr,":\n--> %s",str); fprintf(stderr,"\n"); } str[MAXHOST-1]=0; } if ( (sptr=malloc(strlen(str)+1))==NULL ) return (DNODEPTR)NULL; strcpy(sptr,str); if (( newptr = malloc(sizeof(struct dnode))) != NULL) { newptr->string= sptr; } else free(sptr); return newptr; } /*********************************************/ /* PUT_DNODE - insert/update dns host node */ /*********************************************/ int put_dnode(char *str, void *addr, int len, DNODEPTR *htab) { DNODEPTR cptr,nptr; unsigned int hval; if (str[0]==0 || str[0]==' ') return 0; /* skip bad hostnames */ hval = hash(str); /* check if hashed */ if ( (cptr = htab[hval]) == NULL) { /* not hashed */ if ( (nptr=new_dnode(str)) != NULL) { if (addr) memcpy(&nptr->addr, addr, len); else memset(&nptr->addr, 0, sizeof(struct sockaddr_storage)); nptr->addrlen = len; nptr->next = NULL; htab[hval] = nptr; } } else { /* hashed */ while (cptr != NULL) { if (strcmp(cptr->string,str)==0) return 0; cptr = cptr->next; } /* not found... */ if ( (nptr = new_dnode(str)) != NULL) { if (addr) memcpy(&nptr->addr, addr, len); else memset(&nptr->addr, 0, sizeof(struct sockaddr_storage)); nptr->addrlen = len; nptr->next = htab[hval]; htab[hval] = nptr; } } return nptr==NULL; } /*********************************************/ /* DEL_DLIST - delete dns hash table */ /*********************************************/ void del_dlist(DNODEPTR *htab) { /* free memory used by hash table */ DNODEPTR dptr,temp; int i; for (i=0;inext; free (dptr->string); free (dptr); dptr = temp; } htab[i]=NULL; } } } #endif /* USE_DNS */ /*********************************************/ /* FIND_URL - Find URL in hash table */ /*********************************************/ char *find_url(char *str) { UNODEPTR cptr; if ( (cptr=um_htab[hash(str)]) != NULL) { while (cptr != NULL) { if (strcmp(cptr->string,str)==0) return cptr->string; cptr = cptr->next; } } return blank_str; /* shouldn't get here */ } /*********************************************/ /* UPDATE_ENTRY - update entry page total */ /*********************************************/ void update_entry(char *str) { UNODEPTR uptr; if (str==NULL) return; if ( (uptr = um_htab[hash(str)]) == NULL) return; else { while (uptr != NULL) { if (strcmp(uptr->string,str)==0) { if (uptr->flag!=OBJ_GRP) { uptr->entry++; return; } } uptr=uptr->next; } } } /*********************************************/ /* UPDATE_EXIT - update exit page total */ /*********************************************/ void update_exit(char *str) { UNODEPTR uptr; if (str==NULL) return; if ( (uptr = um_htab[hash(str)]) == NULL) return; else { while (uptr != NULL) { if (strcmp(uptr->string,str)==0) { if (uptr->flag!=OBJ_GRP) { uptr->exit++; return; } } uptr=uptr->next; } } } /*********************************************/ /* MONTH_UPDATE_EXIT - eom exit page update */ /*********************************************/ void month_update_exit(u_int64_t tstamp) { HNODEPTR nptr; int i; for (i=0;iflag!=OBJ_GRP) { if ((tstamp-nptr->tstamp)>=visit_timeout) update_exit(nptr->lasturl); } nptr=nptr->next; } } } /*********************************************/ /* TOT_VISIT - calculate total visits */ /*********************************************/ u_int64_t tot_visit(HNODEPTR *list) { HNODEPTR hptr; u_int64_t tot=0; int i; for (i=0;iflag!=OBJ_GRP) tot+=hptr->visit; hptr=hptr->next; } } return tot; } #ifdef USE_OLDHASH /*********************************************/ /* HASH - return hash value for string */ /*********************************************/ unsigned int hash(char *str) { uint32_t hashval=0; for (hashval = 0; *str != '\0'; str++) hashval = *str + (hashval << 5) - hashval; return hashval % MAXHASH; } #else /* USE_OLDHASH */ /*********************************************/ /* HASH (SuperFastHash by Paul Hsieh) */ /*********************************************/ #undef get16bits #if (defined(__GNUC__) && defined(__i386__)) || defined(__WATCOMC__) \ || defined(_MSC_VER) || defined (__BORLANDC__) || defined (__TURBOC__) #define get16bits(d) (*((const uint16_t *) (d))) #endif #if !defined (get16bits) #define get16bits(d) ((((uint32_t)(((const uint8_t *)(d))[1])) << 8)\ +(uint32_t)(((const uint8_t *)(d))[0]) ) #endif unsigned int hash(char *str) { int len=strlen(str); uint32_t hash = len, tmp; int rem; if (len <= 0 || str == NULL) return 0; rem = len & 3; len >>= 2; /* Main loop */ for (;len > 0; len--) { hash += get16bits (str); tmp = (get16bits (str+2) << 11) ^ hash; hash = (hash << 16) ^ tmp; str += 2*sizeof (uint16_t); hash += hash >> 11; } /* Handle end cases */ switch (rem) { case 3: hash += get16bits (str); hash ^= hash << 16; hash ^= str[sizeof (uint16_t)] << 18; hash += hash >> 11; break; case 2: hash += get16bits (str); hash ^= hash << 11; hash += hash >> 17; break; case 1: hash += *str; hash ^= hash << 10; hash += hash >> 1; } /* Force "avalanching" of final 127 bits */ hash ^= hash << 3; hash += hash >> 5; hash ^= hash << 4; hash += hash >> 17; hash ^= hash << 25; hash += hash >> 6; return hash % MAXHASH; } #endif /* USE_OLDHASH */ webalizer-2.23-05/hashtab.h0000644000175000017500000001132111015225546014032 0ustar bradbrad#ifndef _HASHTAB_H #define _HASHTAB_H typedef struct hnode *HNODEPTR; /* site node (host) pointer */ typedef struct unode *UNODEPTR; /* url node pointer */ typedef struct rnode *RNODEPTR; /* referrer node */ typedef struct anode *ANODEPTR; /* user agent node pointer */ typedef struct snode *SNODEPTR; /* Search string node pointer */ typedef struct inode *INODEPTR; /* user (ident) node pointer */ #ifdef USE_DNS typedef struct dnode *DNODEPTR; /* DNS hash table node struct */ #endif /* Object flags */ #define OBJ_REG 0 /* Regular object */ #define OBJ_HIDE 1 /* Hidden object */ #define OBJ_GRP 2 /* Grouped object */ #ifdef USE_DNS struct dnode { char *string; /* DNS node hash table struct */ struct sockaddr_storage addr; int addrlen; struct dnode *llist; struct dnode *next; }; #endif struct hnode { char *string; /* host hash table structure */ int flag; u_int64_t count; u_int64_t files; u_int64_t visit; /* visit information */ u_int64_t tstamp; char *lasturl; double xfer; struct hnode *next; }; struct unode { char *string; /* url hash table structure */ int flag; /* Object type (REG, HIDE, GRP) */ u_int64_t count; /* requests counter */ u_int64_t files; /* files counter */ u_int64_t entry; /* entry page counter */ u_int64_t exit; /* exit page counter */ double xfer; /* xfer size in bytes */ struct unode *next; }; /* pointer to next node */ struct rnode { char *string; /* referrer hash table struct */ int flag; u_int64_t count; struct rnode *next; }; struct anode { char *string; int flag; u_int64_t count; struct anode *next; }; struct snode { char *string; /* search string struct */ u_int64_t count; struct snode *next; }; struct inode { char *string; /* host hash table struct */ int flag; u_int64_t count; u_int64_t files; u_int64_t visit; u_int64_t tstamp; double xfer; struct inode *next; }; extern HNODEPTR sm_htab[MAXHASH]; /* hash tables */ extern HNODEPTR sd_htab[MAXHASH]; extern UNODEPTR um_htab[MAXHASH]; /* for hits, sites, */ extern RNODEPTR rm_htab[MAXHASH]; /* referrers and agents... */ extern ANODEPTR am_htab[MAXHASH]; extern SNODEPTR sr_htab[MAXHASH]; /* search string table */ extern INODEPTR im_htab[MAXHASH]; /* ident table (username) */ #ifdef USE_DNS extern DNODEPTR host_table[MAXHASH]; /* DNS resolver table */ #endif extern int put_hnode(char *, int, u_int64_t, u_int64_t, double, u_int64_t *, u_int64_t, u_int64_t, char *, HNODEPTR *); extern int put_unode(char *, int, u_int64_t, double, u_int64_t *, u_int64_t, u_int64_t, UNODEPTR *); extern int put_inode(char *, int, u_int64_t, u_int64_t, double, u_int64_t *, u_int64_t, u_int64_t, INODEPTR *); extern int put_rnode(char *, int, u_int64_t, u_int64_t *, RNODEPTR *); extern int put_anode(char *, int, u_int64_t, u_int64_t *, ANODEPTR *); extern int put_snode(char *, u_int64_t, SNODEPTR *); #ifdef USE_DNS extern int put_dnode(char *, void *, int, DNODEPTR *); extern void del_dlist(DNODEPTR *); #endif extern void del_htabs(); /* delete hash tables */ extern void del_hlist(HNODEPTR *); /* delete host htab */ extern void del_ulist(UNODEPTR *); /* delete url htab */ extern void del_rlist(RNODEPTR *); /* delete referrer htab */ extern void del_alist(ANODEPTR *); /* delete host htab */ extern void del_slist(SNODEPTR *); /* delete host htab */ extern void del_ilist(INODEPTR *); /* delete host htab */ extern void month_update_exit(u_int64_t); extern u_int64_t tot_visit(HNODEPTR *); extern char *find_url(char *); #endif /* _HASHTAB_H */ webalizer-2.23-05/install-sh0000755000175000017500000001272110771016751014264 0ustar bradbrad#! /bin/sh # # install - install a program, script, or datafile # This comes from X11R5 (mit/util/scripts/install.sh). # # Copyright 1991 by the Massachusetts Institute of Technology # # Permission to use, copy, modify, distribute, and sell this software and its # documentation for any purpose is hereby granted without fee, provided that # the above copyright notice appear in all copies and that both that # copyright notice and this permission notice appear in supporting # documentation, and that the name of M.I.T. not be used in advertising or # publicity pertaining to distribution of the software without specific, # written prior permission. M.I.T. makes no representations about the # suitability of this software for any purpose. It is provided "as is" # without express or implied warranty. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" transformbasename="" transform_arg="" instcmd="$mvprog" chmodcmd="$chmodprog 0755" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" src="" dst="" dir_arg="" while [ x"$1" != x ]; do case $1 in -c) instcmd="$cpprog" shift continue;; -d) dir_arg=true shift continue;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; -s) stripcmd="$stripprog" shift continue;; -t=*) transformarg=`echo $1 | sed 's/-t=//'` shift continue;; -b=*) transformbasename=`echo $1 | sed 's/-b=//'` shift continue;; *) if [ x"$src" = x ] then src=$1 else # this colon is to work around a 386BSD /bin/sh bug : dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "install: no input file specified" exit 1 else true fi if [ x"$dir_arg" != x ]; then dst=$src src="" if [ -d $dst ]; then instcmd=: else instcmd=mkdir fi else # Waiting for this to be detected by the "$instcmd $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if [ -f $src -o -d $src ] then true else echo "install: $src does not exist" exit 1 fi if [ x"$dst" = x ] then echo "install: no destination specified" exit 1 else true fi # If destination is a directory, append the input filename; if your system # does not like double slashes in filenames, you may need to add some logic if [ -d $dst ] then dst="$dst"/`basename $src` else true fi fi ## this sed command emulates the dirname command dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Make sure that the destination directory exists. # this part is taken from Noah Friedman's mkinstalldirs script # Skip lots of stat calls in the usual case. if [ ! -d "$dstdir" ]; then defaultIFS=' ' IFS="${IFS-${defaultIFS}}" oIFS="${IFS}" # Some sh's can't handle IFS=/ for some reason. IFS='%' set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` IFS="${oIFS}" pathcomp='' while [ $# -ne 0 ] ; do pathcomp="${pathcomp}${1}" shift if [ ! -d "${pathcomp}" ] ; then $mkdirprog "${pathcomp}" else true fi pathcomp="${pathcomp}/" done fi if [ x"$dir_arg" != x ] then $doit $instcmd $dst && if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi else # If we're going to rename the final executable, determine the name now. if [ x"$transformarg" = x ] then dstfile=`basename $dst` else dstfile=`basename $dst $transformbasename | sed $transformarg`$transformbasename fi # don't allow the sed command to completely eliminate the filename if [ x"$dstfile" = x ] then dstfile=`basename $dst` else true fi # Make a temp file name in the proper directory. dsttmp=$dstdir/#inst.$$# # Move or copy the file name to the temp name $doit $instcmd $src $dsttmp && trap "rm -f ${dsttmp}" 0 && # and set any options; do chmod last to preserve setuid bits # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $instcmd $src $dsttmp" command. if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && # Now rename the file to the real destination. $doit $rmcmd -f $dstdir/$dstfile && $doit $mvcmd $dsttmp $dstdir/$dstfile fi && exit 0 webalizer-2.23-05/lang.h0000644000175000017500000001025711032342336013344 0ustar bradbrad#ifndef _LANG_H #define _LANG_H extern char *language ; extern char *langcode ; extern char *msg_records ; extern char *msg_addresses; extern char *msg_ignored ; extern char *msg_bad ; extern char *msg_in ; extern char *msg_seconds ; extern char *msg_log_err ; extern char *msg_log_use ; extern char *msg_dir_err ; extern char *msg_dir_use ; extern char *msg_cur_dir ; extern char *msg_hostname; extern char *msg_ign_hist; extern char *msg_no_hist ; extern char *msg_get_hist; extern char *msg_put_hist; extern char *msg_hist_err; extern char *msg_bad_hist; extern char *msg_bad_conf; extern char *msg_bad_key ; extern char *msg_bad_date; extern char *msg_ign_nscp; extern char *msg_bad_rec ; extern char *msg_no_vrec ; extern char *msg_gen_rpt ; extern char *msg_gen_sum ; extern char *msg_get_data; extern char *msg_put_data; extern char *msg_no_data ; extern char *msg_bad_data; extern char *msg_data_err; extern char *msg_dup_data; extern char *msg_dns_nocf; extern char *msg_dns_nodb; extern char *msg_dns_nolk; extern char *msg_dns_usec; extern char *msg_dns_rslf; extern char *msg_dns_none; extern char *msg_dns_abrt; extern char *msg_geo_open; extern char *msg_geo_use ; extern char *msg_geo_nolu; extern char *msg_geo_dflt; extern char *msg_nomem_ts; extern char *msg_nomem_tr; extern char *msg_nomem_tu; extern char *msg_nomem_tc; extern char *msg_nomem_ta; extern char *msg_nomem_tsr; extern char *msg_nomem_ti; extern char *msg_nomem_dh; extern char *msg_nomem_mh; extern char *msg_nomem_u ; extern char *msg_nomem_a ; extern char *msg_nomem_r ; extern char *msg_nomem_sc; extern char *msg_nomem_i ; extern char *msg_big_rec ; extern char *msg_big_host; extern char *msg_big_date; extern char *msg_big_req ; extern char *msg_big_ref ; extern char *msg_big_user; extern char *msg_big_one ; extern char *msg_no_open ; extern char *h_usage1 ; extern char *h_usage2 ; extern char *h_msg[]; /* HTML Strings */ extern char *msg_hhdr_sp ; extern char *msg_hhdr_gt ; extern char *msg_main_us ; extern char *msg_main_per; extern char *msg_main_sum; extern char *msg_main_da ; extern char *msg_main_mt ; extern char *msg_hmth_du ; extern char *msg_hmth_hu ; extern char *msg_h_by ; extern char *msg_h_avg ; extern char *msg_h_max ; extern char *msg_h_total ; extern char *msg_h_totals; extern char *msg_h_day ; extern char *msg_h_mth ; extern char *msg_h_hour ; extern char *msg_h_hits ; extern char *msg_h_pages ; extern char *msg_h_visits; extern char *msg_h_files ; extern char *msg_h_sites ; extern char *msg_h_xfer ; extern char *msg_h_hname ; extern char *msg_h_url ; extern char *msg_h_agent ; extern char *msg_h_ref ; extern char *msg_h_ctry ; extern char *msg_h_search; extern char *msg_h_uname ; extern char *msg_hlnk_ds ; extern char *msg_hlnk_hs ; extern char *msg_hlnk_u ; extern char *msg_hlnk_s ; extern char *msg_hlnk_a ; extern char *msg_hlnk_c ; extern char *msg_hlnk_r ; extern char *msg_hlnk_en ; extern char *msg_hlnk_ex ; extern char *msg_hlnk_sr ; extern char *msg_hlnk_i ; extern char *msg_mtot_ms ; extern char *msg_mtot_th ; extern char *msg_mtot_tf ; extern char *msg_mtot_tx ; extern char *msg_mtot_us ; extern char *msg_mtot_ur ; extern char *msg_mtot_ua ; extern char *msg_mtot_uu ; extern char *msg_mtot_ui ; extern char *msg_mtot_mhd; extern char *msg_mtot_mhh; extern char *msg_mtot_mfd; extern char *msg_mtot_mpd; extern char *msg_mtot_msd; extern char *msg_mtot_mvd; extern char *msg_mtot_mkd; extern char *msg_mtot_rc ; extern char *msg_dtot_ds ; extern char *msg_htot_hs ; extern char *msg_ctry_use; extern char *msg_top_top ; extern char *msg_top_of ; extern char *msg_top_s ; extern char *msg_top_u ; extern char *msg_top_r ; extern char *msg_top_a ; extern char *msg_top_c ; extern char *msg_top_en ; extern char *msg_top_ex ; extern char *msg_top_sr ; extern char *msg_top_i ; extern char *msg_v_sites ; extern char *msg_v_urls ; extern char *msg_v_refs ; extern char *msg_v_agents; extern char *msg_v_search; extern char *msg_v_users ; extern char *msg_title ; extern char *msg_h_other ; extern char *s_month[12]; extern char *l_month[12]; extern struct response_code response[]; extern struct country_code ctry[]; #endif /* _LANG_H */ webalizer-2.23-05/linklist.c0000644000175000017500000002067411510252710014250 0ustar bradbrad/* webalizer - a web server log analysis program Copyright (C) 1997-2011 Bradford L. Barrett This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version, and provided that the above copyright and permission notice is included with all distributed copies of this or derived software. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ /*********************************************/ /* STANDARD INCLUDES */ /*********************************************/ #include #include #include #include #include /* normal stuff */ #include #include /* ensure sys/types */ #ifndef _SYS_TYPES_H #include #endif /* need socket header? */ #ifdef HAVE_SYS_SOCKET_H #include #endif /* some systems need this */ #ifdef HAVE_MATH_H #include #endif #include "webalizer.h" /* main header */ #include "lang.h" #include "linklist.h" /* internal function prototypes */ NLISTPTR new_nlist(char *); /* new list node */ void del_nlist(NLISTPTR *); /* del list */ GLISTPTR new_glist(char *, char *); /* new group list node */ void del_glist(GLISTPTR *); /* del group list */ int isinstr(char *, char *); /* Linkded list pointers */ GLISTPTR group_sites = NULL; /* "group" lists */ GLISTPTR group_urls = NULL; GLISTPTR group_refs = NULL; GLISTPTR group_agents = NULL; GLISTPTR group_users = NULL; NLISTPTR hidden_sites = NULL; /* "hidden" lists */ NLISTPTR hidden_urls = NULL; NLISTPTR hidden_refs = NULL; NLISTPTR hidden_agents = NULL; NLISTPTR hidden_users = NULL; NLISTPTR ignored_sites = NULL; /* "Ignored" lists */ NLISTPTR ignored_urls = NULL; NLISTPTR ignored_refs = NULL; NLISTPTR ignored_agents= NULL; NLISTPTR ignored_users = NULL; NLISTPTR include_sites = NULL; /* "Include" lists */ NLISTPTR include_urls = NULL; NLISTPTR include_refs = NULL; NLISTPTR include_agents= NULL; NLISTPTR include_users = NULL; NLISTPTR index_alias = NULL; /* index. aliases */ NLISTPTR html_pre = NULL; /* before anything else :) */ NLISTPTR html_head = NULL; /* top HTML code */ NLISTPTR html_body = NULL; /* body HTML code */ NLISTPTR html_post = NULL; /* middle HTML code */ NLISTPTR html_tail = NULL; /* tail HTML code */ NLISTPTR html_end = NULL; /* after everything else */ NLISTPTR page_type = NULL; /* page view types */ NLISTPTR omit_page = NULL; /* pages not counted */ NLISTPTR page_prefix = NULL; /* page view prefixes */ GLISTPTR search_list = NULL; /* Search engine list */ /*********************************************/ /* NEW_NLIST - create new linked list node */ /*********************************************/ NLISTPTR new_nlist(char *str) { NLISTPTR newptr; if (sizeof(newptr->string) < strlen(str)) { if (verbose) fprintf(stderr,"[new_nlist] %s\n",msg_big_one); } if (( newptr = malloc(sizeof(struct nlist))) != NULL) {strncpy(newptr->string, str, sizeof(newptr->string));newptr->next=NULL;} return newptr; } /*********************************************/ /* ADD_NLIST - add item to FIFO linked list */ /*********************************************/ int add_nlist(char *str, NLISTPTR *list) { NLISTPTR newptr,cptr,pptr; if ( (newptr = new_nlist(str)) != NULL) { if (*list==NULL) *list=newptr; else { cptr=pptr=*list; while(cptr!=NULL) { pptr=cptr; cptr=cptr->next; }; pptr->next = newptr; } } return newptr==NULL; } /*********************************************/ /* DEL_NLIST - delete FIFO linked list */ /*********************************************/ void del_nlist(NLISTPTR *list) { NLISTPTR cptr,nptr; cptr=*list; while (cptr!=NULL) { nptr=cptr->next; free(cptr); cptr=nptr; } } /*********************************************/ /* NEW_GLIST - create new linked list node */ /*********************************************/ GLISTPTR new_glist(char *str, char *name) { GLISTPTR newptr; if (sizeof(newptr->string) < strlen(str) || sizeof(newptr->name) < strlen(name)) { if (verbose) fprintf(stderr,"[new_glist] %s\n",msg_big_one); } if (( newptr = malloc(sizeof(struct glist))) != NULL) { strncpy(newptr->string, str, sizeof(newptr->string)); strncpy(newptr->name, name, sizeof(newptr->name)); newptr->next=NULL; } return newptr; } /*********************************************/ /* ADD_GLIST - add item to FIFO linked list */ /*********************************************/ int add_glist(char *str, GLISTPTR *list) { GLISTPTR newptr,cptr,pptr; char temp_buf[MAXKVAL]; char *name=temp_buf; char sep=0; /* make local copy of string */ if (*str=='"' || *str=='\'') sep=*str++; /* Quote character? */ strncpy(temp_buf,str,MAXKVAL-1); temp_buf[MAXKVAL-1]=0; if (!sep) /* Space seperated */ while (!isspace((unsigned char)*name) && *name!=0) name++; else while (*name!=sep && *name!=0) name++; /* Quote seperated */ if (*name==0) name=temp_buf; else { *name++=0; while (isspace((unsigned char)*name)&&*name!=0) name++; if (*name==0) name=temp_buf; } if ( (newptr = new_glist(temp_buf, name)) != NULL) { if (*list==NULL) *list=newptr; else { cptr=pptr=*list; while(cptr!=NULL) { pptr=cptr; cptr=cptr->next; }; pptr->next = newptr; } } return newptr==NULL; } /*********************************************/ /* DEL_GLIST - delete FIFO linked list */ /*********************************************/ void del_glist(GLISTPTR *list) { GLISTPTR cptr,nptr; cptr=*list; while (cptr!=NULL) { nptr=cptr->next; free(cptr); cptr=nptr; } } /*********************************************/ /* ISINLIST - Test if string is in list */ /*********************************************/ char *isinlist(NLISTPTR list, char *str) { NLISTPTR lptr; lptr=list; while (lptr!=NULL) { if (isinstr(str,lptr->string)) return lptr->string; lptr=lptr->next; } return NULL; } /*********************************************/ /* ISINGLIST - Test if string is in list */ /*********************************************/ char *isinglist(GLISTPTR list, char *str) { GLISTPTR lptr; lptr=list; while (lptr!=NULL) { if (isinstr(str,lptr->string)) return lptr->name; lptr=lptr->next; } return NULL; } /*********************************************/ /* ISINSTR - Scan for string in string */ /*********************************************/ int isinstr(char *str, char *cp) { char *cp1,*cp2; cp1=(cp+strlen(cp))-1; if (*cp=='*') { /* if leading wildcard, start from end */ cp2=str+strlen(str)-1; while ( (cp1!=cp) && (cp2!=str)) { if (*cp1=='*') return 1; if (*cp1--!=*cp2--) return 0; } if (cp1==cp) return 1; else return 0; } else { /* if no leading/trailing wildcard, just strstr */ if (*cp1!='*') return(strstr(str,cp)!=NULL); /* otherwise do normal forward scan */ cp1=cp; cp2=str; while (*cp2!='\0') { if (*cp1=='*') return 1; if (*cp1++!=*cp2++) return 0; } if (*cp1=='*') return 1; else return 0; } } webalizer-2.23-05/linklist.h0000644000175000017500000000465111477352727014277 0ustar bradbrad#ifndef _LINKLIST_H #define _LINKLIST_H struct nlist { char string[MAXKVAL]; /* list struct for HIDE items */ struct nlist *next; }; typedef struct nlist *NLISTPTR; struct glist { char string[MAXKVAL]; /* list struct for GROUP items */ char name[MAXKVAL]; struct glist *next; }; typedef struct glist *GLISTPTR; extern GLISTPTR group_sites ; /* "group" lists */ extern GLISTPTR group_urls ; extern GLISTPTR group_refs ; extern GLISTPTR group_agents ; extern GLISTPTR group_users ; extern NLISTPTR hidden_sites ; /* "hidden" lists */ extern NLISTPTR hidden_urls ; extern NLISTPTR hidden_refs ; extern NLISTPTR hidden_agents ; extern NLISTPTR hidden_users ; extern NLISTPTR ignored_sites ; /* "Ignored" lists */ extern NLISTPTR ignored_urls ; extern NLISTPTR ignored_refs ; extern NLISTPTR ignored_agents; extern NLISTPTR ignored_users ; extern NLISTPTR include_sites ; /* "Include" lists */ extern NLISTPTR include_urls ; extern NLISTPTR include_refs ; extern NLISTPTR include_agents; extern NLISTPTR include_users ; extern NLISTPTR index_alias ; /* index. aliases */ extern NLISTPTR html_pre ; /* before anything else :) */ extern NLISTPTR html_head ; /* top HTML code */ extern NLISTPTR html_body ; /* body HTML code */ extern NLISTPTR html_post ; /* middle HTML code */ extern NLISTPTR html_tail ; /* tail HTML code */ extern NLISTPTR html_end ; /* after everything else */ extern NLISTPTR page_type ; /* page view types */ extern NLISTPTR omit_page ; /* pages not counted */ extern NLISTPTR page_prefix ; /* page view prefixes */ extern GLISTPTR search_list ; /* Search engine list */ extern char *isinlist(NLISTPTR, char *); /* scan list for str */ extern char *isinglist(GLISTPTR, char *); /* scan glist for str */ extern int add_nlist(char *, NLISTPTR *); /* add list item */ extern int add_glist(char *, GLISTPTR *); /* add group list item */ #endif /* _LINKLIST_H */ webalizer-2.23-05/msfree.png0000644000175000017500000000270610771016751014251 0ustar bradbradPNG  IHDRd&٘dgAMA aPLTEs{!!!)))111999BBBJJJRRRZZZc11ccck11kkksss{{{!!ZZ!!!!11!!1199BBRRcc{{ccss{{ﭭス56qIDATxak0ajbF&-Kp&,^Ivvt[cg"IϽwR;1uy;XwDDzʆUS} m X[icwvKn~P=Ru\_󭟇a%Ymly{C\^z%bmϱL6O"&UQɮ[O됧- %oͶAjPj*UۃV 4-DTYM~I ϶=\^g{b{R Ǜ3Hɘ˧>Ne 5g:1KJNgR ?̚^1gNIbIž@kXU.]@2)2F% SSJHd#KJH q.$9|b"bѦ,Ԏ^pLr[J %$#(-$R$fx6W4.&娚C%9q9v*K\4 3&5ވ@RJ#YB\-]l@6"q /YP3#7BBsUUZB9Y(F% Dm<$ǙC}\p:H>_^I㨥-o cLΫi}WLukM~j'IENDB`webalizer-2.23-05/output.c0000644000175000017500000032231411510252765013765 0ustar bradbrad/* webalizer - a web server log analysis program Copyright (C) 1997-2011 Bradford L. Barrett This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version, and provided that the above copyright and permission notice is included with all distributed copies of this or derived software. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ /*********************************************/ /* STANDARD INCLUDES */ /*********************************************/ #include #include #include #include #include /* normal stuff */ #include #include #include #include #ifdef USE_DNS #include #endif /* ensure sys/types */ #ifndef _SYS_TYPES_H #include #endif /* need socket header? */ #ifdef HAVE_SYS_SOCKET_H #include #endif /* some systems need this */ #ifdef HAVE_MATH_H #include #endif #ifdef USE_GEOIP #include #endif #include "webalizer.h" /* main header */ #include "lang.h" #include "hashtab.h" #include "preserve.h" #include "linklist.h" #include "graphs.h" #include "output.h" /* internal function prototypes */ void write_html_head(char *, FILE *); /* head of html page */ void write_html_tail(FILE *); /* tail of html page */ void month_links(); /* Page links */ void month_total_table(); /* monthly total table */ void daily_total_table(); /* daily total table */ void hourly_total_table(); /* hourly total table */ void top_sites_table(int); /* top n sites table */ void top_urls_table(int); /* top n URLs table */ void top_entry_table(int); /* top n entry/exits */ void top_refs_table(); /* top n referrers "" */ void top_agents_table(); /* top n u-agents "" */ void top_ctry_table(); /* top n countries "" */ void top_search_table(); /* top n search strs */ void top_users_table(); /* top n ident table */ u_int64_t load_url_array( UNODEPTR *); /* load URL array */ u_int64_t load_site_array( HNODEPTR *); /* load Site array */ u_int64_t load_ref_array( RNODEPTR *); /* load Refs array */ u_int64_t load_agent_array(ANODEPTR *); /* load Agents array */ u_int64_t load_srch_array( SNODEPTR *); /* load srch str array */ u_int64_t load_ident_array(INODEPTR *); /* load ident array */ int qs_url_cmph( const void*, const void*); /* compare by hits */ int qs_url_cmpk( const void*, const void*); /* compare by kbytes */ int qs_url_cmpn( const void*, const void*); /* compare by entrys */ int qs_url_cmpx( const void*, const void*); /* compare by exits */ int qs_site_cmph(const void*, const void*); /* compare by hits */ int qs_site_cmpk(const void*, const void*); /* compare by kbytes */ int qs_ref_cmph( const void*, const void*); /* compare by hits */ int qs_agnt_cmph(const void*, const void*); /* compare by hits */ int qs_srch_cmph(const void*, const void*); /* compare by hits */ int qs_ident_cmph(const void*, const void*); /* compare by hits */ int qs_ident_cmpk(const void*, const void*); /* compare by kbytes */ int all_sites_page(u_int64_t, u_int64_t); /* output site page */ int all_urls_page(u_int64_t, u_int64_t); /* output urls page */ int all_refs_page(u_int64_t, u_int64_t); /* output refs page */ int all_agents_page(u_int64_t, u_int64_t); /* output agents page */ int all_search_page(u_int64_t, u_int64_t); /* output search page */ int all_users_page(u_int64_t, u_int64_t); /* output ident page */ void dump_all_sites(); /* dump sites tab file */ void dump_all_urls(); /* dump urls tab file */ void dump_all_refs(); /* dump refs tab file */ void dump_all_agents(); /* dump agents file */ void dump_all_users(); /* dump usernames file */ void dump_all_search(); /* dump search file */ /* define some colors for HTML */ #define WHITE "#FFFFFF" #define BLACK "#000000" #define RED "#FF0000" #define ORANGE "#FF8000" #define LTBLUE "#0080FF" #define BLUE "#0000FF" #define GREEN "#00FF00" #define DKGREEN "#008040" #define GREY "#C0C0C0" #define LTGREY "#E8E8E8" #define YELLOW "#FFFF00" #define PURPLE "#FF00FF" #define CYAN "#00E0FF" #define GRPCOLOR "#D0D0E0" /* configurable html colors */ #define HITCOLOR hit_color #define FILECOLOR file_color #define SITECOLOR site_color #define KBYTECOLOR kbyte_color #define PAGECOLOR page_color #define VISITCOLOR visit_color #define MISCCOLOR misc_color /* sort arrays */ UNODEPTR *u_array = NULL; /* Sort array for URLs */ HNODEPTR *h_array = NULL; /* hostnames (sites) */ RNODEPTR *r_array = NULL; /* referrers */ ANODEPTR *a_array = NULL; /* user agents */ SNODEPTR *s_array = NULL; /* search strings */ INODEPTR *i_array = NULL; /* ident strings (username) */ u_int64_t a_ctr = 0; /* counter for sort array */ FILE *out_fp; /*********************************************/ /* WRITE_HTML_HEAD - output top of HTML page */ /*********************************************/ void write_html_head(char *period, FILE *out_fp) { NLISTPTR lptr; /* used for HTMLhead processing */ /* HTMLPre code goes before all else */ lptr = html_pre; if (lptr==NULL) { /* Default 'DOCTYPE' header record if none specified */ fprintf(out_fp, "\n\n"); } else { while (lptr!=NULL) { fprintf(out_fp,"%s\n",lptr->string); lptr=lptr->next; } } /* Standard header comments */ fprintf(out_fp,"\n", version,editlvl); fprintf(out_fp,"\n"); fprintf(out_fp,"\n"); fprintf(out_fp,"\n"); fprintf(out_fp,"\n"); fprintf(out_fp,"\n"); fprintf(out_fp,"\n"); fprintf(out_fp,"\n"); fprintf(out_fp,"\n"); fprintf(out_fp,"\n"); fprintf(out_fp,"\n"); fprintf(out_fp,"\n"); fprintf(out_fp,"\n\n",cur_time()); fprintf(out_fp,"\n\n",langcode); fprintf(out_fp," %s %s - %s\n", msg_title, hname, (period)?period:msg_main_per); lptr=html_head; while (lptr!=NULL) { fprintf(out_fp,"%s\n",lptr->string); lptr=lptr->next; } fprintf(out_fp,"\n\n"); lptr = html_body; if (lptr==NULL) fprintf(out_fp,"\n", LTGREY, BLACK, BLUE, RED); else { while (lptr!=NULL) { fprintf(out_fp,"%s\n",lptr->string); lptr=lptr->next; } } fprintf(out_fp,"

%s %s

\n",msg_title, hname); if (period) fprintf(out_fp,"\n%s: %s
\n",msg_hhdr_sp,period); else fprintf(out_fp,"\n%s
\n",msg_main_per); fprintf(out_fp,"%s %s
\n
\n",msg_hhdr_gt,cur_time()); lptr=html_post; while (lptr!=NULL) { fprintf(out_fp,"%s\n",lptr->string); lptr=lptr->next; } fprintf(out_fp,"
\n
\n

\n"); } /*********************************************/ /* WRITE_HTML_TAIL - output HTML page tail */ /*********************************************/ void write_html_tail(FILE *out_fp) { NLISTPTR lptr; fprintf(out_fp,"

\n"); fprintf(out_fp,"

\n


\n"); fprintf(out_fp,"
..
\n"); fprintf(out_fp,"\n"); fprintf(out_fp,"\n"); lptr=html_tail; if (lptr) { fprintf(out_fp,"\n"); } fprintf(out_fp,"\n
\n"); fprintf(out_fp,"Generated by\n"); fprintf(out_fp,""); fprintf(out_fp,"Webalizer Version %s\n",version); fprintf(out_fp,"\n\n"); while (lptr!=NULL) { fprintf(out_fp,"%s\n",lptr->string); lptr=lptr->next; } fprintf(out_fp,"
\n"); /* wind up, this is the end of the file */ fprintf(out_fp,"\n\n", version,editlvl,moddate); lptr = html_end; if (lptr) { while (lptr!=NULL) { fprintf(out_fp,"%s\n",lptr->string); lptr=lptr->next; } } else fprintf(out_fp,"\n\n\n"); } /*********************************************/ /* WRITE_MONTH_HTML - does what it says... */ /*********************************************/ int write_month_html() { char html_fname[256]; /* filename storage areas... */ char png1_fname[32]; char png2_fname[32]; char buffer[BUFSIZE]; /* scratch buffer */ char dtitle[256]; char htitle[256]; if (verbose>1) printf("%s %s %d\n",msg_gen_rpt, l_month[cur_month-1], cur_year); /* fill in filenames */ snprintf(html_fname,sizeof(html_fname),"usage_%04d%02d.%s", cur_year,cur_month,html_ext); sprintf(png1_fname,"daily_usage_%04d%02d.png",cur_year,cur_month); sprintf(png2_fname,"hourly_usage_%04d%02d.png",cur_year,cur_month); /* create PNG images for web page */ if (daily_graph) { snprintf(dtitle,sizeof(dtitle),"%s %s %d", msg_hmth_du,l_month[cur_month-1],cur_year); month_graph6 ( png1_fname, /* filename */ dtitle, /* graph title */ cur_month, /* graph month */ cur_year, /* graph year */ tm_hit, /* data 1 (hits) */ tm_file, /* data 2 (files) */ tm_site, /* data 3 (sites) */ tm_xfer, /* data 4 (kbytes) */ tm_page, /* data 5 (pages) */ tm_visit); /* data 6 (visits) */ } if (hourly_graph) { snprintf(htitle,sizeof(htitle),"%s %s %d", msg_hmth_hu,l_month[cur_month-1],cur_year); day_graph3( png2_fname, htitle, th_hit, th_file, th_page ); } /* now do html stuff... */ /* first, open the file */ if ( (out_fp=open_out_file(html_fname))==NULL ) return 1; snprintf(buffer,sizeof(buffer),"%s %d",l_month[cur_month-1],cur_year); write_html_head(buffer, out_fp); month_links(); month_total_table(); if (daily_graph || daily_stats) /* Daily stuff */ { fprintf(out_fp,"\n"); if (daily_graph) fprintf(out_fp,"\"%s\"

\n",png1_fname,dtitle); if (daily_stats) daily_total_table(); } if (hourly_graph || hourly_stats) /* Hourly stuff */ { fprintf(out_fp,"\n"); if (hourly_graph) fprintf(out_fp,"\"%s\"

\n",png2_fname,htitle); if (hourly_stats) hourly_total_table(); } /* Do URL related stuff here, sorting appropriately */ if ( (a_ctr=load_url_array(NULL)) ) { if ( (u_array=malloc(sizeof(UNODEPTR)*(a_ctr))) !=NULL ) { a_ctr=load_url_array(u_array); /* load up our sort array */ if (ntop_urls || dump_urls) { qsort(u_array,a_ctr,sizeof(UNODEPTR),qs_url_cmph); if (ntop_urls) top_urls_table(0); /* Top URLs (by hits) */ if (dump_urls) dump_all_urls(); /* Dump URLs tab file */ } if (ntop_urlsK) /* Top URLs (by kbytes) */ {qsort(u_array,a_ctr,sizeof(UNODEPTR),qs_url_cmpk); top_urls_table(1); } if (ntop_entry) /* Top Entry Pages */ {qsort(u_array,a_ctr,sizeof(UNODEPTR),qs_url_cmpn); top_entry_table(0);} if (ntop_exit) /* Top Exit Pages */ {qsort(u_array,a_ctr,sizeof(UNODEPTR),qs_url_cmpx); top_entry_table(1);} free(u_array); } else if (verbose) fprintf(stderr,"%s [u_array]\n",msg_nomem_tu); /* err */ } /* do hostname (sites) related stuff here, sorting appropriately... */ if ( (a_ctr=load_site_array(NULL)) ) { if ( (h_array=malloc(sizeof(HNODEPTR)*(a_ctr))) !=NULL ) { a_ctr=load_site_array(h_array); /* load up our sort array */ if (ntop_sites || dump_sites) { qsort(h_array,a_ctr,sizeof(HNODEPTR),qs_site_cmph); if (ntop_sites) top_sites_table(0); /* Top sites table (by hits) */ if (dump_sites) dump_all_sites(); /* Dump sites tab file */ } if (ntop_sitesK) /* Top Sites table (by kbytes) */ { qsort(h_array,a_ctr,sizeof(HNODEPTR),qs_site_cmpk); top_sites_table(1); } free(h_array); } else if (verbose) fprintf(stderr,"%s [h_array]\n",msg_nomem_ts); /* err */ } /* do referrer related stuff here, sorting appropriately... */ if ( (a_ctr=load_ref_array(NULL)) ) { if ( (r_array=malloc(sizeof(RNODEPTR)*(a_ctr))) != NULL) { a_ctr=load_ref_array(r_array); if (ntop_refs || dump_refs) { qsort(r_array,a_ctr,sizeof(RNODEPTR),qs_ref_cmph); if (ntop_refs) top_refs_table(); /* Top referrers table */ if (dump_refs) dump_all_refs(); /* Dump referrers tab file */ } free(r_array); } else if (verbose) fprintf(stderr,"%s [r_array]\n",msg_nomem_tr); /* err */ } /* do search string related stuff, sorting appropriately... */ if ( (a_ctr=load_srch_array(NULL)) ) { if ( (s_array=malloc(sizeof(SNODEPTR)*(a_ctr))) != NULL) { a_ctr=load_srch_array(s_array); if (ntop_search || dump_search) { qsort(s_array,a_ctr,sizeof(SNODEPTR),qs_srch_cmph); if (ntop_search) top_search_table(); /* top search strings table */ if (dump_search) dump_all_search(); /* dump search string tab file */ } free(s_array); } else if (verbose) fprintf(stderr,"%s [s_array]\n",msg_nomem_tsr);/* err */ } /* do ident (username) related stuff here, sorting appropriately... */ if ( (a_ctr=load_ident_array(NULL)) ) { if ( (i_array=malloc(sizeof(INODEPTR)*(a_ctr))) != NULL) { a_ctr=load_ident_array(i_array); if (ntop_users || dump_users) { qsort(i_array,a_ctr,sizeof(INODEPTR),qs_ident_cmph); if (ntop_users) top_users_table(); /* top usernames table */ if (dump_users) dump_all_users(); /* dump usernames tab file */ } free(i_array); } else if (verbose) fprintf(stderr,"%s [i_array]\n",msg_nomem_ti); /* err */ } /* do user agent related stuff here, sorting appropriately... */ if ( (a_ctr=load_agent_array(NULL)) ) { if ( (a_array=malloc(sizeof(ANODEPTR)*(a_ctr))) != NULL) { a_ctr=load_agent_array(a_array); if (ntop_agents || dump_agents) { qsort(a_array,a_ctr,sizeof(ANODEPTR),qs_agnt_cmph); if (ntop_agents) top_agents_table(); /* top user agents table */ if (dump_agents) dump_all_agents(); /* dump user agents tab file */ } free(a_array); } else if (verbose) fprintf(stderr,"%s [a_array]\n",msg_nomem_ta); /* err */ } if (ntop_ctrys ) top_ctry_table(); /* top countries table */ write_html_tail(out_fp); /* finish up the HTML document */ fclose(out_fp); /* close the file */ return (0); /* done... */ } /*********************************************/ /* MONTH_LINKS - links to other page parts */ /*********************************************/ void month_links() { fprintf(out_fp,"\n"); if (daily_stats || daily_graph) fprintf(out_fp,"[%s]\n",msg_hlnk_ds); if (hourly_stats || hourly_graph) fprintf(out_fp,"[%s]\n",msg_hlnk_hs); if (ntop_urls || ntop_urlsK) fprintf(out_fp,"[%s]\n",msg_hlnk_u); if (ntop_entry) fprintf(out_fp,"[%s]\n",msg_hlnk_en); if (ntop_exit) fprintf(out_fp,"[%s]\n",msg_hlnk_ex); if (ntop_sites || ntop_sitesK) fprintf(out_fp,"[%s]\n",msg_hlnk_s); if (ntop_refs && t_ref) fprintf(out_fp,"[%s]\n",msg_hlnk_r); if (ntop_search) fprintf(out_fp,"[%s]\n",msg_hlnk_sr); if (ntop_users && t_user) fprintf(out_fp,"[%s]\n",msg_hlnk_i); if (ntop_agents && t_agent) fprintf(out_fp,"[%s]\n",msg_hlnk_a); if (ntop_ctrys) fprintf(out_fp,"[%s]\n",msg_hlnk_c); fprintf(out_fp,"\n

\n"); } /*********************************************/ /* MONTH_TOTAL_TABLE - monthly totals table */ /*********************************************/ void month_total_table() { int i,days_in_month; u_int64_t max_files=0,max_hits=0,max_visits=0,max_pages=0,max_sites=0; double max_xfer=0.0; days_in_month=(l_day-f_day)+1; for (i=0;i<31;i++) { /* Get max/day values */ if (tm_hit[i]>max_hits) max_hits = tm_hit[i]; if (tm_file[i]>max_files) max_files = tm_file[i]; if (tm_page[i]>max_pages) max_pages = tm_page[i]; if (tm_visit[i]>max_visits) max_visits= tm_visit[i]; if (tm_site[i]>max_sites) max_sites = tm_site[i]; if (tm_xfer[i]>max_xfer) max_xfer = tm_xfer[i]; } fprintf(out_fp,"\n"); fprintf(out_fp,"\n"); fprintf(out_fp,"\n",GREY,msg_mtot_ms,l_month[cur_month-1],cur_year); fprintf(out_fp,"\n"); /* Total Hits */ fprintf(out_fp,"\n" \ "\n",msg_mtot_th,t_hit); /* Total Files */ fprintf(out_fp,"\n" \ "\n",msg_mtot_tf,t_file); /* Total Pages */ fprintf(out_fp,"\n" \ "\n",msg_h_total, msg_h_pages, t_page); /* Total Visits */ fprintf(out_fp,"\n" \ "\n",msg_h_total, msg_h_visits, t_visit); /* Total XFer */ fprintf(out_fp,"\n" \ "\n",msg_mtot_tx,t_xfer/1024); fprintf(out_fp,"\n"); /**********************************************/ /* Unique Sites */ fprintf(out_fp,"" \ "\n" \ "\n",msg_mtot_us,t_site); /* Unique URLs */ fprintf(out_fp,"" \ "\n" \ "\n",msg_mtot_uu,t_url); /* Unique Referrers */ if (t_ref != 0) fprintf(out_fp,"" \ "\n" \ "\n",msg_mtot_ur,t_ref); /* Unique Usernames */ if (t_user != 0) fprintf(out_fp,"" \ "\n" \ "\n",msg_mtot_ui,t_user); /* Unique Agents */ if (t_agent != 0) fprintf(out_fp,"" \ "\n" \ "\n",msg_mtot_ua,t_agent); fprintf(out_fp,"\n"); /**********************************************/ /* Hourly/Daily avg/max totals */ fprintf(out_fp,"" \ "\n"\ "\n" \ "\n", GREY,GREY,GREY,msg_h_avg,GREY,msg_h_max); fprintf(out_fp,"\n"); /* Max/Avg Hits per Hour */ fprintf(out_fp,"" \ "\n" \ "\n" \ "\n",msg_mtot_mhh, t_hit/(24*days_in_month),mh_hit); /* Max/Avg Hits per Day */ fprintf(out_fp,"" \ "\n" \ "\n" \ "\n",msg_mtot_mhd, t_hit/days_in_month, max_hits); /* Max/Avg Files per Day */ fprintf(out_fp,"" \ "\n" \ "\n" \ "\n",msg_mtot_mfd, t_file/days_in_month,max_files); /* Max/Avg Pages per Day */ fprintf(out_fp,"" \ "\n" \ "\n" \ "\n",msg_mtot_mpd, t_page/days_in_month,max_pages); /* Max/Avg Sites per Day */ fprintf(out_fp,"" \ "\n" \ "\n" \ "\n",msg_mtot_msd, t_site/days_in_month,max_sites); /* Max/Avg Visits per Day */ fprintf(out_fp,"" \ "\n" \ "\n" \ "\n",msg_mtot_mvd, t_visit/days_in_month,max_visits); /* Max/Avg KBytes per Day */ fprintf(out_fp,"" \ "\n" \ "\n" \ "\n",msg_mtot_mkd, (t_xfer/1024)/days_in_month,max_xfer/1024); fprintf(out_fp,"\n"); /**********************************************/ /* response code totals */ fprintf(out_fp,"\n",GREY,msg_mtot_rc); fprintf(out_fp,"\n"); for (i=0;i\n" \ "\n" \ "\n", response[i].desc,PCENT(response[i].count,t_hit),response[i].count); } fprintf(out_fp,"\n"); /**********************************************/ fprintf(out_fp,"
" \ "%s %s %d
%s%llu" \ "
%s%llu" \ "
%s %s%llu" \ "
%s %s%llu" \ "
%s%.0f" \ "
%s%llu" \ "
%s%llu" \ "
%s%llu" \ "
%s%llu" \ "
%s%llu" \ "
." \ "%s " \ "%s
%s%llu%llu" \ "
%s%llu%llu" \ "
%s%llu%llu" \ "
%s%llu%llu" \ "
%s%llu%llu" \ "
%s%llu%llu" \ "
%s%.0f%.0f" \ "
\n" \ "%s
%s%3.02f%%%llu
\n"); fprintf(out_fp,"

\n"); } /*********************************************/ /* DAILY_TOTAL_TABLE - daily totals */ /*********************************************/ void daily_total_table() { int i,j; /* Daily stats */ fprintf(out_fp,"\n"); fprintf(out_fp,"\n"); /* Daily statistics for ... */ fprintf(out_fp,"\n", GREY,msg_dtot_ds,l_month[cur_month-1], cur_year); fprintf(out_fp,"\n"); fprintf(out_fp,"\n" \ "\n" \ "\n" \ "\n" \ "\n" \ "\n" \ "\n", GREY, msg_h_day, HITCOLOR, msg_h_hits, FILECOLOR, msg_h_files, PAGECOLOR, msg_h_pages, VISITCOLOR, msg_h_visits, SITECOLOR, msg_h_sites, KBYTECOLOR, msg_h_xfer); fprintf(out_fp,"\n"); /* skip beginning blank days in a month */ for (i=0;i\n", i+1); fprintf(out_fp,"\n" \ "\n", tm_hit[i],PCENT(tm_hit[i],t_hit)); fprintf(out_fp,"\n" \ "\n", tm_file[i],PCENT(tm_file[i],t_file)); fprintf(out_fp,"\n" \ "\n", tm_page[i],PCENT(tm_page[i],t_page)); fprintf(out_fp,"\n" \ "\n", tm_visit[i],PCENT(tm_visit[i],t_visit)); fprintf(out_fp,"\n" \ "\n", tm_site[i],PCENT(tm_site[i],t_site)); fprintf(out_fp,"\n" \ "\n", tm_xfer[i]/1024,PCENT(tm_xfer[i],t_xfer)); } fprintf(out_fp,"\n"); fprintf(out_fp,"
" \ "%s %s %d
" \ "%s" \ "%s" \ "%s" \ "%s" \ "%s" \ "%s" \ "%s
",GRPCOLOR); else fprintf(out_fp,"
"); fprintf(out_fp,"%d" \ "%llu%3.02f%%" \ "%llu%3.02f%%" \ "%llu%3.02f%%" \ "%llu%3.02f%%" \ "%llu%3.02f%%" \ "%.0f%3.02f%%
\n"); fprintf(out_fp,"

\n"); } /*********************************************/ /* HOURLY_TOTAL_TABLE - hourly table */ /*********************************************/ void hourly_total_table() { int i,days_in_month; u_int64_t avg_file=0; double avg_xfer=0.0; days_in_month=(l_day-f_day)+1; /* Hourly stats */ fprintf(out_fp,"\n"); fprintf(out_fp,"\n"); fprintf(out_fp,"\n", GREY,msg_htot_hs,l_month[cur_month-1], cur_year); fprintf(out_fp,"\n"); fprintf(out_fp,"\n" \ "\n" \ "\n" \ "\n" \ "\n", GREY, msg_h_hour, HITCOLOR, msg_h_hits, FILECOLOR, msg_h_files, PAGECOLOR, msg_h_pages, KBYTECOLOR, msg_h_xfer); fprintf(out_fp,"\n" \ "\n", HITCOLOR, msg_h_avg, HITCOLOR, msg_h_total); fprintf(out_fp,"\n" \ "\n", FILECOLOR, msg_h_avg, FILECOLOR, msg_h_total); fprintf(out_fp,"\n" \ "\n", PAGECOLOR, msg_h_avg, PAGECOLOR, msg_h_total); fprintf(out_fp,"\n" \ "\n", KBYTECOLOR, msg_h_avg, KBYTECOLOR, msg_h_total); fprintf(out_fp,"\n"); for (i=0;i<24;i++) { fprintf(out_fp,"\n",i); fprintf(out_fp, "\n"\ "\n"\ "\n", th_hit[i]/days_in_month,th_hit[i], PCENT(th_hit[i],t_hit)); fprintf(out_fp, "\n"\ "\n"\ "\n", th_file[i]/days_in_month,th_file[i], PCENT(th_file[i],t_file)); fprintf(out_fp, "\n"\ "\n"\ "\n", th_page[i]/days_in_month,th_page[i], PCENT(th_page[i],t_page)); fprintf(out_fp, "\n" \ "\n" \ "\n", (th_xfer[i]/days_in_month)/1024,th_xfer[i]/1024, PCENT(th_xfer[i],t_xfer)); avg_file += th_file[i]/days_in_month; avg_xfer+= (th_xfer[i]/days_in_month)/1024; } fprintf(out_fp,"\n"); fprintf(out_fp,"
"\ "%s %s %d
" \ "%s" \ "%s" \ "%s" \ "%s" \ "%s
" \ "%s" \ "%s" \ "%s" \ "%s" \ "%s" \ "%s" \ "%s" \ "%s
" \ "%d%llu%llu%3.02f%%%llu%llu%3.02f%%%llu%llu%3.02f%%%.0f%.0f%3.02f%%
\n

\n"); } /*********************************************/ /* TOP_SITES_TABLE - generate top n table */ /*********************************************/ void top_sites_table(int flag) { u_int64_t cnt=0, h_reg=0, h_grp=0, h_hid=0, tot_num; int i; HNODEPTR hptr, *pointer; cnt=a_ctr; pointer=h_array; while(cnt--) { /* calculate totals */ switch ( (int)((HNODEPTR)(*pointer)->flag) ) { case OBJ_REG: h_reg++; break; case OBJ_GRP: h_grp++; break; case OBJ_HIDE: h_hid++; break; } pointer++; } if ( (tot_num=h_reg+h_grp)==0 ) return; /* split if none */ i=(flag)?ntop_sitesK:ntop_sites; /* Hits or KBytes?? */ if (tot_num > i) tot_num = i; /* get max to do... */ if ((!flag) || (flag&&!ntop_sites)) /* now do tag */ fprintf(out_fp,"\n"); fprintf(out_fp,"\n"); fprintf(out_fp,"\n"); if (flag) fprintf(out_fp,"\n", GREY, msg_top_top,tot_num,msg_top_of, t_site,msg_top_s,msg_h_by,msg_h_xfer); else fprintf(out_fp,"\n", GREY,msg_top_top, tot_num, msg_top_of, t_site, msg_top_s); fprintf(out_fp,"\n"); fprintf(out_fp,"\n",GREY); fprintf(out_fp,"\n",HITCOLOR,msg_h_hits); fprintf(out_fp,"\n",FILECOLOR,msg_h_files); fprintf(out_fp,"\n",KBYTECOLOR,msg_h_xfer); fprintf(out_fp,"\n",VISITCOLOR,msg_h_visits); fprintf(out_fp,"\n",MISCCOLOR,msg_h_hname); fprintf(out_fp,"\n"); pointer=h_array; i=0; while(tot_num) { hptr=*pointer++; if (hptr->flag != OBJ_HIDE) { /* shade grouping? */ if (shade_groups && (hptr->flag==OBJ_GRP)) fprintf(out_fp,"\n", GRPCOLOR); else fprintf(out_fp,"\n"); fprintf(out_fp, "\n" \ "\n" \ "\n" \ "\n" \ "\n" \ "\n" \ "\n" \ "\n" \ "\n" \ "\n", hptr->string); else fprintf(out_fp,"%s\n", hptr->string); tot_num--; i++; } } fprintf(out_fp,"\n"); if ((!flag) || (flag&&!ntop_sites)) { if ( (all_sites) && ((h_reg+h_grp)>ntop_sites) ) { if (all_sites_page(h_reg, h_grp)) { fprintf(out_fp,"",GRPCOLOR); fprintf(out_fp,"\n",msg_v_sites); if (flag) /* do we need to sort? */ qsort(h_array,a_ctr,sizeof(HNODEPTR),qs_site_cmph); } } } fprintf(out_fp,"
" \ "%s %llu %s %llu %s %s %s
" \ "%s %llu %s %llu %s
" \ "#" \ "%s" \ "%s" \ "%s" \ "%s" \ "%s
%d%llu%3.02f%%%llu%3.02f%%%.0f%3.02f%%%llu%3.02f%%", i+1,hptr->count, (t_hit==0)?0:((float)hptr->count/t_hit)*100.0,hptr->files, (t_file==0)?0:((float)hptr->files/t_file)*100.0,hptr->xfer/1024, (t_xfer==0)?0:((float)hptr->xfer/t_xfer)*100.0,hptr->visit, (t_visit==0)?0:((float)hptr->visit/t_visit)*100.0); if ((hptr->flag==OBJ_GRP)&&hlite_groups) fprintf(out_fp,"%s
\n"); fprintf(out_fp,""); fprintf(out_fp,"", cur_year,cur_month,html_ext); fprintf(out_fp,"%s
\n

\n"); } /*********************************************/ /* ALL_SITES_PAGE - HTML page of all sites */ /*********************************************/ int all_sites_page(u_int64_t h_reg, u_int64_t h_grp) { HNODEPTR hptr, *pointer; char site_fname[256], buffer[256]; FILE *out_fp; int i=(h_grp)?1:0; /* generate file name */ snprintf(site_fname,sizeof(site_fname),"site_%04d%02d.%s", cur_year,cur_month,html_ext); /* open file */ if ( (out_fp=open_out_file(site_fname))==NULL ) return 0; snprintf(buffer,sizeof(buffer),"%s %d - %s", l_month[cur_month-1],cur_year,msg_h_sites); write_html_head(buffer, out_fp); fprintf(out_fp,"

\n");

   fprintf(out_fp," %12s      %12s      %12s      %12s      %s\n",
           msg_h_hits, msg_h_files, msg_h_xfer, msg_h_visits, msg_h_hname);
   fprintf(out_fp,"----------------  ----------------  ----------------  " \
                  "----------------  --------------------\n\n");

   /* Do groups first (if any) */
   pointer=h_array;
   while(h_grp)
   {
      hptr=*pointer++;
      if (hptr->flag == OBJ_GRP)
      {
         fprintf(out_fp,
            "%-8llu %6.02f%%  %8llu %6.02f%%  %8.0f %6.02f%%  "            \
            "%8llu %6.02f%%  %s\n",
            hptr->count,
            (t_hit==0)?0:((float)hptr->count/t_hit)*100.0,hptr->files,
            (t_file==0)?0:((float)hptr->files/t_file)*100.0,hptr->xfer/1024,
            (t_xfer==0)?0:((float)hptr->xfer/t_xfer)*100.0,hptr->visit,
            (t_visit==0)?0:((float)hptr->visit/t_visit)*100.0,
            hptr->string);
         h_grp--;
      }
   }

   if (i) fprintf(out_fp,"\n");

   /* Now do individual sites (if any) */
   pointer=h_array;
   if (!hide_sites) while(h_reg)
   {
      hptr=*pointer++;
      if (hptr->flag == OBJ_REG)
      {
         fprintf(out_fp,
            "%-8llu %6.02f%%  %8llu %6.02f%%  %8.0f %6.02f%%  "            \
            "%8llu %6.02f%%  %s\n",
            hptr->count,
            (t_hit==0)?0:((float)hptr->count/t_hit)*100.0,hptr->files,
            (t_file==0)?0:((float)hptr->files/t_file)*100.0,hptr->xfer/1024,
            (t_xfer==0)?0:((float)hptr->xfer/t_xfer)*100.0,hptr->visit,
            (t_visit==0)?0:((float)hptr->visit/t_visit)*100.0,
            hptr->string);
         h_reg--;
      }
   }

   fprintf(out_fp,"
\n"); write_html_tail(out_fp); fclose(out_fp); return 1; } /*********************************************/ /* TOP_URLS_TABLE - generate top n table */ /*********************************************/ void top_urls_table(int flag) { u_int64_t cnt=0,u_reg=0,u_grp=0,u_hid=0, tot_num; int i; UNODEPTR uptr, *pointer; cnt=a_ctr; pointer=u_array; while (cnt--) { /* calculate totals */ switch ( (int)((UNODEPTR)(*pointer)->flag) ) { case OBJ_REG: u_reg++; break; case OBJ_GRP: u_grp++; break; case OBJ_HIDE: u_hid++; break; } pointer++; } if ( (tot_num=u_reg+u_grp)==0 ) return; /* split if none */ i=(flag)?ntop_urlsK:ntop_urls; /* Hits or KBytes?? */ if (tot_num > i) tot_num = i; /* get max to do... */ if ((!flag) || (flag&&!ntop_urls)) /* now do tag */ fprintf(out_fp,"\n"); fprintf(out_fp,"\n"); fprintf(out_fp,"\n"); if (flag) fprintf(out_fp,"\n", GREY,msg_top_top,tot_num,msg_top_of, t_url,msg_top_u,msg_h_by,msg_h_xfer); else fprintf(out_fp,"\n", GREY,msg_top_top,tot_num,msg_top_of,t_url,msg_top_u); fprintf(out_fp,"\n"); fprintf(out_fp,"\n",GREY); fprintf(out_fp,"\n", HITCOLOR,msg_h_hits); fprintf(out_fp,"\n", KBYTECOLOR,msg_h_xfer); fprintf(out_fp,"\n", MISCCOLOR,msg_h_url); fprintf(out_fp,"\n"); pointer=u_array; i=0; while (tot_num) { uptr=*pointer++; /* point to the URL node */ if (uptr->flag != OBJ_HIDE) { /* shade grouping? */ if (shade_groups && (uptr->flag==OBJ_GRP)) fprintf(out_fp,"\n", GRPCOLOR); else fprintf(out_fp,"\n"); fprintf(out_fp, "\n" \ "\n"\ "\n" \ "\n"\ "\n" \ "\n", uptr->string); else fprintf(out_fp,"%s\n",uptr->string); } else { /* check for a service prefix (ie: http://) */ if (strstr(uptr->string,"://")!=NULL) fprintf(out_fp,"%s\n", uptr->string,uptr->string); else { if (log_type == LOG_FTP) /* FTP log? */ fprintf(out_fp,"%s\n",uptr->string); else { /* Web log */ if (use_https) /* secure server mode, use https:// */ fprintf(out_fp, "%s\n", hname,uptr->string,uptr->string); else /* otherwise use standard 'http://' */ fprintf(out_fp, "%s\n", hname,uptr->string,uptr->string); } } } tot_num--; i++; } } fprintf(out_fp,"\n"); if ((!flag) || (flag&&!ntop_urls)) { if ( (all_urls) && ((u_reg+u_grp)>ntop_urls) ) { if (all_urls_page(u_reg, u_grp)) { fprintf(out_fp,"",GRPCOLOR); fprintf(out_fp,"\n",msg_v_urls); if (flag) /* do we need to sort first? */ qsort(u_array,a_ctr,sizeof(UNODEPTR),qs_url_cmph); } } } fprintf(out_fp,"
" \ "%s %llu %s %llu %s %s %s
" \ "%s %llu %s %llu %s
" \ "#" \ "%s" \ "%s" \ "%s
%d%llu%3.02f%%%.0f%3.02f%%", i+1,uptr->count, (t_hit==0)?0:((float)uptr->count/t_hit)*100.0, uptr->xfer/1024, (t_xfer==0)?0:((float)uptr->xfer/t_xfer)*100.0); if (uptr->flag==OBJ_GRP) { if (hlite_groups) fprintf(out_fp,"%s
\n"); fprintf(out_fp,""); fprintf(out_fp,"", cur_year,cur_month,html_ext); fprintf(out_fp,"%s
\n

\n"); } /*********************************************/ /* ALL_URLS_PAGE - HTML page of all urls */ /*********************************************/ int all_urls_page(u_int64_t u_reg, u_int64_t u_grp) { UNODEPTR uptr, *pointer; char url_fname[256], buffer[256]; FILE *out_fp; int i=(u_grp)?1:0; /* generate file name */ snprintf(url_fname,sizeof(url_fname),"url_%04d%02d.%s", cur_year,cur_month,html_ext); /* open file */ if ( (out_fp=open_out_file(url_fname))==NULL ) return 0; snprintf(buffer,sizeof(buffer),"%s %d - %s", l_month[cur_month-1],cur_year,msg_h_url); write_html_head(buffer, out_fp); fprintf(out_fp,"

\n");

   fprintf(out_fp," %12s      %12s      %s\n",
           msg_h_hits,msg_h_xfer,msg_h_url);
   fprintf(out_fp,"----------------  ----------------  " \
                  "--------------------\n\n");

   /* do groups first (if any) */
   pointer=u_array;
   while (u_grp)
   {
      uptr=*pointer++;
      if (uptr->flag == OBJ_GRP)
      {
         fprintf(out_fp,"%-8llu %6.02f%%  %8.0f %6.02f%%  %s\n",
            uptr->count,
            (t_hit==0)?0:((float)uptr->count/t_hit)*100.0,
            uptr->xfer/1024,
            (t_xfer==0)?0:((float)uptr->xfer/t_xfer)*100.0,
            uptr->string);
         u_grp--;
      }
   }

   if (i) fprintf(out_fp,"\n");

   /* now do invididual sites (if any) */
   pointer=u_array;
   while (u_reg)
   {
      uptr=*pointer++;
      if (uptr->flag == OBJ_REG)
      {
         fprintf(out_fp,"%-8llu %6.02f%%  %8.0f %6.02f%%  %s\n",
            uptr->count,
            (t_hit==0)?0:((float)uptr->count/t_hit)*100.0,
            uptr->xfer/1024,
            (t_xfer==0)?0:((float)uptr->xfer/t_xfer)*100.0,
            uptr->string);
         u_reg--;
      }
   }

   fprintf(out_fp,"
\n"); write_html_tail(out_fp); fclose(out_fp); return 1; } /*********************************************/ /* TOP_ENTRY_TABLE - top n entry/exit urls */ /*********************************************/ void top_entry_table(int flag) { u_int64_t cnt=0, u_entry=0, u_exit=0, tot_num; u_int64_t t_entry=0, t_exit=0; int i; UNODEPTR uptr, *pointer; cnt=a_ctr; pointer=u_array; while (cnt--) { if ( (int)((UNODEPTR)(*pointer)->flag) == OBJ_REG ) { if ( (u_int64_t)(((UNODEPTR)(*pointer))->entry) ) { u_entry++; t_entry+=(u_int64_t)(((UNODEPTR)(*pointer))->entry); } if ( (u_int64_t)(((UNODEPTR)(*pointer))->exit) ) { u_exit++; t_exit +=(u_int64_t)(((UNODEPTR)(*pointer))->exit); } } pointer++; } /* calculate how many we have */ tot_num=(flag)?u_exit:u_entry; if (flag) { if (tot_num > ntop_exit ) tot_num=ntop_exit; } else { if (tot_num > ntop_entry) tot_num=ntop_entry; } /* return if none to do */ if (!tot_num) return; if (flag) fprintf(out_fp,"\n"); /* do anchor tag */ else fprintf(out_fp,"\n"); fprintf(out_fp,"\n"); fprintf(out_fp,"\n"); fprintf(out_fp,"\n", GREY,msg_top_top,tot_num,msg_top_of, (flag)?u_exit:u_entry,(flag)?msg_top_ex:msg_top_en); fprintf(out_fp,"\n"); fprintf(out_fp,"\n", GREY); fprintf(out_fp,"\n", HITCOLOR,msg_h_hits); fprintf(out_fp,"\n", VISITCOLOR,msg_h_visits); fprintf(out_fp,"\n", MISCCOLOR,msg_h_url); fprintf(out_fp,"\n"); pointer=u_array; i=0; while (tot_num) { uptr=*pointer++; if (uptr->flag != OBJ_HIDE) { fprintf(out_fp,"\n"); fprintf(out_fp, "\n" \ "\n"\ "\n" \ "\n"\ "\n" \ "\n", uptr->string,uptr->string); else { if (use_https) /* secure server mode, use https:// */ fprintf(out_fp, "%s\n", hname,uptr->string,uptr->string); else /* otherwise use standard 'http://' */ fprintf(out_fp, "%s\n", hname,uptr->string,uptr->string); } tot_num--; i++; } } fprintf(out_fp,"\n"); fprintf(out_fp,"
" \ "%s %llu %s %llu %s
" \ "#" \ "%s" \ "%s" \ "%s
%d%llu%3.02f%%%llu%3.02f%%", i+1,uptr->count, (t_hit==0)?0:((float)uptr->count/t_hit)*100.0, (flag)?uptr->exit:uptr->entry, (flag)?((t_exit==0)?0:((float)uptr->exit/t_exit)*100.0) :((t_entry==0)?0:((float)uptr->entry/t_entry)*100.0)); /* check for a service prefix (ie: http://) */ if (strstr(uptr->string,"://")!=NULL) fprintf(out_fp, "%s
\n

\n"); } /*********************************************/ /* TOP_REFS_TABLE - generate top n table */ /*********************************************/ void top_refs_table() { u_int64_t cnt=0, r_reg=0, r_grp=0, r_hid=0, tot_num; int i; RNODEPTR rptr, *pointer; if (t_ref==0) return; /* return if none to process */ cnt=a_ctr; pointer=r_array; while(cnt--) { /* calculate totals */ switch ( (int)((RNODEPTR)(*pointer)->flag) ) { case OBJ_REG: r_reg++; break; case OBJ_HIDE: r_hid++; break; case OBJ_GRP: r_grp++; break; } pointer++; } if ( (tot_num=r_reg+r_grp)==0 ) return; /* split if none */ if (tot_num > ntop_refs) tot_num=ntop_refs; /* get max to do... */ fprintf(out_fp,"\n"); fprintf(out_fp,"\n"); fprintf(out_fp,"\n"); fprintf(out_fp,"\n", GREY, msg_top_top, tot_num, msg_top_of, t_ref, msg_top_r); fprintf(out_fp,"\n"); fprintf(out_fp,"\n", GREY); fprintf(out_fp,"\n", HITCOLOR,msg_h_hits); fprintf(out_fp,"\n", MISCCOLOR,msg_h_ref); fprintf(out_fp,"\n"); pointer=r_array; i=0; while(tot_num) { rptr=*pointer++; if (rptr->flag != OBJ_HIDE) { /* shade grouping? */ if (shade_groups && (rptr->flag==OBJ_GRP)) fprintf(out_fp,"\n", GRPCOLOR); else fprintf(out_fp,"\n"); fprintf(out_fp, "\n" \ "\n" \ "\n" \ "\n"); tot_num--; i++; } } fprintf(out_fp,"\n"); if ( (all_refs) && ((r_reg+r_grp)>ntop_refs) ) { if (all_refs_page(r_reg, r_grp)) { fprintf(out_fp,"",GRPCOLOR); fprintf(out_fp,"\n",msg_v_refs); } } fprintf(out_fp,"
" \ "%s %llu %s %llu %s
" \ "#" \ "%s" \ "%s
%d%llu%3.02f%%", i+1,rptr->count, (t_hit==0)?0:((float)rptr->count/t_hit)*100.0); if (rptr->flag==OBJ_GRP) { if (hlite_groups) fprintf(out_fp,"%s",rptr->string); else fprintf(out_fp,"%s",rptr->string); } else { /* only link if enabled and has a service prefix */ if ( (strstr(rptr->string,"://")!=NULL) && link_referrer ) fprintf(out_fp,"%s", rptr->string, rptr->string); else fprintf(out_fp,"%s", rptr->string); } fprintf(out_fp,"
\n"); fprintf(out_fp,""); fprintf(out_fp,"", cur_year,cur_month,html_ext); fprintf(out_fp,"%s
\n

\n"); } /*********************************************/ /* ALL_REFS_PAGE - HTML page of all refs */ /*********************************************/ int all_refs_page(u_int64_t r_reg, u_int64_t r_grp) { RNODEPTR rptr, *pointer; char ref_fname[256], buffer[256]; FILE *out_fp; int i=(r_grp)?1:0; /* generate file name */ snprintf(ref_fname,sizeof(ref_fname),"ref_%04d%02d.%s", cur_year,cur_month,html_ext); /* open file */ if ( (out_fp=open_out_file(ref_fname))==NULL ) return 0; snprintf(buffer,sizeof(buffer),"%s %d - %s", l_month[cur_month-1],cur_year,msg_h_ref); write_html_head(buffer, out_fp); fprintf(out_fp,"

\n");

   fprintf(out_fp," %12s      %s\n",msg_h_hits,msg_h_ref);
   fprintf(out_fp,"----------------  --------------------\n\n");

   /* do groups first (if any) */
   pointer=r_array;
   while(r_grp)
   {
      rptr=*pointer++;
      if (rptr->flag == OBJ_GRP)
      {
         fprintf(out_fp,"%-8llu %6.02f%%  %s\n",
            rptr->count,
            (t_hit==0)?0:((float)rptr->count/t_hit)*100.0,
            rptr->string);
         r_grp--;
      }
   }

   if (i) fprintf(out_fp,"\n");

   pointer=r_array;
   while(r_reg)
   {
      rptr=*pointer++;
      if (rptr->flag == OBJ_REG)
      {
         fprintf(out_fp,"%-8llu %6.02f%%  %s\n",
            rptr->count,
            (t_hit==0)?0:((float)rptr->count/t_hit)*100.0,
            rptr->string);
         r_reg--;
      }
   }

   fprintf(out_fp,"
\n"); write_html_tail(out_fp); fclose(out_fp); return 1; } /*********************************************/ /* TOP_AGENTS_TABLE - generate top n table */ /*********************************************/ void top_agents_table() { u_int64_t cnt, a_reg=0, a_grp=0, a_hid=0, tot_num; int i; ANODEPTR aptr, *pointer; if (t_agent == 0) return; /* don't bother if we don't have any */ cnt=a_ctr; pointer=a_array; while(cnt--) { /* calculate totals */ switch ( (int)((ANODEPTR)(*pointer)->flag) ) { case OBJ_REG: a_reg++; break; case OBJ_GRP: a_grp++; break; case OBJ_HIDE: a_hid++; break; } pointer++; } if ( (tot_num=a_reg+a_grp)==0 ) return; /* split if none */ if (tot_num > ntop_agents) tot_num=ntop_agents; /* get max to do... */ fprintf(out_fp,"\n"); fprintf(out_fp,"\n"); fprintf(out_fp,"\n"); fprintf(out_fp,"\n", GREY, msg_top_top, tot_num, msg_top_of, t_agent, msg_top_a); fprintf(out_fp,"\n"); fprintf(out_fp,"\n", GREY); fprintf(out_fp,"\n", HITCOLOR,msg_h_hits); fprintf(out_fp,"\n", MISCCOLOR,msg_h_agent); fprintf(out_fp,"\n"); pointer=a_array; i=0; while(tot_num) { aptr=*pointer++; if (aptr->flag != OBJ_HIDE) { /* shade grouping? */ if (shade_groups && (aptr->flag==OBJ_GRP)) fprintf(out_fp,"\n", GRPCOLOR); else fprintf(out_fp,"\n"); fprintf(out_fp, "\n" \ "\n"\ "\n" \ "\n", aptr->string); else fprintf(out_fp,"%s\n", aptr->string); tot_num--; i++; } } fprintf(out_fp,"\n"); if ( (all_agents) && ((a_reg+a_grp)>ntop_agents) ) { if (all_agents_page(a_reg, a_grp)) { fprintf(out_fp,"",GRPCOLOR); fprintf(out_fp,"\n",msg_v_agents); } } fprintf(out_fp,"
" \ "%s %llu %s %llu %s
" \ "#" \ "%s" \ "%s
%d%llu%3.02f%%", i+1,aptr->count, (t_hit==0)?0:((float)aptr->count/t_hit)*100.0); if ((aptr->flag==OBJ_GRP)&&hlite_groups) fprintf(out_fp,"%s
\n"); fprintf(out_fp,""); fprintf(out_fp,"", cur_year,cur_month,html_ext); fprintf(out_fp,"%s
\n

\n"); } /*********************************************/ /* ALL_AGENTS_PAGE - HTML user agent page */ /*********************************************/ int all_agents_page(u_int64_t a_reg, u_int64_t a_grp) { ANODEPTR aptr, *pointer; char agent_fname[256], buffer[256]; FILE *out_fp; int i=(a_grp)?1:0; /* generate file name */ snprintf(agent_fname,sizeof(agent_fname),"agent_%04d%02d.%s", cur_year,cur_month,html_ext); /* open file */ if ( (out_fp=open_out_file(agent_fname))==NULL ) return 0; snprintf(buffer,sizeof(buffer),"%s %d - %s", l_month[cur_month-1],cur_year,msg_h_agent); write_html_head(buffer, out_fp); fprintf(out_fp,"

\n");

   fprintf(out_fp," %12s      %s\n",msg_h_hits,msg_h_agent);
   fprintf(out_fp,"----------------  ----------------------\n\n");

   /* do groups first (if any) */
   pointer=a_array;
   while(a_grp)
   {
      aptr=*pointer++;
      if (aptr->flag == OBJ_GRP)
      {
         fprintf(out_fp,"%-8llu %6.02f%%  %s\n",
             aptr->count,
             (t_hit==0)?0:((float)aptr->count/t_hit)*100.0,
             aptr->string);
         a_grp--;
      }
   }

   if (i) fprintf(out_fp,"\n");

   pointer=a_array;
   while(a_reg)
   {
      aptr=*pointer++;
      if (aptr->flag == OBJ_REG)
      {
         fprintf(out_fp,"%-8llu %6.02f%%  %s\n",
             aptr->count,
             (t_hit==0)?0:((float)aptr->count/t_hit)*100.0,
             aptr->string);
         a_reg--;
      }
   }

   fprintf(out_fp,"
\n"); write_html_tail(out_fp); fclose(out_fp); return 1; } /*********************************************/ /* TOP_SEARCH_TABLE - generate top n table */ /*********************************************/ void top_search_table() { u_int64_t cnt,t_val=0, tot_num; int i; SNODEPTR sptr, *pointer; if (a_ctr==0) return; /* don't bother if none to do */ cnt=tot_num=a_ctr; pointer=s_array; while(cnt--) { t_val+=(u_int64_t)(((SNODEPTR)(*pointer))->count); pointer++; } if ( tot_num > ntop_search) tot_num=ntop_search; fprintf(out_fp,"\n"); fprintf(out_fp,"\n"); fprintf(out_fp,"\n"); fprintf(out_fp,"\n", GREY, msg_top_top, tot_num, msg_top_of, a_ctr, msg_top_sr); fprintf(out_fp,"\n"); fprintf(out_fp,"\n", GREY); fprintf(out_fp,"\n", HITCOLOR,msg_h_hits); fprintf(out_fp,"\n", MISCCOLOR,msg_h_search); fprintf(out_fp,"\n"); pointer=s_array; i=0; while(tot_num) { sptr=*pointer++; fprintf(out_fp, "\n" \ "\n" \ "\n"\ "\n" \ "\n",sptr->string); tot_num--; i++; } fprintf(out_fp,"\n"); if ( (all_search) && (a_ctr>ntop_search) ) { if (all_search_page(a_ctr, t_val)) { fprintf(out_fp,"",GRPCOLOR); fprintf(out_fp,"\n",msg_v_search); } } fprintf(out_fp,"
" \ "%s %llu %s %llu %s
" \ "#" \ "%s" \ "%s
%d%llu%3.02f%%", i+1,sptr->count, (t_val==0)?0:((float)sptr->count/t_val)*100.0); fprintf(out_fp,"%s
\n"); fprintf(out_fp,""); fprintf(out_fp,"", cur_year,cur_month,html_ext); fprintf(out_fp,"%s
\n

\n"); } /*********************************************/ /* ALL_SEARCH_PAGE - HTML for search strings */ /*********************************************/ int all_search_page(u_int64_t tot_num, u_int64_t t_val) { SNODEPTR sptr, *pointer; char search_fname[256], buffer[256]; FILE *out_fp; if (!tot_num) return 0; /* generate file name */ snprintf(search_fname,sizeof(search_fname),"search_%04d%02d.%s", cur_year,cur_month,html_ext); /* open file */ if ( (out_fp=open_out_file(search_fname))==NULL ) return 0; snprintf(buffer,sizeof(buffer),"%s %d - %s", l_month[cur_month-1],cur_year,msg_h_search); write_html_head(buffer, out_fp); fprintf(out_fp,"

\n");

   fprintf(out_fp," %12s      %s\n",msg_h_hits,msg_h_search);
   fprintf(out_fp,"----------------  ----------------------\n\n");

   pointer=s_array;
   while(tot_num)
   {
      sptr=*pointer++;
      fprintf(out_fp,"%-8llu %6.02f%%  %s\n",
         sptr->count,
         (t_val==0)?0:((float)sptr->count/t_val)*100.0,
         sptr->string);
      tot_num--;
   }
   fprintf(out_fp,"
\n"); write_html_tail(out_fp); fclose(out_fp); return 1; } /*********************************************/ /* TOP_USERS_TABLE - generate top n table */ /*********************************************/ void top_users_table() { u_int64_t cnt=0, i_reg=0, i_grp=0, i_hid=0, tot_num; int i; INODEPTR iptr, *pointer; cnt=a_ctr; pointer=i_array; while(cnt--) { /* calculate totals */ switch ( (int)((INODEPTR)(*pointer)->flag) ) { case OBJ_REG: i_reg++; break; case OBJ_GRP: i_grp++; break; case OBJ_HIDE: i_hid++; break; } pointer++; } if ( (tot_num=i_reg+i_grp)==0 ) return; /* split if none */ if (tot_num > ntop_users) tot_num = ntop_users; fprintf(out_fp,"\n"); /* now do tag */ fprintf(out_fp,"\n"); fprintf(out_fp,"\n"); fprintf(out_fp,"\n", GREY,msg_top_top, tot_num, msg_top_of, t_user, msg_top_i); fprintf(out_fp,"\n"); fprintf(out_fp,"\n",GREY); fprintf(out_fp,"\n",HITCOLOR,msg_h_hits); fprintf(out_fp,"\n",FILECOLOR,msg_h_files); fprintf(out_fp,"\n",KBYTECOLOR,msg_h_xfer); fprintf(out_fp,"\n",VISITCOLOR,msg_h_visits); fprintf(out_fp,"\n",MISCCOLOR,msg_h_uname); fprintf(out_fp,"\n"); pointer=i_array; i=0; while(tot_num) { iptr=*pointer++; if (iptr->flag != OBJ_HIDE) { /* shade grouping? */ if (shade_groups && (iptr->flag==OBJ_GRP)) fprintf(out_fp,"\n", GRPCOLOR); else fprintf(out_fp,"\n"); fprintf(out_fp, "\n" \ "\n" \ "\n" \ "\n" \ "\n" \ "\n" \ "\n" \ "\n" \ "\n" \ "\n", iptr->string); else fprintf(out_fp,"%s\n", iptr->string); tot_num--; i++; } } fprintf(out_fp,"\n"); if ( (all_users) && ((i_reg+i_grp)>ntop_users) ) { if (all_users_page(i_reg, i_grp)) { fprintf(out_fp,"",GRPCOLOR); fprintf(out_fp,"\n",msg_v_users); } } fprintf(out_fp,"
" \ "%s %llu %s %llu %s
" \ "#" \ "%s" \ "%s" \ "%s" \ "%s" \ "%s
%d%llu%3.02f%%%llu%3.02f%%%.0f%3.02f%%%llu%3.02f%%", i+1,iptr->count, (t_hit==0)?0:((float)iptr->count/t_hit)*100.0,iptr->files, (t_file==0)?0:((float)iptr->files/t_file)*100.0,iptr->xfer/1024, (t_xfer==0)?0:((float)iptr->xfer/t_xfer)*100.0,iptr->visit, (t_visit==0)?0:((float)iptr->visit/t_visit)*100.0); if ((iptr->flag==OBJ_GRP)&&hlite_groups) fprintf(out_fp,"%s
\n"); fprintf(out_fp,""); fprintf(out_fp,"", cur_year,cur_month,html_ext); fprintf(out_fp,"%s
\n

\n"); } /*********************************************/ /* ALL_USERS_PAGE - HTML of all usernames */ /*********************************************/ int all_users_page(u_int64_t i_reg, u_int64_t i_grp) { INODEPTR iptr, *pointer; char user_fname[256], buffer[256]; FILE *out_fp; int i=(i_grp)?1:0; /* generate file name */ snprintf(user_fname,sizeof(user_fname),"user_%04d%02d.%s", cur_year,cur_month,html_ext); /* open file */ if ( (out_fp=open_out_file(user_fname))==NULL ) return 0; snprintf(buffer,sizeof(buffer),"%s %d - %s", l_month[cur_month-1],cur_year,msg_h_uname); write_html_head(buffer, out_fp); fprintf(out_fp,"

\n");

   fprintf(out_fp," %12s      %12s      %12s      %12s      %s\n",
           msg_h_hits, msg_h_files, msg_h_xfer, msg_h_visits, msg_h_uname);
   fprintf(out_fp,"----------------  ----------------  ----------------  " \
                  "----------------  --------------------\n\n");

   /* Do groups first (if any) */
   pointer=i_array;
   while(i_grp)
   {
      iptr=*pointer++;
      if (iptr->flag == OBJ_GRP)
      {
         fprintf(out_fp,
      "%-8llu %6.02f%%  %8llu %6.02f%%  %8.0f %6.02f%%  %8llu %6.02f%%  %s\n",
            iptr->count,
            (t_hit==0)?0:((float)iptr->count/t_hit)*100.0,iptr->files,
            (t_file==0)?0:((float)iptr->files/t_file)*100.0,iptr->xfer/1024,
            (t_xfer==0)?0:((float)iptr->xfer/t_xfer)*100.0,iptr->visit,
            (t_visit==0)?0:((float)iptr->visit/t_visit)*100.0,
            iptr->string);
         i_grp--;
      }
   }

   if (i) fprintf(out_fp,"\n");

   /* Now do individual users (if any) */
   pointer=i_array;
   while(i_reg)
   {
      iptr=*pointer++;
      if (iptr->flag == OBJ_REG)
      {
         fprintf(out_fp,
      "%-8llu %6.02f%%  %8llu %6.02f%%  %8.0f %6.02f%%  %8llu %6.02f%%  %s\n",
            iptr->count,
            (t_hit==0)?0:((float)iptr->count/t_hit)*100.0,iptr->files,
            (t_file==0)?0:((float)iptr->files/t_file)*100.0,iptr->xfer/1024,
            (t_xfer==0)?0:((float)iptr->xfer/t_xfer)*100.0,iptr->visit,
            (t_visit==0)?0:((float)iptr->visit/t_visit)*100.0,
            iptr->string);
         i_reg--;
      }
   }

   fprintf(out_fp,"
\n"); write_html_tail(out_fp); fclose(out_fp); return 1; } /*********************************************/ /* TOP_CTRY_TABLE - top countries table */ /*********************************************/ void top_ctry_table() { int i,j,x,tot_num=0,tot_ctry=0; int ctry_fnd=0; u_int64_t idx; HNODEPTR hptr; char *domain; u_int64_t pie_data[10]; char *pie_legend[10]; char pie_title[48]; char pie_fname[48]; char flag_buf[256]; extern int ctry_graph; /* include external flag */ #ifdef USE_GEOIP extern int geoip; extern GeoIP *geo_fp; const char *geo_rc=NULL; #endif char geo_ctry[3]="--"; /* scan hash table adding up domain totals */ for (i=0;iflag != OBJ_GRP) /* ignore group totals */ { if (isipaddr(hptr->string)>0) { idx=0; /* unresolved/unknown */ #ifdef USE_DNS if (geodb) { /* Lookup IP address here, turn into idx */ geodb_get_cc(geo_db, hptr->string, geo_ctry); if (geo_ctry[0]=='-') { if (debug_mode) fprintf(stderr,"GeoDB: %s unknown!\n",hptr->string); } else idx=ctry_idx(geo_ctry); } #endif #ifdef USE_GEOIP if (geoip) { /* Lookup IP address here, turn into idx */ geo_rc=GeoIP_country_code_by_addr(geo_fp, hptr->string); if (geo_rc==NULL||geo_rc[0]=='\0'||geo_rc[0]=='-') { if (debug_mode) fprintf(stderr,"GeoIP: %s unknown (returns '%s')\n", hptr->string,(geo_rc==NULL)?"null":geo_rc); } else { /* index returned geo_ctry */ geo_ctry[0]=tolower(geo_rc[0]); geo_ctry[1]=tolower(geo_rc[1]); idx=ctry_idx(geo_ctry); } } #endif /* USE_GEOIP */ } else { /* resolved hostname.. try to get TLD */ domain = hptr->string+strlen(hptr->string)-1; while ( (*domain!='.')&&(domain!=hptr->string)) domain--; if (domain++==hptr->string) idx=0; else idx=ctry_idx(domain); } if (idx!=0) { ctry_fnd=0; for (j=0;ctry[j].desc;j++) { if (idx==ctry[j].idx) { ctry[j].count+=hptr->count; ctry[j].files+=hptr->files; ctry[j].xfer +=hptr->xfer; ctry_fnd=1; break; } } } if (!ctry_fnd || idx==0) { ctry[0].count+=hptr->count; ctry[0].files+=hptr->files; ctry[0].xfer +=hptr->xfer; } } hptr=hptr->next; } } for (i=0;ctry[i].desc;i++) { if (ctry[i].count!=0) tot_ctry++; for (j=0;j top_ctrys[j]->count) { for (x=ntop_ctrys-1;x>j;x--) top_ctrys[x]=top_ctrys[x-1]; top_ctrys[x]=&ctry[i]; break; } } } } /* put our anchor tag first... */ fprintf(out_fp,"
\n"); /* generate pie chart if needed */ if (ctry_graph) { for (i=0;i<10;i++) pie_data[i]=0; /* init data array */ if (ntop_ctrys<10) j=ntop_ctrys; else j=10; /* ensure data size */ for (i=0;icount; /* load the array */ pie_legend[i]=top_ctrys[i]->desc; } snprintf(pie_title,sizeof(pie_title),"%s %s %d", msg_ctry_use,l_month[cur_month-1],cur_year); sprintf(pie_fname,"ctry_usage_%04d%02d.png",cur_year,cur_month); pie_chart(pie_fname,pie_title,t_hit,pie_data,pie_legend); /* do it */ /* put the image tag in the page */ fprintf(out_fp,"\"%s\"

\n",pie_fname,pie_title); } /* Now do the table */ for (i=0;icount!=0) tot_num++; fprintf(out_fp,"\n"); fprintf(out_fp,"\n"); fprintf(out_fp,"\n", GREY,msg_top_top,tot_num,msg_top_of,tot_ctry,msg_top_c); fprintf(out_fp,"\n"); fprintf(out_fp,"\n",GREY); fprintf(out_fp,"\n",HITCOLOR,msg_h_hits); fprintf(out_fp,"\n",FILECOLOR,msg_h_files); fprintf(out_fp,"\n",KBYTECOLOR,msg_h_xfer); fprintf(out_fp,"\n",MISCCOLOR,msg_h_ctry); fprintf(out_fp,"\n"); for (i=0;iidx)); if (strlen(domain)<3 && idx!=0) /* only to ccTLDs */ { if ( domain[0]!='a'||domain[1]!='p' ) /* all but 'ap' */ snprintf(flag_buf,sizeof(flag_buf), "\"%s\" ", flag_dir,domain,top_ctrys[i]->desc); } } if (top_ctrys[i]->count!=0) fprintf(out_fp,"" \ "\n" \ "\n"\ "\n" \ "\n"\ "\n" \ "\n"\ "\n" \ "\n", i+1,top_ctrys[i]->count, (t_hit==0)?0:((float)top_ctrys[i]->count/t_hit)*100.0, top_ctrys[i]->files, (t_file==0)?0:((float)top_ctrys[i]->files/t_file)*100.0, top_ctrys[i]->xfer/1024, (t_xfer==0)?0:((float)top_ctrys[i]->xfer/t_xfer)*100.0, flag_buf,top_ctrys[i]->desc); } fprintf(out_fp,"\n"); fprintf(out_fp,"
" \ "%s %d %s %d %s
" \ "#" \ "%s" \ "%s" \ "%s" \ "%s
%d%llu%3.02f%%%llu%3.02f%%%.0f%3.02f%%%s%s" \ "
\n

\n"); } /*********************************************/ /* DUMP_ALL_SITES - dump sites to tab file */ /*********************************************/ void dump_all_sites() { HNODEPTR hptr, *pointer; FILE *out_fp; char filename[256]; u_int64_t cnt=a_ctr; /* generate file name */ snprintf(filename,sizeof(filename),"%s/site_%04d%02d.%s", (dump_path)?dump_path:".",cur_year,cur_month,dump_ext); /* open file */ if ( (out_fp=open_out_file(filename))==NULL ) return; /* need a header? */ if (dump_header) { fprintf(out_fp,"%s\t%s\t%s\t%s\t%s\n", msg_h_hits,msg_h_files,msg_h_xfer,msg_h_visits,msg_h_hname); } /* dump 'em */ pointer=h_array; while (cnt) { hptr=*pointer++; if (hptr->flag != OBJ_GRP) { fprintf(out_fp, "%llu\t%llu\t%.0f\t%llu\t%s\n", hptr->count,hptr->files,hptr->xfer/1024, hptr->visit,hptr->string); } cnt--; } fclose(out_fp); return; } /*********************************************/ /* DUMP_ALL_URLS - dump all urls to tab file */ /*********************************************/ void dump_all_urls() { UNODEPTR uptr, *pointer; FILE *out_fp; char filename[256]; u_int64_t cnt=a_ctr; /* generate file name */ snprintf(filename,sizeof(filename),"%s/url_%04d%02d.%s", (dump_path)?dump_path:".",cur_year,cur_month,dump_ext); /* open file */ if ( (out_fp=open_out_file(filename))==NULL ) return; /* need a header? */ if (dump_header) { fprintf(out_fp,"%s\t%s\t%s\n",msg_h_hits,msg_h_xfer,msg_h_url); } /* dump 'em */ pointer=u_array; while (cnt) { uptr=*pointer++; if (uptr->flag != OBJ_GRP) { fprintf(out_fp,"%llu\t%.0f\t%s\n", uptr->count,uptr->xfer/1024,uptr->string); } cnt--; } fclose(out_fp); return; } /*********************************************/ /* DUMP_ALL_REFS - dump all refs to tab file */ /*********************************************/ void dump_all_refs() { RNODEPTR rptr, *pointer; FILE *out_fp; char filename[256]; u_int64_t cnt=a_ctr; /* generate file name */ snprintf(filename,sizeof(filename),"%s/ref_%04d%02d.%s", (dump_path)?dump_path:".",cur_year,cur_month,dump_ext); /* open file */ if ( (out_fp=open_out_file(filename))==NULL ) return; /* need a header? */ if (dump_header) { fprintf(out_fp,"%s\t%s\n",msg_h_hits,msg_h_ref); } /* dump 'em */ pointer=r_array; while(cnt) { rptr=*pointer++; if (rptr->flag != OBJ_GRP) { fprintf(out_fp,"%llu\t%s\n",rptr->count, rptr->string); } cnt--; } fclose(out_fp); return; } /*********************************************/ /* DUMP_ALL_AGENTS - dump agents htab file */ /*********************************************/ void dump_all_agents() { ANODEPTR aptr, *pointer; FILE *out_fp; char filename[256]; u_int64_t cnt=a_ctr; /* generate file name */ snprintf(filename,sizeof(filename),"%s/agent_%04d%02d.%s", (dump_path)?dump_path:".",cur_year,cur_month,dump_ext); /* open file */ if ( (out_fp=open_out_file(filename))==NULL ) return; /* need a header? */ if (dump_header) { fprintf(out_fp,"%s\t%s\n",msg_h_hits,msg_h_agent); } /* dump 'em */ pointer=a_array; while(cnt) { aptr=*pointer++; if (aptr->flag != OBJ_GRP) { fprintf(out_fp,"%llu\t%s\n",aptr->count,aptr->string); } cnt--; } fclose(out_fp); return; } /*********************************************/ /* DUMP_ALL_USERS - dump username tab file */ /*********************************************/ void dump_all_users() { INODEPTR iptr, *pointer; FILE *out_fp; char filename[256]; u_int64_t cnt=a_ctr; /* generate file name */ snprintf(filename,sizeof(filename),"%s/user_%04d%02d.%s", (dump_path)?dump_path:".",cur_year,cur_month,dump_ext); /* open file */ if ( (out_fp=open_out_file(filename))==NULL ) return; /* need a header? */ if (dump_header) { fprintf(out_fp,"%s\t%s\t%s\t%s\t%s\n", msg_h_hits,msg_h_files,msg_h_xfer,msg_h_visits,msg_h_uname); } /* dump 'em */ pointer=i_array; while(cnt) { iptr=*pointer++; if (iptr->flag != OBJ_GRP) { fprintf(out_fp, "%llu\t%llu\t%.0f\t%llu\t%s\n", iptr->count,iptr->files,iptr->xfer/1024, iptr->visit,iptr->string); } cnt--; } fclose(out_fp); return; } /*********************************************/ /* DUMP_ALL_SEARCH - dump search htab file */ /*********************************************/ void dump_all_search() { SNODEPTR sptr, *pointer; FILE *out_fp; char filename[256]; u_int64_t cnt=a_ctr; /* generate file name */ snprintf(filename,sizeof(filename),"%s/search_%04d%02d.%s", (dump_path)?dump_path:".",cur_year,cur_month,dump_ext); /* open file */ if ( (out_fp=open_out_file(filename))==NULL ) return; /* need a header? */ if (dump_header) { fprintf(out_fp,"%s\t%s\n",msg_h_hits,msg_h_search); } /* dump 'em */ pointer=s_array; while(cnt) { sptr=*pointer++; fprintf(out_fp,"%llu\t%s\n",sptr->count,sptr->string); cnt--; } fclose(out_fp); return; } /*********************************************/ /* WRITE_MAIN_INDEX - main index.html file */ /*********************************************/ int write_main_index() { /* create main index file */ int i,j,days_in_month; int s_year=hist[HISTSIZE-1].year; char index_fname[256]; char buffer[BUFSIZE]; u_int64_t m_hit=0; u_int64_t m_files=0; u_int64_t m_pages=0; u_int64_t m_visits=0; double m_xfer=0.0; double gt_hit=0.0; double gt_files=0.0; double gt_pages=0.0; double gt_xfer=0.0; double gt_visits=0.0; if (verbose>1) printf("%s\n",msg_gen_sum); snprintf(buffer,sizeof(buffer),"%s %s",msg_main_us,hname); year_graph6x("usage.png", buffer, hist); /* now do html stuff... */ snprintf(index_fname,sizeof(index_fname),"index.%s",html_ext); /* .htaccess file needed? */ if (htaccess) { if ((out_fp=fopen(".htaccess","wx")) != NULL) { fprintf(out_fp,"DirectoryIndex %s\n",index_fname); fclose(out_fp); } else { if (errno!=EEXIST && verbose) fprintf(stderr,"Error: Failed to create .htaccess file: %s\n", strerror(errno)); } } if ( (out_fp=open_out_file(index_fname)) == NULL) { if (verbose) fprintf(stderr,"%s %s!\n",msg_no_open,index_fname); return 1; } write_html_head(NULL, out_fp); /* year graph */ fprintf(out_fp,"\"%s\"

\n",buffer); /* month table */ fprintf(out_fp,"\n"); fprintf(out_fp,"\n"); fprintf(out_fp,"\n",msg_main_sum); fprintf(out_fp,"\n"); fprintf(out_fp,"\n",GREY,msg_h_mth); fprintf(out_fp,"\n",GREY,msg_main_da); fprintf(out_fp,"\n",GREY,msg_main_mt); fprintf(out_fp,"\n",HITCOLOR,msg_h_hits); fprintf(out_fp,"\n",FILECOLOR,msg_h_files); fprintf(out_fp,"\n",PAGECOLOR,msg_h_pages); fprintf(out_fp,"\n",VISITCOLOR,msg_h_visits); fprintf(out_fp,"\n",SITECOLOR,msg_h_sites); fprintf(out_fp,"\n",KBYTECOLOR,msg_h_xfer); fprintf(out_fp,"\n",VISITCOLOR,msg_h_visits); fprintf(out_fp,"\n",PAGECOLOR,msg_h_pages); fprintf(out_fp,"\n",FILECOLOR,msg_h_files); fprintf(out_fp,"\n",HITCOLOR,msg_h_hits); fprintf(out_fp,"\n"); for (i=HISTSIZE-1;i>=HISTSIZE-index_mths;i--) { if (hist[i].hit==0) { days_in_month=1; for (j=i;j>=0;j--) if (hist[j].hit!=0) break; if (j<0) break; } else days_in_month=(hist[i].lday-hist[i].fday)+1; /* Check for year change */ if (s_year!=hist[i].year) { /* Year Totals */ if (index_mths>16 && year_totals) { fprintf(out_fp,"\n", GRPCOLOR,s_year); fprintf(out_fp,"", GRPCOLOR, m_xfer); fprintf(out_fp,"", GRPCOLOR, m_visits); fprintf(out_fp,"", GRPCOLOR, m_pages); fprintf(out_fp,"", GRPCOLOR, m_files); fprintf(out_fp,"", GRPCOLOR, m_hit); m_xfer=0; m_visits=0; m_pages=0; m_files=0; m_hit=0; } /* Year Header */ s_year=hist[i].year; if (index_mths>16 && year_hdrs) fprintf(out_fp,"\n", GREY, s_year); } fprintf(out_fp,"\n", hist[i].year, hist[i].month, html_ext, s_month[hist[i].month-1], hist[i].year); else fprintf(out_fp,"%s %d\n", \ s_month[hist[i].month-1], hist[i].year); fprintf(out_fp,"\n", hist[i].hit/days_in_month); fprintf(out_fp,"\n", hist[i].files/days_in_month); fprintf(out_fp,"\n", hist[i].page/days_in_month); fprintf(out_fp,"\n", hist[i].visit/days_in_month); fprintf(out_fp,"\n", hist[i].site); fprintf(out_fp,"\n", hist[i].xfer); fprintf(out_fp,"\n", hist[i].visit); fprintf(out_fp,"\n", hist[i].page); fprintf(out_fp,"\n", hist[i].files); fprintf(out_fp,"", hist[i].hit); fprintf(out_fp,"\n"); gt_hit += hist[i].hit; gt_files += hist[i].files; gt_pages += hist[i].page; gt_xfer += hist[i].xfer; gt_visits+= hist[i].visit; m_hit += hist[i].hit; m_files += hist[i].files; m_pages += hist[i].page; m_visits+= hist[i].visit; m_xfer += hist[i].xfer; } if (index_mths>16 && year_totals) { fprintf(out_fp,"\n", GRPCOLOR,s_year); fprintf(out_fp,"", GRPCOLOR, m_xfer); fprintf(out_fp,"", GRPCOLOR, m_visits); fprintf(out_fp,"", GRPCOLOR, m_pages); fprintf(out_fp,"", GRPCOLOR, m_files); fprintf(out_fp,"", GRPCOLOR, m_hit); } fprintf(out_fp,"\n"); fprintf(out_fp,"\n",GREY,msg_h_totals); fprintf(out_fp,"\n",GREY,gt_xfer); fprintf(out_fp,"\n",GREY,gt_visits); fprintf(out_fp,"\n",GREY,gt_pages); fprintf(out_fp,"\n",GREY,gt_files); fprintf(out_fp,"\n",GREY,gt_hit); fprintf(out_fp,"\n"); fprintf(out_fp,"
",GREY); fprintf(out_fp,"%s
" \ "%s" \ "%s" \ "%s
" \ "%s" \ "%s" \ "%s" \ "%s" \ "%s" \ "%s" \ "%s" \ "%s" \ "%s" \ "%s
%04d" \ "%.0f" \ "%0llu" \ "%0llu" \ "%0llu" \ "%0llu
%04d
"); if (hist[i].hit!=0) fprintf(out_fp,"" \ "%s %d%llu%llu%llu%llu%llu%.0f%llu%llu%llu%llu
%04d" \ "%.0f" \ "%0llu" \ "%0llu" \ "%0llu" \ "%0llu
" \ "%s" \ "%.0f" \ "%.0f" \ "%.0f" \ "%.0f" \ "%.0f
\n"); write_html_tail(out_fp); fclose(out_fp); return 0; } /*********************************************/ /* QS_SITE_CMPH - QSort compare site by hits */ /*********************************************/ int qs_site_cmph(const void *cp1, const void *cp2) { u_int64_t t1, t2; t1=(*(HNODEPTR *)cp1)->count; t2=(*(HNODEPTR *)cp2)->count; if (t1!=t2) return (t2string, (*(HNODEPTR *)cp2)->string ); } /*********************************************/ /* QS_SITE_CMPK - QSort cmp site by bytes */ /*********************************************/ int qs_site_cmpk(const void *cp1, const void *cp2) { double t1, t2; t1=(*(HNODEPTR *)cp1)->xfer; t2=(*(HNODEPTR *)cp2)->xfer; if (t1!=t2) return (t2string, (*(HNODEPTR *)cp2)->string ); } /*********************************************/ /* QS_URL_CMPH - QSort compare URL by hits */ /*********************************************/ int qs_url_cmph(const void *cp1, const void *cp2) { u_int64_t t1, t2; t1=(*(UNODEPTR *)cp1)->count; t2=(*(UNODEPTR *)cp2)->count; if (t1!=t2) return (t2string, (*(UNODEPTR *)cp2)->string ); } /*********************************************/ /* QS_URL_CMPK - QSort compare URL by bytes */ /*********************************************/ int qs_url_cmpk(const void *cp1, const void *cp2) { double t1, t2; t1=(*(UNODEPTR *)cp1)->xfer; t2=(*(UNODEPTR *)cp2)->xfer; if (t1!=t2) return (t2string, (*(UNODEPTR *)cp2)->string ); } /*********************************************/ /* QS_URL_CMPN - QSort compare URL by entry */ /*********************************************/ int qs_url_cmpn(const void *cp1, const void *cp2) { double t1, t2; t1=(*(UNODEPTR *)cp1)->entry; t2=(*(UNODEPTR *)cp2)->entry; if (t1!=t2) return (t2string, (*(UNODEPTR *)cp2)->string ); } /*********************************************/ /* QS_URL_CMPX - QSort compare URL by exit */ /*********************************************/ int qs_url_cmpx(const void *cp1, const void *cp2) { double t1, t2; t1=(*(UNODEPTR *)cp1)->exit; t2=(*(UNODEPTR *)cp2)->exit; if (t1!=t2) return (t2string, (*(UNODEPTR *)cp2)->string ); } /*********************************************/ /* QS_REF_CMPH - QSort compare Refs by hits */ /*********************************************/ int qs_ref_cmph(const void *cp1, const void *cp2) { u_int64_t t1, t2; t1=(*(RNODEPTR *)cp1)->count; t2=(*(RNODEPTR *)cp2)->count; if (t1!=t2) return (t2string, (*(RNODEPTR *)cp2)->string ); } /*********************************************/ /* QS_AGNT_CMPH - QSort cmp Agents by hits */ /*********************************************/ int qs_agnt_cmph(const void *cp1, const void *cp2) { u_int64_t t1, t2; t1=(*(ANODEPTR *)cp1)->count; t2=(*(ANODEPTR *)cp2)->count; if (t1!=t2) return (t2string, (*(ANODEPTR *)cp2)->string ); } /*********************************************/ /* QS_SRCH_CMPH - QSort cmp srch str by hits */ /*********************************************/ int qs_srch_cmph(const void *cp1, const void *cp2) { u_int64_t t1, t2; t1=(*(SNODEPTR *)cp1)->count; t2=(*(SNODEPTR *)cp2)->count; if (t1!=t2) return (t2string, (*(SNODEPTR *)cp2)->string ); } /*********************************************/ /* QS_IDENT_CMPH - QSort cmp ident by hits */ /*********************************************/ int qs_ident_cmph(const void *cp1, const void *cp2) { u_int64_t t1, t2; t1=(*(INODEPTR *)cp1)->count; t2=(*(INODEPTR *)cp2)->count; if (t1!=t2) return (t2string, (*(INODEPTR *)cp2)->string ); } /*********************************************/ /* LOAD_SITE_ARRAY - load up the sort array */ /*********************************************/ u_int64_t load_site_array(HNODEPTR *pointer) { HNODEPTR hptr; int i; u_int64_t ctr = 0; /* load the array */ for (i=0;inext; } } return ctr; /* return number loaded */ } /*********************************************/ /* LOAD_URL_ARRAY - load up the sort array */ /*********************************************/ u_int64_t load_url_array(UNODEPTR *pointer) { UNODEPTR uptr; int i; u_int64_t ctr = 0; /* load the array */ for (i=0;inext; } } return ctr; /* return number loaded */ } /*********************************************/ /* LOAD_REF_ARRAY - load up the sort array */ /*********************************************/ u_int64_t load_ref_array(RNODEPTR *pointer) { RNODEPTR rptr; int i; u_int64_t ctr = 0; /* load the array */ for (i=0;inext; } } return ctr; /* return number loaded */ } /*********************************************/ /* LOAD_AGENT_ARRAY - load up the sort array */ /*********************************************/ u_int64_t load_agent_array(ANODEPTR *pointer) { ANODEPTR aptr; int i; u_int64_t ctr = 0; /* load the array */ for (i=0;inext; } } return ctr; /* return number loaded */ } /*********************************************/ /* LOAD_SRCH_ARRAY - load up the sort array */ /*********************************************/ u_int64_t load_srch_array(SNODEPTR *pointer) { SNODEPTR sptr; int i; u_int64_t ctr = 0; /* load the array */ for (i=0;inext; } } return ctr; /* return number loaded */ } /*********************************************/ /* LOAD_IDENT_ARRAY - load up the sort array */ /*********************************************/ u_int64_t load_ident_array(INODEPTR *pointer) { INODEPTR iptr; int i; u_int64_t ctr = 0; /* load the array */ for (i=0;inext; } } return ctr; /* return number loaded */ } /*********************************************/ /* OPEN_OUT_FILE - Open file for output */ /*********************************************/ FILE *open_out_file(char *filename) { struct stat out_stat; FILE *out_fp; /* stat the file */ if ( !(lstat(filename, &out_stat)) ) { /* check if the file a symlink */ if ( S_ISLNK(out_stat.st_mode) ) { if (verbose) fprintf(stderr,"%s %s (symlink)\n",msg_no_open,filename); return NULL; } } /* open the file... */ if ( (out_fp=fopen(filename,"w")) == NULL) { if (verbose) fprintf(stderr,"%s %s!\n",msg_no_open,filename); return NULL; } return out_fp; } webalizer-2.23-05/output.h0000644000175000017500000000060611032254167013764 0ustar bradbrad#ifndef _OUTPUT_H #define _OUTPUT_H extern int write_main_index(); /* produce main HTML */ extern int write_month_html(); /* monthy HTML page */ extern FILE *open_out_file(char *); /* open output file */ #ifdef USE_DNS extern char *geodb_get_cc(DB *, char *, char *); extern DB *geo_db; #endif #endif /* _OUTPUT_H */ webalizer-2.23-05/parser.c0000644000175000017500000005223611510252726013721 0ustar bradbrad/* webalizer - a web server log analysis program Copyright (C) 1997-2011 Bradford L. Barrett This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version, and provided that the above copyright and permission notice is included with all distributed copies of this or derived software. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ /*********************************************/ /* STANDARD INCLUDES */ /*********************************************/ #include #include #include #include #include /* normal stuff */ #include #include /* ensure sys/types */ #ifndef _SYS_TYPES_H #include #endif /* need socket header? */ #ifdef HAVE_SYS_SOCKET_H #include #endif /* some systems need this */ #ifdef HAVE_MATH_H #include #endif #include "webalizer.h" /* main header */ #include "lang.h" #include "parser.h" /* internal function prototypes */ void fmt_logrec(char *); int parse_record_clf(char *); int parse_record_ftp(char *); int parse_record_squid(char *); int parse_record_w3c(char *); /*********************************************/ /* FMT_LOGREC - terminate log fields w/zeros */ /*********************************************/ void fmt_logrec(char *buffer) { char *cp=buffer; int q=0,b=0,p=0; while (*cp != '\0') { /* break record up, terminate fields with '\0' */ switch (*cp) { case '\t': if (b || q || p) break; *cp='\0'; break; case ' ': if (b || q || p) break; *cp='\0'; break; case '"': if (*(cp-1)=='\\') break; else q^=1; break; case '[': if (q) break; b++; break; case ']': if (q) break; if (b>0) b--; break; case '(': if (q) break; p++; break; case ')': if (q) break; if (p>0) p--; break; } cp++; } } /*********************************************/ /* PARSE_RECORD - uhhh, you know... */ /*********************************************/ int parse_record(char *buffer) { /* clear out structure */ memset(&log_rec,0,sizeof(struct log_struct)); /* call appropriate handler */ switch (log_type) { default: case LOG_CLF: return parse_record_clf(buffer); break; /* clf */ case LOG_FTP: return parse_record_ftp(buffer); break; /* ftp */ case LOG_SQUID: return parse_record_squid(buffer); break; /* squid */ case LOG_W3C: return parse_record_w3c(buffer); break; /* w3c */ } } /*********************************************/ /* PARSE_RECORD_FTP - ftp log handler */ /*********************************************/ int parse_record_ftp(char *buffer) { int size; int i,j,count; char *cp1, *cp2, *cpx, *cpy, *eob; size = strlen(buffer); /* get length of buffer */ eob = buffer+size; /* calculate end of buffer */ fmt_logrec(buffer); /* seperate fields with \0's */ /* Start out with date/time */ cp1=buffer; while (*cp1!=0 && cp12100) return 0; if (i<1 || i>31) return 0; /* format date/time field */ snprintf(log_rec.datetime,sizeof(log_rec.datetime), "[%02d/%s/%4d:%s -0000]",i,cpx,j,cpy); /* skip seconds... */ while (*cp1!=0 && cp1'9') log_rec.xfer_size=0; else log_rec.xfer_size = strtoul(cp1,NULL,10); /* URL stuff */ while (*cp1!=0 && cp1= eob) eos=eob-1; while ( (*cp1 != '\0') && (cp1 != eos) ) *cp2++ = *cp1++; *cp2 = '\0'; if (*cp1 != '\0') { if (verbose) { fprintf(stderr,"%s",msg_big_host); if (debug_mode) fprintf(stderr,": %s\n",cpx); else fprintf(stderr,"\n"); } while (*cp1 != '\0') cp1++; } if (cp1 < eob) cp1++; /* skip next field (ident) */ while ( (*cp1 != '\0') && (cp1 < eob) ) cp1++; if (cp1 < eob) cp1++; /* IDENT (authuser) field */ cpx = cp1; cp2 = log_rec.ident; eos = (cp1+MAXIDENT-1); if (eos >= eob) eos=eob-1; while ( (*cp1 != '[') && (cp1 < eos) ) /* remove embeded spaces */ { if (*cp1=='\0') *cp1=' '; *cp2++=*cp1++; } *cp2--='\0'; if (cp1 >= eob) return 0; /* check if oversized username */ if (*cp1 != '[') { if (verbose) { fprintf(stderr,"%s",msg_big_user); if (debug_mode) fprintf(stderr,": %s\n",cpx); else fprintf(stderr,"\n"); } while ( (*cp1 != '[') && (cp1 < eob) ) cp1++; } /* strip trailing space(s) */ while (*cp2==' ') *cp2--='\0'; /* date/time string */ cpx = cp1; cp2 = log_rec.datetime; eos = (cp1+28); if (eos >= eob) eos=eob-1; while ( (*cp1 != '\0') && (cp1 != eos) ) *cp2++ = *cp1++; *cp2 = '\0'; if (*cp1 != '\0') { if (verbose) { fprintf(stderr,"%s",msg_big_date); if (debug_mode) fprintf(stderr,": %s\n",cpx); else fprintf(stderr,"\n"); } while (*cp1 != '\0') cp1++; } if (cp1 < eob) cp1++; /* minimal sanity check on timestamp */ if ( (log_rec.datetime[0] != '[') || (log_rec.datetime[3] != '/') || (cp1 >= eob)) return 0; /* HTTP request */ cpx = cp1; cp2 = log_rec.url; eos = (cp1+MAXURL-1); if (eos >= eob) eos = eob-1; while ( (*cp1 != '\0') && (cp1 != eos) ) *cp2++ = *cp1++; *cp2 = '\0'; if (*cp1 != '\0') { if (verbose) { fprintf(stderr,"%s",msg_big_req); if (debug_mode) fprintf(stderr,": %s\n",cpx); else fprintf(stderr,"\n"); } while (*cp1 != '\0') cp1++; } if (cp1 < eob) cp1++; if ( (log_rec.url[0] != '"') || (cp1 >= eob) ) return 0; /* Strip off HTTP version from URL */ if ( (cp2=strstr(log_rec.url,"HTTP"))!=NULL ) { *cp2='\0'; /* Terminate string */ *(--cp2)='"'; /* change to " */ } /* response code */ log_rec.resp_code = atoi(cp1); /* xfer size */ while ( (*cp1 != '\0') && (cp1 < eob) ) cp1++; if (cp1 < eob) cp1++; if (*cp1<'0'||*cp1>'9') log_rec.xfer_size=0; else log_rec.xfer_size = strtoul(cp1,NULL,10); /* done with CLF record */ if (cp1>=eob) return 1; while ( (*cp1 != '\0') && (*cp1 != '\n') && (cp1 < eob) ) cp1++; if (cp1 < eob) cp1++; /* get referrer if present */ cpx = cp1; cp2 = log_rec.refer; eos = (cp1+MAXREF-1); if (eos >= eob) eos = eob-1; while ( (*cp1 != '\0') && (*cp1 != '\n') && (cp1 != eos) ) *cp2++ = *cp1++; *cp2 = '\0'; if (*cp1 != '\0') { if (verbose) { fprintf(stderr,"%s",msg_big_ref); if (debug_mode) fprintf(stderr,": %s\n",cpx); else fprintf(stderr,"\n"); } while (*cp1 != '\0') cp1++; } if (cp1 < eob) cp1++; cpx = cp1; cp2 = log_rec.agent; eos = cp1+(MAXAGENT-1); if (eos >= eob) eos = eob-1; while ( (*cp1 != '\0') && (cp1 != eos) ) *cp2++ = *cp1++; *cp2 = '\0'; return 1; /* maybe a valid record, return with TRUE */ } /*********************************************/ /* PARSE_RECORD_SQUID - squid log handler */ /*********************************************/ int parse_record_squid(char *buffer) { int size, slash_count=0; time_t i; char *cp1, *cp2, *cpx, *eob, *eos; size = strlen(buffer); /* get length of buffer */ eob = buffer+size; /* calculate end of buffer */ fmt_logrec(buffer); /* seperate fields with \0's */ /* date/time */ cp1=buffer; i=atoi(cp1); /* get timestamp */ /* format date/time field */ strftime(log_rec.datetime,sizeof(log_rec.datetime), "[%d/%b/%Y:%H:%M:%S -0000]",localtime(&i)); while (*cp1!=0 && cp1= eob) eos=eob-1; while ((*cp1 != '\0') && (cp1 != eos)) *cp2++ = *cp1++; *cp2='\0'; if (*cp1 != '\0') { if (verbose) { fprintf(stderr,"%s",msg_big_host); if (debug_mode) fprintf(stderr,": %s\n",cpx); else fprintf(stderr,"\n"); } while (*cp1 != '\0') cp1++; } if (cp1 < eob) cp1++; /* skip cache status */ while (*cp1!=0 && cp1'9') log_rec.xfer_size=0; else log_rec.xfer_size = strtoul(cp1,NULL,10); while (*cp1!=0 && cp1= eob) eos = eob-1; while ( (*cp1 != '\0') && (cp1 != eos) ) *cp2++ = *cp1++; *cp2 = '\0'; if (*cp1 != '\0') { if (verbose) { fprintf(stderr,"%s",msg_big_req); if (debug_mode) fprintf(stderr,": %s\n",cpx); else fprintf(stderr,"\n"); } while (*cp1 != '\0') cp1++; } if (cp1 < eob) cp1++; *cp2++ = ' '; /* HTTP URL requested */ cpx = cp1; if (trimsquid>0) { slash_count=trimsquid+2; while ( (*cp1 != '\0') && (cp1 != eos) && slash_count) { *cp2++ = *cp1++; if (*cp1 == '/') slash_count--; } } else while ( (*cp1 != '\0') && (cp1 != eos) ) *cp2++ = *cp1++; *cp2 = '\0'; if ((*cp1 != '\0' && trimsquid==0) || (trimsquid && slash_count) ) { if (verbose) { fprintf(stderr,"%s",msg_big_req); if (debug_mode) fprintf(stderr,": %s\n",cpx); else fprintf(stderr,"\n"); } while (*cp1 != '\0') cp1++; } if (cp1 < eob) cp1++; *cp2++ = '\"'; /* IDENT (authuser) field */ cpx = cp1; cp2 = log_rec.ident; eos = (cp1+MAXIDENT-1); if (eos >= eob) eos=eob-1; while (*cp1 == ' ') cp1++; /* skip white space */ while ( (*cp1 != ' ' && *cp1!='\0') && (cp1 < eos) ) *cp2++=*cp1++; *cp2--='\0'; if (cp1 >= eob) return 0; /* strip trailing space(s) */ while (*cp2==' ') *cp2--='\0'; /* we have no interest in the remaining fields */ return 1; } /*********************************************/ /* PARSE_RECORD_W3C - w3c log handler */ /*********************************************/ /* field index structure */ struct field_index_struct { int date; /* Date field index */ int time; /* Time field index */ int ip; /* IP field index */ int username; /* Username field index */ int method; /* Method field index */ int url; /* URL field index */ int query; /* Querystring field index */ int status; /* Status code field index */ int size; /* Size field index */ int referer; /* Referrer field index */ int agent; /* User agent field index */ int fields; /* Number of fields in this format */ }; /* field structure */ struct fields_struct { char *date; /* Date field */ char *time; /* Time field */ char *ip; /* IP field */ char *username; /* Username field */ char *method; /* Method field */ char *url; /* URL field */ char *query; /* Querystring */ char *status; /* Status code */ char *size; /* Size field */ char *referer; /* Referrer field */ char *agent; /* User agent field */ }; int parse_record_w3c(char *buffer) { int size; char *eob; char *cp; int index; static struct field_index_struct field_index; struct fields_struct fields; struct tm gm_time, *local_time; time_t timestamp; memset(&gm_time, 0, sizeof(struct tm)); size = strlen(buffer); /* get length of buffer */ eob = buffer + size; /* calculate end of buffer */ /* remove line end markers, reduce eob accordingly */ cp = eob; while(cp>buffer) { cp--; if (*cp == '\r' || *cp=='\n') { *cp = '\0'; eob--; } else break; } fmt_logrec(buffer); /* seperate fields with \0's */ cp = buffer; /* Check if the line is empty or a line suffers from the IIS Null-Character bug and abort parsing if found. */ if (*cp == '\0') return 0; /* If it's a header line ignore it or parse the Fields header if found */ if (*cp == '#') { cp++; if (!strcmp(cp, "Fields:")) { /* Reset the field indices */ memset(&field_index, 0, sizeof(struct field_index_struct)); while (*cp) cp++; cp++; index = 1; while (cp < eob) { /* Set the field index */ if (!strcmp(cp, "date")) field_index.date = index; if (!strcmp(cp, "time")) field_index.time = index; if (!strcmp(cp, "c-ip")) field_index.ip = index; if (!strcmp(cp, "cs-method")) field_index.method = index; if (!strcmp(cp, "cs-uri-stem")) field_index.url = index; if (!strcmp(cp, "cs-uri-query")) field_index.query = index; if (!strcmp(cp, "sc-status")) field_index.status = index; if (!strcmp(cp, "cs(Referer)")) field_index.referer = index; if (!strcmp(cp, "sc-bytes")) field_index.size = index; if (!strcmp(cp, "cs(User-Agent)")) field_index.agent = index; if (!strcmp(cp, "cs-username")) field_index.username = index; /* Continue with the next field */ while (*cp) cp++; cp++; index++; } field_index.fields = index -1; } /* Return because this header line is completely parsed */ return 0; } /* A data line has been found */ /* Check if the number of entries in this line are conform to the format specified in the header */ index = 1; while (cp < eob) { while (*cp) cp++; cp++; index++; } if (index-1 != field_index.fields) return 0; /* Reset pointer */ cp = buffer; /* Reset the field pointers and begin parsing the data line */ memset(&fields, 0, sizeof(struct fields_struct)); index = 1; while (cp < eob) { /* Set the field pointers */ if (index == field_index.date) fields.date = cp; if (index == field_index.time) fields.time = cp; if (index == field_index.ip) fields.ip = cp; if (index == field_index.method) fields.method = cp; if (index == field_index.url) fields.url = cp; if (index == field_index.query) fields.query = cp; if (index == field_index.status) fields.status = cp; if (index == field_index.referer) fields.referer = cp; if (index == field_index.size) fields.size = cp; if (index == field_index.agent) fields.agent = cp; if (index == field_index.username) fields.username = cp; /* Continue with the next data field */ while (*cp) cp++; cp++; index++; } /* Save URL */ if (fields.url) { cp = fields.url; while (*cp) { if (*cp=='+') *cp=' '; cp++; } /* If no HTTP Method, force to "NONE" */ if (fields.method && (fields.method[0]=='-')) fields.method="NONE"; if (fields.query && (fields.query[0]!='-')) snprintf(log_rec.url, MAXURL, "\"%s %s?%s\"", fields.method, fields.url, fields.query); else snprintf(log_rec.url, MAXURL, "\"%s %s\"", fields.method, fields.url); } else return 0; /* Save hostname */ if (fields.ip) strncpy(log_rec.hostname, fields.ip, MAXHOST - 1); /* Save response code */ if (fields.status) log_rec.resp_code = atoi(fields.status); /* Save referer */ if (fields.referer) strncpy(log_rec.refer, fields.referer, MAXREF - 1); /* Save transfer size */ if (fields.size) log_rec.xfer_size = strtoul(fields.size, NULL, 10); /* Save user agent */ if (fields.agent) { cp = fields.agent; while (*cp) { if (*cp=='+') *cp=' '; cp++; } strncpy(log_rec.agent, fields.agent, MAXAGENT - 1); } /* Save auth username */ if (fields.username) strncpy(log_rec.ident, fields.username, MAXIDENT - 1); /* Parse date and time and save it */ if (fields.date) { gm_time.tm_year = atoi(fields.date); if (gm_time.tm_year > 1900) gm_time.tm_year-=1900; while ((fields.date[0] != '\0') && (fields.date[0] != '-')) fields.date++; if (fields.date[0] == '\0') return 0; fields.date++; gm_time.tm_mon = atoi(fields.date) - 1; while ((fields.date[0] != '\0') && (fields.date[0] != '-')) fields.date++; if (fields.date[0] == '\0') return 0; fields.date++; gm_time.tm_mday = atoi(fields.date); } if (fields.time) { gm_time.tm_hour = atoi(fields.time); while ((fields.time[0] != '\0') && (fields.time[0] != ':')) fields.time++; if (fields.time[0] == '\0') return 0; fields.time++; gm_time.tm_min = atoi(fields.time); while ((fields.time[0] != '\0') && (fields.time[0] != ':')) fields.time++; if (fields.time[0] == '\0') return 0; fields.time++; gm_time.tm_sec = atoi(fields.time); } /* Convert GMT to localtime */ gm_time.tm_isdst = -1; /* force dst check */ timestamp = mktime(&gm_time); /* get time in sec */ #ifdef HAVE_ALTZONE timestamp-=(gm_time.tm_isdst)?altzone:timezone; /* solaris & friends */ #else timestamp = mktime(&gm_time)+gm_time.tm_gmtoff; /* glibc systems */ #endif local_time = localtime(×tamp); /* update tm struct */ strftime(log_rec.datetime, sizeof(log_rec.datetime),/* and format sting */ "[%d/%b/%Y:%H:%M:%S -0000]", local_time); /* for log_rec field */ return 1; } webalizer-2.23-05/parser.h0000644000175000017500000000014010771016751013715 0ustar bradbrad#ifndef _PARSER_H #define _PARSER_H extern int parse_record(char *); #endif /* _PARSER_H */ webalizer-2.23-05/preserve.c0000644000175000017500000006436011510252734014260 0ustar bradbrad/* webalizer - a web server log analysis program Copyright (C) 1997-2011 Bradford L. Barrett This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version, and provided that the above copyright and permission notice is included with all distributed copies of this or derived software. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ /*********************************************/ /* STANDARD INCLUDES */ /*********************************************/ #include #include #include #include #include /* normal stuff */ #include #include #include #include /* ensure sys/types */ #ifndef _SYS_TYPES_H #include #endif /* need socket header? */ #ifdef HAVE_SYS_SOCKET_H #include #endif /* some systems need this */ #ifdef HAVE_MATH_H #include #endif #include "webalizer.h" /* main header */ #include "lang.h" #include "hashtab.h" #include "parser.h" #include "preserve.h" struct hist_rec hist[HISTSIZE]; /* history structure array */ /*********************************************/ /* GET_HISTORY - load in history file */ /*********************************************/ void get_history() { int i,n,numfields; int in_m,in_y; int mth, yr; FILE *hist_fp; char buffer[BUFSIZE]; /* try to open history file */ hist_fp=fopen(hist_fname,"r"); if (hist_fp) { if (verbose>1) printf("%s %s\n",msg_get_hist,hist_fname); while ( fgets(buffer,BUFSIZE,hist_fp) != NULL ) { if (buffer[0]=='#') { continue; } /* skip comments */ /* get record month/year */ sscanf(buffer,"%d %d",&in_m,&in_y); /* check if valid numbers */ if ( (in_m<1 || in_m>12 || in_y<1970) ) { if (verbose) fprintf(stderr,"%s (mth=%d)\n",msg_bad_hist,in_m); continue; } /* populate if first time through */ if (hist[HISTSIZE-1].year==0) populate_history(in_m, in_y); for (i=HISTSIZE-1;i>=0;i--) { if (in_m==hist[i].month && in_y==hist[i].year) break; else { if ( (in_m>hist[i].month&&in_y==hist[i].year) || (in_y>hist[i].year) ) { if (i>0) { n=(mth_idx(in_m,in_y)-mth_idx(hist[i].month,hist[i].year)); while (n) { yr = hist[i].year; mth= hist[i].month+1; if (mth>12) { mth=1; yr++; } memcpy(&hist[0], &hist[1], sizeof(hist[0])*i); memset(&hist[i], 0, sizeof(struct hist_rec)); hist[i].year=yr; hist[i].month=mth; n--; } } break; } } } if (i>=0) { /* month# year# requests files sites xfer firstday lastday */ numfields = sscanf(buffer,"%d %d %llu %llu %llu %lf %d %d %llu %llu", &hist[i].month, &hist[i].year, &hist[i].hit, &hist[i].files, &hist[i].site, &hist[i].xfer, &hist[i].fday, &hist[i].lday, &hist[i].page, &hist[i].visit); } } fclose(hist_fp); } else if (verbose>1) printf("%s\n",msg_no_hist); } /*********************************************/ /* PUT_HISTORY - write out history file */ /*********************************************/ void put_history() { int i; FILE *hist_fp; char new_fname[MAXKVAL+4]; char old_fname[MAXKVAL+4]; struct stat hist_stat; time_t now; char timestamp[48]; /* generate 'new' filename */ sprintf(new_fname, "%s.new", hist_fname); /* stat the file */ if ( !(lstat(new_fname, &hist_stat)) ) { /* check if the file a symlink */ if ( S_ISLNK(hist_stat.st_mode) ) { if (verbose) fprintf(stderr,"%s %s (symlink)\n",msg_no_open,new_fname); return; } } /* Generate our timestamp */ now=time(NULL); strftime(timestamp,sizeof(timestamp),"%d/%b/%Y %H:%M:%S",localtime(&now)); /* Open file for writing */ hist_fp = fopen(new_fname,"w"); if (hist_fp) { if (verbose>1) printf("%s\n",msg_put_hist); /* write header */ fprintf(hist_fp,"# Webalizer V%s-%s History Data - %s (%d month)\n", version, editlvl, timestamp, HISTSIZE); for (i=HISTSIZE-1;i>=0;i--) { fprintf(hist_fp,"%d %d %llu %llu %llu %.0f %d %d %llu %llu\n", hist[i].month, hist[i].year, hist[i].hit, hist[i].files, hist[i].site, hist[i].xfer, hist[i].fday, hist[i].lday, hist[i].page, hist[i].visit); } /* Done, close file */ fclose(hist_fp); /* if time-warp error detected, save old */ if (hist_gap) { sprintf(old_fname, "%s.sav", hist_fname); if ((rename(hist_fname,old_fname)==-1)&&(errno!=ENOENT)&&verbose) fprintf(stderr,"Failed renaming %s to %s: %s\n", hist_fname,old_fname,strerror(errno)); } /* now rename the 'new' file to real name */ if ((rename(new_fname,hist_fname) == -1) && verbose) fprintf(stderr,"Failed renaming %s to %s\n",new_fname,hist_fname); } else if (verbose) fprintf(stderr,"%s %s\n",msg_hist_err,new_fname); } /*********************************************/ /* POPULATE_HISTORY - populate with dates */ /*********************************************/ void populate_history(int month, int year) { int i; int mth=month; int yr =year; if (hist[HISTSIZE-1].year==0) { for (i=HISTSIZE-1;i>=0;i--) { hist[i].year=yr; hist[i].month=mth--; if (mth==0) { yr--; mth=12; } } } } /*********************************************/ /* UPDATE_HISTORY - update with cur totals */ /*********************************************/ void update_history() { int i,n; int mth,yr; /* populate if first time through */ if (hist[HISTSIZE-1].year==0) populate_history(cur_month,cur_year); /* we need to figure out where to put in history */ for (i=HISTSIZE-1;i>=0;i--) { if (cur_month==hist[i].month && cur_year==hist[i].year) break; else { if ((cur_month>hist[i].month&&cur_year==hist[i].year) || (cur_year>hist[i].year)) { if (i>0) { n=(mth_idx(cur_month,cur_year) - mth_idx(hist[i].month,hist[i].year)); if (n>2) { if (verbose) fprintf(stderr,"Warning! %d month gap detected! " \ "(%d/%d to %d/%d)\n", n, hist[i].month, hist[i].year, cur_month, cur_year); if (n>11) hist_gap=1; /* year or more? */ } while (n) { yr = hist[i].year; mth= hist[i].month+1; if (mth>12) { mth=1; yr++; } memcpy(&hist[0],&hist[1],sizeof(hist[0])*i); memset(&hist[i], 0, sizeof(struct hist_rec)); hist[i].year=yr; hist[i].month=mth; n--; } } break; } } } if (i>=0) { hist[i].month = cur_month; hist[i].year = cur_year; hist[i].hit = t_hit; hist[i].files = t_file; hist[i].page = t_page; hist[i].visit = t_visit; hist[i].site = t_site; hist[i].xfer = t_xfer/1024; hist[i].fday = f_day; hist[i].lday = l_day; } } /*********************************************/ /* SAVE_STATE - save internal data structs */ /*********************************************/ int save_state() { HNODEPTR hptr; UNODEPTR uptr; RNODEPTR rptr; ANODEPTR aptr; SNODEPTR sptr; INODEPTR iptr; FILE *fp; int i; struct stat state_stat; char buffer[BUFSIZE]; char new_fname[MAXKVAL+4]; /* generate 'new' filename */ sprintf(new_fname, "%s.new", state_fname); /* stat the file */ if ( !(lstat(new_fname, &state_stat)) ) { /* check if the file a symlink */ if ( S_ISLNK(state_stat.st_mode) ) { if (verbose) fprintf(stderr,"%s %s (symlink)\n",msg_no_open,new_fname); return(EBADF); } } /* Open file for writing */ fp=fopen(new_fname,"w"); if (fp==NULL) return 1; /* Saving current run data... */ if (verbose>1) { sprintf(buffer,"%02d/%02d/%04d %02d:%02d:%02d", cur_month,cur_day,cur_year,cur_hour,cur_min,cur_sec); printf("%s [%s]\n",msg_put_data,buffer); } /* first, save the easy stuff */ /* Header record */ snprintf(buffer,sizeof(buffer), "# Webalizer V%s-%s Incremental Data - %02d/%02d/%04d %02d:%02d:%02d\n", version,editlvl,cur_month,cur_day,cur_year,cur_hour,cur_min,cur_sec); if (fputs(buffer,fp)==EOF) return 1; /* error exit */ /* Current date/time */ sprintf(buffer,"%d %d %d %d %d %d\n", cur_year, cur_month, cur_day, cur_hour, cur_min, cur_sec); if (fputs(buffer,fp)==EOF) return 1; /* error exit */ /* Monthly totals for sites, urls, etc... */ sprintf(buffer,"%llu %llu %llu %llu %llu %llu %.0f %llu %llu %llu\n", t_hit, t_file, t_site, t_url, t_ref, t_agent, t_xfer, t_page, t_visit, t_user); if (fputs(buffer,fp)==EOF) return 1; /* error exit */ /* Daily totals for sites, urls, etc... */ sprintf(buffer,"%llu %llu %llu %d %d\n", dt_site, ht_hit, mh_hit, f_day, l_day); if (fputs(buffer,fp)==EOF) return 1; /* error exit */ /* Monthly (by day) total array */ for (i=0;i<31;i++) { sprintf(buffer,"%llu %llu %.0f %llu %llu %llu\n", tm_hit[i],tm_file[i],tm_xfer[i],tm_site[i],tm_page[i],tm_visit[i]); if (fputs(buffer,fp)==EOF) return 1; /* error exit */ } /* Daily (by hour) total array */ for (i=0;i<24;i++) { sprintf(buffer,"%llu %llu %.0f %llu\n", th_hit[i],th_file[i],th_xfer[i],th_page[i]); if (fputs(buffer,fp)==EOF) return 1; /* error exit */ } /* Response codes */ for (i=0;istring, uptr->flag, uptr->count, uptr->files, uptr->xfer, uptr->entry, uptr->exit); if (fputs(buffer,fp)==EOF) return 1; uptr=uptr->next; } } if (fputs("# End Of Table - urls\n",fp)==EOF) return 1; /* error exit */ /* daily hostname list */ if (fputs("# -sites- (monthly)\n",fp)==EOF) return 1; /* error exit */ for (i=0;istring, hptr->flag, hptr->count, hptr->files, hptr->xfer, hptr->visit, hptr->tstamp, (hptr->lasturl==blank_str)?"-":hptr->lasturl); if (fputs(buffer,fp)==EOF) return 1; /* error exit */ hptr=hptr->next; } } if (fputs("# End Of Table - sites (monthly)\n",fp)==EOF) return 1; /* hourly hostname list */ if (fputs("# -sites- (daily)\n",fp)==EOF) return 1; /* error exit */ for (i=0;istring, hptr->flag, hptr->count, hptr->files, hptr->xfer, hptr->visit, hptr->tstamp, (hptr->lasturl==blank_str)?"-":hptr->lasturl); if (fputs(buffer,fp)==EOF) return 1; hptr=hptr->next; } } if (fputs("# End Of Table - sites (daily)\n",fp)==EOF) return 1; /* Referrer list */ if (fputs("# -referrers- \n",fp)==EOF) return 1; /* error exit */ if (t_ref != 0) { for (i=0;istring, rptr->flag, rptr->count); if (fputs(buffer,fp)==EOF) return 1; /* error exit */ rptr=rptr->next; } } } if (fputs("# End Of Table - referrers\n",fp)==EOF) return 1; /* User agent list */ if (fputs("# -agents- \n",fp)==EOF) return 1; /* error exit */ if (t_agent != 0) { for (i=0;istring, aptr->flag, aptr->count); if (fputs(buffer,fp)==EOF) return 1; /* error exit */ aptr=aptr->next; } } } if (fputs("# End Of Table - agents\n",fp)==EOF) return 1; /* Search String list */ if (fputs("# -search strings- \n",fp)==EOF) return 1; /* error exit */ for (i=0;istring,sptr->count); if (fputs(buffer,fp)==EOF) return 1; /* error exit */ sptr=sptr->next; } } if (fputs("# End Of Table - search strings\n",fp)==EOF) return 1; /* username list */ if (fputs("# -usernames- \n",fp)==EOF) return 1; /* error exit */ for (i=0;istring, iptr->flag, iptr->count, iptr->files, iptr->xfer, iptr->visit, iptr->tstamp); if (fputs(buffer,fp)==EOF) return 1; /* error exit */ iptr=iptr->next; } } if (fputs("# End Of Table - usernames\n",fp)==EOF) return 1; /* Done, close file */ fclose(fp); /* now rename the 'new' file to real name */ if ((rename(new_fname,state_fname) == -1) && verbose) { fprintf(stderr,"Failed renaming %s to %s\n",new_fname,state_fname); return 1; /* Failed, return with error code */ } return 0; /* successful, return with good return code */ } /*********************************************/ /* RESTORE_STATE - reload internal run data */ /*********************************************/ int restore_state() { FILE *fp; int i; struct hnode t_hnode; /* Temporary hash nodes */ struct unode t_unode; struct rnode t_rnode; struct anode t_anode; struct snode t_snode; struct inode t_inode; char buffer[BUFSIZE]; char tmp_buf[BUFSIZE]; u_int64_t ul_bogus=0; /* if ignoring, just return */ if (ignore_state) return 0; /* try to open state file */ fp=fopen(state_fname,"r"); if (fp==NULL) { /* Previous run data not found... */ if (verbose>1) printf("%s\n",msg_no_data); return 0; /* return with ok code */ } /* Reading previous run data... */ if (verbose>1) printf("%s %s\n",msg_get_data,state_fname); /* get easy stuff */ sprintf(tmp_buf,"# Webalizer V%s ",version); if ((fgets(buffer,BUFSIZE,fp)) != NULL) /* Header record */ { if (strncmp(buffer,tmp_buf,16)) { /* Kludge to allow 2.01 files also */ sprintf(tmp_buf,"# Webalizer V2.01-1"); if (strncmp(buffer,tmp_buf,19)) return 99; /* bad magic? */ } } else return 1; /* error exit */ /* Get current timestamp */ if ((fgets(buffer,BUFSIZE,fp)) != NULL) { sscanf(buffer,"%d %d %d %d %d %d", &cur_year, &cur_month, &cur_day, &cur_hour, &cur_min, &cur_sec); } else return 2; /* error exit */ /* calculate current timestamp (seconds since epoch) */ cur_tstamp=((jdate(cur_day,cur_month,cur_year)-epoch)*86400)+ (cur_hour*3600)+(cur_min*60)+cur_sec; /* Get monthly totals */ if ((fgets(buffer,BUFSIZE,fp)) != NULL) { sscanf(buffer,"%llu %llu %llu %llu %llu %llu %lf %llu %llu %llu", &t_hit, &t_file, &t_site, &t_url, &t_ref, &t_agent, &t_xfer, &t_page, &t_visit, &t_user); } else return 3; /* error exit */ /* Get daily totals */ if ((fgets(buffer,BUFSIZE,fp)) != NULL) { sscanf(buffer,"%llu %llu %llu %d %d", &dt_site, &ht_hit, &mh_hit, &f_day, &l_day); } else return 4; /* error exit */ /* get daily totals */ for (i=0;i<31;i++) { if ((fgets(buffer,BUFSIZE,fp)) != NULL) { sscanf(buffer,"%llu %llu %lf %llu %llu %llu", &tm_hit[i],&tm_file[i],&tm_xfer[i],&tm_site[i],&tm_page[i], &tm_visit[i]); } else return 5; /* error exit */ } /* get hourly totals */ for (i=0;i<24;i++) { if ((fgets(buffer,BUFSIZE,fp)) != NULL) { sscanf(buffer,"%llu %llu %lf %llu", &th_hit[i],&th_file[i],&th_xfer[i],&th_page[i]); } else return 6; /* error exit */ } /* get response code totals */ for (i=0;i 0 # causes all URLs to be truncated after the nth '/' after the http:// # portion. Setting TrimSquidURL to one (1) will cause all URLs to be # summarized by domain only. The default is zero (0), which disables # any such truncation and preserve the URLs as they are in the log. # TrimSquidURL 0 # DNSCache specifies the DNS cache filename to use for reverse DNS lookups. # This file must be specified if you wish to perform name lookups on any IP # addresses found in the log file. If an absolute path is not given as # part of the filename (ie: starts with a leading '/'), then the name is # relative to the default output directory. See the DNS.README file for # additional information. #DNSCache dns_cache.db # DNSChildren allows you to specify how many "children" processes are # run to perform DNS lookups to create or update the DNS cache file. # If a number is specified, the DNS cache file will be created/updated # each time the Webalizer is run, immediately prior to normal processing, # by running the specified number of "children" processes to perform # DNS lookups. If used, the DNS cache filename MUST be specified as # well. The default value is zero (0), which disables DNS cache file # creation/updates at run time. The number of children processes to # run may be anywhere from 1 to 100, however a large number may effect # normal system operations. Reasonable values should be between 5 and # 20. See the DNS.README file for additional information. #DNSChildren 0 # CacheIPs allows unresolved IP addresses to be cached in the DNS # database. Normally, only resolved addresses are saved. At some # sites, particularly those with a large number of unresolvable IP # addresses visiting, it may be useful to enable this feature so # those addresses are not constantly looked up each time the program # is run. Values can be 'yes' or 'no', with 'no' being the default. #CacheIPs no # CacheTTL specifies the time to live (TTL) value for cached DNS # entries, in days. This value may be anywhere between 1 and 100 # with the default being 7 days (1 week). #CacheTTL 7 # The GeoDB option enables or disabled the use of the native # Webalizer GeoDB geolocation services. This is the preferred # geolocation option. Values may be 'yes' or 'no', with 'no' # being the default. #GeoDB no # GeoDBDatabase specifies an alternate database to use. The # default database is /usr/share/GeoDB/GeoDB.dat (however the # path may be changed at compile time; use the -vV command # line option to determine where). If a different database is # to be used, it may be specified here. The name is relative # to the output directory being used unless an absolute name # (ie: starts with a leading '/') is specified. #GeoDBDatabase /usr/share/GeoDB/GeoDB.dat # The GeoIP option enables or disables the use of geolocation # services provided by the GeoIP library (http://www.maxmind.com), # if available. Values may be 'yes' or 'no, with 'no' being the # default. Note: if GeoDB is enabled, then this option will have # no effect (GeoDB will be used regardless of this setting). #GeoIP no # GeoIPDatabase specifies an alternate database filename to use by the # GeoIP library. If an absolute path is not given as part of the name # (ie: starts with a leading '/'), then the name is relative to the # default output directory. This option should not normally be needed. #GeoIPDatabase /usr/share/GeoIP/GeoIP.dat # HTMLPre defines HTML code to insert at the very beginning of the # file. Default is the DOCTYPE line shown below. Max line length # is 80 characters, so use multiple HTMLPre lines if you need more. #HTMLPre # HTMLHead defines HTML code to insert within the # block, immediately after the line. Maximum line length # is 80 characters, so use multiple lines if needed. #HTMLHead <META NAME="author" CONTENT="The Webalizer"> #HTMLHead <META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW"> # HTMLBody defined the HTML code to be inserted, starting with the # <BODY> tag. If not specified, the default is shown below. If # used, you MUST include your own <BODY> tag as the first line. # Maximum line length is 80 char, use multiple lines if needed. #HTMLBody <BODY BGCOLOR="#E8E8E8" TEXT="#000000" LINK="#0000FF" VLINK="#FF0000"> # HTMLPost defines the HTML code to insert immediately before the # first <HR> on the document, which is just after the title and # "summary period"-"Generated on:" lines. If anything, this should # be used to clean up in case an image was inserted with HTMLBody. # As with HTMLHead, you can define as many of these as you want and # they will be inserted in the output stream in order of apperance. # Max string size is 80 characters. Use multiple lines if you need to. #HTMLPost <BR CLEAR="all"> # HTMLTail defines the HTML code to insert at the bottom of each # HTML document, usually to include a link back to your home # page or insert a small graphic. It is inserted as a table # data element (ie: <TD> your code here </TD>) and is right # alligned with the page. Max string size is 80 characters. #HTMLTail <IMG SRC="msfree.png" ALT="100% Micro$oft free!"> # HTMLEnd defines the HTML code to add at the very end of the # generated files. It defaults to what is shown below. If # used, you MUST specify the </BODY> and </HTML> closing tags # as the last lines. Max string length is 80 characters. #HTMLEnd </BODY></HTML> # The LinkReferrer option determines if entries in the referrer table # should be plain text or a HTML link to the referrer. Values can be # either 'yes' or 'no', with 'no' being the default. #LinkReferrer no # The Quiet option suppresses output messages... Useful when run # as a cron job to prevent bogus e-mails. Values can be either # "yes" or "no". Default is "no". Note: this does not suppress # warnings and errors (which are printed to stderr). #Quiet no # ReallyQuiet will supress all messages including errors and # warnings. Values can be 'yes' or 'no' with 'no' being the # default. If 'yes' is used here, it cannot be overriden from # the command line, so use with caution. A value of 'no' has # no effect. #ReallyQuiet no # TimeMe allows you to force the display of timing information # at the end of processing. A value of 'yes' will force the # timing information to be displayed. A value of 'no' has no # effect. #TimeMe no # GMTTime allows reports to show GMT (UTC) time instead of local # time. Default is to display the time the report was generated # in the timezone of the local machine, such as EDT or PST. This # keyword allows you to have times displayed in UTC instead. Use # only if you really have a good reason, since it will probably # screw up the reporting periods by however many hours your local # time zone is off of GMT. #GMTTime no # Debug prints additional information for error messages. This # will cause webalizer to dump bad records/fields instead of just # telling you it found a bad one. As usual, the value can be # either "yes" or "no". The default is "no". It shouldn't be # needed unless you start getting a lot of Warning or Error # messages and want to see why. (Note: warning and error messages # are printed to stderr, not stdout like normal messages). #Debug no # FoldSeqErr forces the Webalizer to ignore sequence errors. # This is useful for Netscape and other web servers that cache # the writing of log records and do not guarentee that they # will be in chronological order. The use of the FoldSeqErr # option will cause out of sequence log records to be treated # as if they had the same time stamp as the last valid record. # Default is to ignore out of sequence log records. The use # of this feature is strongly discouraged and rarely needed. # (the webalizer already compensates for up to 60 minutes of # difference between records). #FoldSeqErr no # VisitTimeout allows you to set the default timeout for a visit # (sometimes called a 'session'). The default is 30 minutes, # which should be fine for most sites. # Visits are determined by looking at the time of the current # request, and the time of the last request from the site. If # the time difference is greater than the VisitTimeout value, it # is considered a new visit, and visit totals are incremented. # Value is the number of seconds to timeout (default=1800=30min) #VisitTimeout 1800 # IgnoreHist shouldn't be used in a config file, but it is here # just because it might be usefull in certain situations. If the # history file is ignored, the main "index.html" file will only # report on the current log files contents. Usefull only when you # want to reproduce the reports from scratch. USE WITH CAUTION! # Valid values are "yes" or "no". Default is "no". #IgnoreHist no # IgnoreState also shouldn't be used, but is here anyway. It is # similar to the IgnoreHist option, but for the incremental data # file. If this is set to 'yes', any existing incrememtal data # will be ignored and a new data file will be written at the end # of processing. USE WITH CAUTION. By ignoring an existing # incremental data file, all previous processing for the current # month will be lost, and those logs must be re-processed. # Valid values are "yes" or "no". Default is "no". #IgnoreState no # CountryGraph allows the usage by country graph to be disabled. # Values can be 'yes' or 'no', default is 'yes'. #CountryGraph yes # CountryFlags allows flags to be displayed in the top country # table in monthly reports. Values can be 'yes' or 'no', with # the default being 'no'. #CountryFlags no # FlagDir specifies the location of flag graphics which will be # used in the top country table. If not specified, the default # is to look in the 'flags' directory directly under the output # directory being used for the reports. If this option is used, # the display of flag graphics will be enabled by default. #FlagDir flags # DailyGraph and DailyStats allows the daily statistics graph # and statistics table to be disabled (not displayed). Values # may be "yes" or "no". Default is "yes". #DailyGraph yes #DailyStats yes # HourlyGraph and HourlyStats allows the hourly statistics graph # and statistics table to be disabled (not displayed). Values # may be "yes" or "no". Default is "yes". #HourlyGraph yes #HourlyStats yes # GraphLegend allows the color coded legends to be turned on or off # in the graphs. The default is for them to be displayed. This only # toggles the color coded legends, the other legends are not changed. # If you think they are hideous and ugly, say 'no' here :) #GraphLegend yes # GraphLines allows you to have index lines drawn behind the graphs. # I personally am not crazy about them, but a lot of people requested # them and they weren't a big deal to add. The number represents the # number of lines you want displayed. Default is 2, you can disable # the lines by using a value of zero ('0'). [max is 20] # Note, due to rounding errors, some values don't work quite right. # The lower the better, with 1,2,3,4,6 and 10 producing nice results. #GraphLines 2 # IndexMonths defines the number of months to display in the main index # (yearly summary) table. Value can be between 12 and 120, with the # default being 12 months (1 year). #IndexMonths 12 # YearHeaders enables/disables the display of year headers in the main # index (yearly summary) table. If enabled, year headers will be shown # when the table is displaying more than 16 months worth of data. Values # can be 'yes' or 'no', with 'yes' being the default. #YearHeaders yes # YearTotals enables/disables the display of yearly totals in the main # index (yearly summary) table. If enabled, year totals will be shown # when the table is displaying more than 16 months worth of data. Values # can be 'yes' or 'no', with 'yes' being the default. #YearTotals yes # GraphMonths defines the number of months to display in the main index # (yearly summary) graph. Value can be between 12 and 72 months, with # the default being 12 months. #GraphMonths 12 # The "Top" options below define the number of entries for each table. # Defaults are Sites=30, URLs=30, Referrers=30 and Agents=15, and # Countries=30. TopKSites and TopKURLs (by KByte tables) both default # to 10, as do the top entry/exit tables (TopEntry/TopExit). The top # search strings and usernames default to 20. Tables may be disabled # by using zero (0) for the value. #TopSites 30 #TopKSites 10 #TopURLs 30 #TopKURLs 10 #TopReferrers 30 #TopAgents 15 #TopCountries 30 #TopEntry 10 #TopExit 10 #TopSearch 20 #TopUsers 20 # The All* keywords allow the display of all URLs, Sites, Referrers # User Agents, Search Strings and Usernames. If enabled, a seperate # HTML page will be created, and a link will be added to the bottom # of the appropriate "Top" table. There are a couple of conditions # for this to occur.. First, there must be more items than will fit # in the "Top" table (otherwise it would just be duplicating what is # already displayed). Second, the listing will only show those items # that are normally visable, which means it will not show any hidden # items. Grouped entries will be listed first, followed by individual # items. The value for these keywords can be either 'yes' or 'no', # with the default being 'no'. Please be aware that these pages can # be quite large in size, particularly the sites page, and seperate # pages are generated for each month, which can consume quite a lot # of disk space depending on the traffic to your site. #AllSites no #AllURLs no #AllReferrers no #AllAgents no #AllSearchStr no #AllUsers no # The Webalizer normally strips the string 'index.' off the end of # URLs in order to consolidate URL totals. For example, the URL # /somedir/index.html is turned into /somedir/ which is really the # same URL. This option allows you to specify additional strings # to treat in the same way. You don't need to specify 'index.' as # it is always scanned for by The Webalizer, this option is just to # specify _additional_ strings if needed. If you don't need any, # don't specify any as each string will be scanned for in EVERY # log record... A bunch of them will degrade performance. Also, # the string is scanned for anywhere in the URL, so a string of # 'home' would turn the URL /somedir/homepages/brad/home.html into # just /somedir/ which is probably not what was intended. #IndexAlias home.htm #IndexAlias homepage.htm # The DefaultIndex option is used to enable/disable the use of # "index." as the default index name to be stripped off the end of # a URL (as described above). Most sites will not need to use this # option, but some may, such as those whose default index file name # is different, or those that use "index.php" or similar URLs in a # dynamic environment. Values can be 'yes' or 'no', with the default # being 'yes'. This option does not effect any names added using the # IndexAlias option, and those names will still function as described # regardless of this setting. #DefaultIndex yes # The Hide*, Group* and Ignore* and Include* keywords allow you to # change the way Sites, URLs, Referrers, User Agents and Usernames # are manipulated. The Ignore* keywords will cause The Webalizer to # completely ignore records as if they didn't exist (and thus not # counted in the main site totals). The Hide* keywords will prevent # things from being displayed in the 'Top' tables, but will still be # counted in the main totals. The Group* keywords allow grouping # similar objects as if they were one. Grouped records are displayed # in the 'Top' tables and can optionally be displayed in BOLD and/or # shaded. Groups cannot be hidden, and are not counted in the main # totals. The Group* options do not, by default, hide all the items # that it matches. If you want to hide the records that match (so just # the grouping record is displayed), follow with an identical Hide* # keyword with the same value. (see example below) In addition, # Group* keywords may have an optional label which will be displayed # instead of the keywords value. The label should be seperated from # the value by at least one 'white-space' character, such as a space # or tab. If the match string contains whitespace (spaces or tabs), # the string should be quoted with either single or double quotes. # # The value can have either a leading or trailing '*' wildcard # character. If no wildcard is found, a match can occur anywhere # in the string. Given a string "www.yourmama.com", the values "your", # "*mama.com" and "www.your*" will all match. # Your own site should be hidden #HideSite *webalizer.org #HideSite localhost # Your own site gives most referrals #HideReferrer webalizer.org/ # This one hides non-referrers ("-" Direct requests) #HideReferrer Direct Request # Usually you want to hide these HideURL *.gif HideURL *.GIF HideURL *.jpg HideURL *.JPG HideURL *.png HideURL *.PNG HideURL *.ra # Hiding agents is kind of futile #HideAgent RealPlayer # You can also hide based on authenticated username #HideUser root #HideUser admin # Grouping options #GroupURL /cgi-bin/* CGI Scripts #GroupURL /images/* Images #GroupSite *.aol.com #GroupSite *.compuserve.com #GroupReferrer yahoo.com/ Yahoo! #GroupReferrer excite.com/ Excite #GroupReferrer infoseek.com/ InfoSeek #GroupReferrer webcrawler.com/ WebCrawler #GroupUser root Admin users #GroupUser admin Admin users #GroupUser wheel Admin users # The following is a great way to get an overall total # for browsers, and not display all the detail records. # (You should use MangleAgent to refine further...) #GroupAgent Opera/ Opera #HideAgent Opera/ #GroupAgent "MSIE 7" Microsoft Internet Exploder 7 #HideAgent MSIE 7 #GroupAgent "MSIE 6" Microsoft Internet Exploder 6 #HideAgent MSIE 6 #GroupAgent "MSIE " Older Microsoft Exploders #HideAgent MSIE #GroupAgent Firefox/2. Firefox 2 #HideAgent Firefox/2. #GroupAgent Firefox/1. Firefox 1.x #HideAgent Firefox/1. #GroupAgent Konqueror Konqueror #HideAgent Konqueror #GroupAgent Safari Safari #HideAgent Safari #GroupAgent Lynx* Lynx #HideAgent Lynx* #GroupAgent Wget/ WGet #HideAgent Wget/ #GroupAgent (compatible; Other Mozilla Compatibles #HideAgent (compatible; #GroupAgent Mozilla* Mozilla/Netscape #HideAgent Mozilla* # HideAllSites allows forcing individual sites to be hidden in the # report. This is particularly useful when used in conjunction # with the "GroupDomain" feature, but could be useful in other # situations as well, such as when you only want to display grouped # sites (with the GroupSite keywords...). The value for this # keyword can be either 'yes' or 'no', with 'no' the default, # allowing individual sites to be displayed. #HideAllSites no # The GroupDomains keyword allows you to group individual hostnames # into their respective domains. The value specifies the level of # grouping to perform, and can be thought of as 'the number of dots' # that will be displayed. For example, if a visiting host is named # cust1.tnt.mia.uu.net, a domain grouping of 1 will result in just # "uu.net" being displayed, while a 2 will result in "mia.uu.net". # The default value of zero disable this feature. Domains will only # be grouped if they do not match any existing "GroupSite" records, # which allows overriding this feature with your own if desired. #GroupDomains 0 # The GroupShading allows grouped rows to be shaded in the report. # Useful if you have lots of groups and individual records that # intermingle in the report, and you want to diferentiate the group # records a little more. Value can be 'yes' or 'no', with 'yes' # being the default. #GroupShading yes # GroupHighlight allows the group record to be displayed in BOLD. # Can be either 'yes' or 'no' with the default 'yes'. #GroupHighlight yes # The Ignore* keywords allow you to completely ignore log records based # on hostname, URL, user agent, referrer or username. I hesitated in # adding these, since the Webalizer was designed to generate _accurate_ # statistics about a web servers performance. By choosing to ignore # records, the accuracy of reports become skewed, negating why I wrote # this program in the first place. However, due to popular demand, here # they are. Use the same as the Hide* keywords, where the value can have # a leading or trailing wildcard '*'. Use at your own risk ;) Please # remember, the use of these will MAKE YOUR STATS INACCURATE and you # should consider using an equivalent 'Hide*' keyword instead. #IgnoreSite bad.site.net #IgnoreURL /test* #IgnoreReferrer file:/* #IgnoreAgent RealPlayer #IgnoreUser root # The Include* keywords allow you to force the inclusion of log records # based on hostname, URL, user agent, referrer or username. They take # precidence over the Ignore* keywords. Note: Using Ignore/Include # combinations to selectivly process parts of a web site is _extremely # inefficent_!!! Avoid doing so if possible (ie: grep the records to a # seperate file if you really want that kind of report). # Example: Only show stats on Joe User's pages... #IgnoreURL * #IncludeURL ~joeuser* # Or based on an authenticated username #IgnoreUser * #IncludeUser someuser # The MangleAgents allows you to specify how much, if any, The Webalizer # should mangle user agent names. This allows several levels of detail # to be produced when reporting user agent statistics. There are six # levels that can be specified, which define different levels of detail # supression. Level 5 shows only the browser name (MSIE or Mozilla) # and the major version number. Level 4 adds the minor version number # (single decimal place). Level 3 displays the minor version to two # decimal places. Level 2 will add any sub-level designation (such # as Mozilla/3.01Gold or MSIE 3.0b). Level 1 will attempt to also add # the system type if it is specified. The default Level 0 displays the # full user agent field without modification and produces the greatest # amount of detail. User agent names that can't be mangled will be # left unmodified. #MangleAgents 0 # The SearchEngine keywords allow specification of search engines and # their query strings on the URL. These are used to locate and report # what search strings are used to find your site. The first word is # a substring to match in the referrer field that identifies the search # engine, and the second is the URL variable used by that search engine # to define it's search terms. #SearchEngine .google. q= #SearchEngine yahoo.com p= #SearchEngine altavista.com q= #SearchEngine aolsearch. query= #SearchEngine ask.co q= #SearchEngine eureka.com q= #SearchEngine lycos.com query= #SearchEngine hotbot.com MT= #SearchEngine msn.com q= #SearchEngine infoseek.com qt= #SearchEngine excite search= #SearchEngine netscape.com query= #SearchEngine mamma.com query= #SearchEngine alltheweb.com q= #SearchEngine northernlight.com qr= # Normally, search strings are converted to lower case in order to # increase accuracy. The SearchCaseI option allows them to maintain # case sensitivity, useful for some sites. The value can be 'yes' # or 'no', with 'yes' (case insensitive) being the default. #SearchCaseI yes # The Dump* keywords allow the dumping of Sites, URLs, Referrers # User Agents, Usernames and Search strings to seperate tab delimited # text files, suitable for import into most database or spreadsheet # programs. # DumpPath specifies the path to dump the files. If not specified, # it will default to the current output directory. Do not use a # trailing slash ('/'). #DumpPath /var/lib/httpd/logs # The DumpHeader keyword specifies if a header record should be # written to the file. A header record is the first record of the # file, and contains the labels for each field written. Normally, # files that are intended to be imported into a database system # will not need a header record, while spreadsheets usually do. # Value can be either 'yes' or 'no', with 'no' being the default. #DumpHeader no # DumpExtension allow you to specify the dump filename extension # to use. The default is "tab", but some programs are pickey about # the filenames they use, so you may change it here (for example, # some people may prefer to use "csv"). #DumpExtension tab # These control the dumping of each individual table. The value # can be either 'yes' or 'no'.. the default is 'no'. #DumpSites no #DumpURLs no #DumpReferrers no #DumpAgents no #DumpUsers no #DumpSearchStr no # The custom graph colors are defined here. Declare them # in the standard hexadecimal way (as HTML, without the '#') # If none are given, you will get the standard default colors. #ColorHit 00805c #ColorFile 0040ff #ColorSite ff8000 #ColorKbyte ff0000 #ColorPage 00e0ff #ColorVisit ffff00 #ColorMisc 00e0ff #PieColor1 800080 #PieColor2 80ffc0 #PieColor3 ff00ff #PieColor4 ffc080 # End of configuration file... Have a nice day! ���������������������������������������������������������������������������������������������������������������������������������������������������webalizer-2.23-05/wcmgr.1���������������������������������������������������������������������������0000644�0001750�0001750�00000011354�11510253223�013447� 0����������������������������������������������������������������������������������������������������ustar �brad����������������������������brad�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.TH wcmgr 1 "12-Jul-2008" "Version 1.00" "The Webalizer" .SH NAME wcmgr - Webalizer (DNS) Cache file Manager .SH SYNOPSIS .B wcmgr\fP [\fI option ... \fP] \fIcache-file\fP .PP .SH DESCRIPTION \fIwcmgr\fP is a utility program which allows manipulation of the DNS cache files used and produced by The \fIWebalizer\fP. Each record in the cache file contains an IP address (either IPv4 or IPv6), a timestamp of when the entry was added to the cache, a flag to indicate if the record contains a resolved name or not, and either the same IP address or a resolved host name. All records are accessed by their IP address. .SH RUNNING WCMGR \fIwcmgr\fP was designed to be run from the Unix shell command line. This facilitates its use in shell scripts and other automated processes. A valid DNS cache file \fBmust\fP be specified. Command line options are optional, and if none are given, the default action is to list the contents of the specified cache file. .SH COMMAND LINE OPTIONS Different functions are selected by using one or more of the following command line options. If no options are given, the default is to display the contents of the cache file to the screen (stdout). .PP .TP 8 .B \-h Display all available command line options and exit. .TP 8 .B \-v Be verbose. .TP 8 .B \-V Display the program version and exit. Additional program specific information will be displayed if \fIverbose\fP mode is also used (e.g. '\fI-vV\fP'), which can be useful when submitting bug reports. .TP 8 .B \-a \fIaddress\fP [\fI-n hostname\fP] [\fI-t0\fP] Add a new record to the cache file. The IP \fIaddress\fP will be added to the cache file using the current time as the timestamp and with a resolved name \fIhostname\fP. If \fI-t0\fP is specified, the record will be considered permanent, and will not be removed (during a purge) or expired. If a \fIhostname\fP is not specified with the \fI-n\fP option, then the \fIaddress\fP will be used instead, and the record will be flagged as unresolved. .TP 8 .B \-c Create a new cache file. If used alone, this option will create a new, empty cache file. If used with the \fIimport\fP option, a new cache file will be created before importing the data. An error will occur if the file \fIcache-file\fP already exists. .TP 8 .B \-d \fIaddress\fP Delete a record from the cache file using the specified \fIaddress\fP. .TP 8 .B \-f \fIaddress\fP Find and display information for \fIaddress\fP from the cache file. A single line similar to that produced by the \fI-l\fP option will be displayed unless \fIverbose\fP mode is enabled, in which case a more detailed listing will be produced. .TP 8 .B \-i \fIname\fP [\fI-c\fP] Import data into the cache file from the file \fIname\fP. The import file must be a valid tab delimited text file, such as that created by the \fIexport\fP option. If the imported data contains records already present in the cache file, those records will be overwritten by the imported data. The cache file must exist unless the \fI-c\fP option is specified, in which case, a new cache file will be created for the imported data. .TP 8 .B \-l List the contents of the cache file. This is the default action of the program, so does not necessarily need to be specified. If \fIverbose\fP mode is enabled, a report title, column headers and summary totals will also be displayed. .TP 8 .B \-p \fInum\fP Purge the cache file of entries older than \fInum\fP days. If \fInum\fP is not specified, then a default of \fB7 days\fP will be used. if \fIverbose\fP mode is enabled, each purged record will be printed and the total number of purged records will be displayed. .TP 8 .B \-s [\fI-t num\fP] Display cache file information/statistics. If a TTL value (in days) is specified using the \fI-t\fP option, it will be used to calculate how many records are older than \fInum\fP days, otherwise, the default value of \fB7 days\fP will be used. .TP 8 .B \-n \fIname\fP Specify the \fIname\fP to use as the resolved hostname when adding records to the cache. .TP 8 .B \-t \fInum\fP Time to live (TTL) value. If used along with the \fI-p\fP (purge) option, it specifies how many days a record will remain valid. Any record that is older than \fInum\fP days is considered expired and will be purged. If used with the \fI-a\fP (add) option, a zero value will cause the record to be considered permanent. .TP 8 .B \-x \fIname\fP Export data from a cache file to a tab delimited text file named \fIname\fP. If the text file \fIname\fP exists, it will be overwritten. .SH BUGS Please report bugs to the author. .SH COPYRIGHT Copyright (C) 1997-2011 by Bradford L. Barrett. Distributed under the GNU GPL. See the files "\fICOPYING\fP" and "\fICopyright\fP", supplied with all distributions for additional information. .SH AUTHOR Bradford L. Barrett <\fIbrad at mrunix dot net\fP> ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������webalizer-2.23-05/wcmgr.c���������������������������������������������������������������������������0000644�0001750�0001750�00000072406�11510253026�013537� 0����������������������������������������������������������������������������������������������������ustar �brad����������������������������brad�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* wcmgr - Webalizer (DNS) Cache file Manager webalizer - a web server log analysis program Copyright (C) 1997-2011 Bradford L. Barrett This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version, and provided that the above copyright and permission notice is included with all distributed copies of this or derived software. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ /*********************************************/ /* STANDARD INCLUDES */ /*********************************************/ #include <time.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <locale.h> #ifndef USE_DNS /* ********************************************************** */ /* If DNS support is not enabled, then we just compile a stub */ /* program that displays an appropriate warning when run. */ /* ********************************************************** */ int main() { printf("********************* NOTICE!! *********************\n"); printf("This version of the Webalizer was not compiled with\n"); printf("DNS support. In order to use this program, you must\n"); printf("configure the Webalizer at build time with the DNS\n"); printf("support enabled (--enable-dns configure option).\n"); printf("****************************************************\n\n"); exit(1); /* exit with error code */ } #else /* USE_DNS defined */ #include <errno.h> #include <unistd.h> /* normal stuff */ #include <fcntl.h> #include <ctype.h> #include <sys/utsname.h> #include <sys/stat.h> /* ensure getopt */ #ifdef HAVE_GETOPT_H #include <getopt.h> #endif /* ensure sys/types */ #ifndef _SYS_TYPES_H #include <sys/types.h> #endif #include <db.h> #include "webalizer.h" /*********************************************/ /* Forward reference local functions */ /*********************************************/ void list_cache(void); void stat_cache(void); void export_cache(void); void import_cache(void); void find_rec(void); void add_rec(void); void del_rec(void); void purge_cache(void); void create_cache(void); static int db_put(char *, char *, int, time_t); /*********************************************/ /* GLOBAL VARIABLES */ /*********************************************/ char *pname = "WCMGR - Webalizer (DNS) Cache file Manager"; char *version = "1.00"; /* program version */ char *editlvl = "03"; /* edit level */ char *moddate = "12-Jul-2008"; /* modification date */ char *copyright = "Copyright 2007-2011 by Bradford L. Barrett"; int action = 'l'; /* action flag (default=list) */ int create = 0; /* cache creation flag */ int verbose = 0; /* Verbose flag (1=be verbose) */ int rec_ttl = 7; /* purge TTL in days */ DB *dns_db = NULL; /* DNS cache database */ DB *out_db = NULL; /* output cache db if needed */ DBC *cursorp = NULL; /* database cursor */ DBT q, r; /* query/reply structures */ char *in_file = NULL; /* input cache filename */ char out_file[MAXHOST+4]; /* output cache filename */ int dns_fd = 0; /* database file descriptor */ time_t runtime; /* runtime for TTL calcs */ char addr[129]; /* buffer for IP search addr */ char name[MAXHOST+1]; /* buffer for name value */ extern char *optarg; /* command line processing */ extern int optind; extern int opterr; /* dnsRecord structure used in wcmgr */ struct dnsRec { time_t timeStamp; /* Timestamp of resolv data */ int numeric; /* 0: Name, 1: IP-address */ char hostName[MAXHOST+1]; /* Hostname buffer (variable) */ } dns_rec; /*********************************************/ /* PRINT_VER - display version information */ /*********************************************/ void print_ver() { int v,r,l; struct utsname system_info; uname(&system_info); printf("%s V%s-%s\n%s\n",pname,version,editlvl,copyright); if (verbose) { db_version(&v,&r,&l); printf("System : %s %s (%s)\n", system_info.sysname, system_info.release, system_info.machine); printf("DB Ver. : V%d.%d.%d\n",v,r,l); printf("Mod Date: %s\n",moddate); } printf("\n"); exit(0); } /*********************************************/ /* PRINT_HELP - Command help display */ /*********************************************/ void print_help(void) { printf("Usage: wcmgr [options] cache-file\n\n"); printf("Options:\n"); printf(" -h This help display\n"); printf(" -V Version information\n"); printf(" -v be verbose\n"); printf(" -a addr Add DNS record\n"); printf(" -c Create new cache file\n"); printf(" -d addr Delete DNS record\n"); printf(" -f addr Find DNS record\n"); printf(" -i name Import cache from file\n"); printf(" -l List cache file contents\n"); printf(" -n name hostname (used for add)\n"); printf(" -p num Purge after num days\n"); printf(" -s Display cache file stats/info\n"); printf(" -t num TTL value (for add and stats)\n"); printf(" -x name Export cache to tab file\n"); printf("\n"); printf("If no options are specified, the default\n"); printf("action is to list the cache file contents.\n\n"); exit(0); } /*********************************************/ /* TTL_AGE - format TTL age for printing */ /*********************************************/ const char *ttl_age(time_t now, time_t then) { static char our_buffer[32]; /* string return buffer */ time_t age; /* age value in seconds */ int days, hours, mins; /* day/hour/min counters */ /* get age in seconds */ age=now-then; /* now calc days/hours/min */ days=age/86400; age=age-(days*86400); hours=age/3600; age=age-(hours*3600); mins=age/60; /* format the string */ sprintf(our_buffer,"%02dd:%02dh:%02dm",days, hours, mins); /* and return to caller */ return our_buffer; } /*********************************************/ /* MAIN entry point here */ /*********************************************/ int main(int argc, char *argv[]) { int i; /* gotta have one of these :-) */ /* some systems need this */ setlocale(LC_CTYPE,""); /* initalize name/addr */ memset(addr, 0, sizeof(addr)); memset(name, 0, sizeof(name)); memset(out_file,0,sizeof(out_file)); /* Get our command line arguments */ opterr = 0; while ((i=getopt(argc,argv,"a:cd:f:hi:ln:p::st:vVx:"))!=EOF) { switch (i) { case 'a': action='a'; strncpy(addr,optarg,sizeof(addr)-1); break; case 'c': if (action!='i') action='c'; create=1; break; case 'd': action='d'; strncpy(addr,optarg,sizeof(addr)-1); break; case 'f': action='f'; strncpy(addr,optarg,sizeof(addr)-1); break; case 'i': action='i'; strncpy(out_file,optarg,sizeof(out_file)-1); break; case 'h': print_help(); break; case 'n': strncpy(name,optarg,sizeof(name)-1); break; case 'p': action='p'; if (optarg!=NULL) rec_ttl=atoi(optarg); break; case 's': action='s'; break; case 't': rec_ttl=atoi(optarg); break; case 'v': verbose=1; break; case 'V': print_ver(); break; case 'x': action='x'; strncpy(out_file,optarg,sizeof(out_file)-1); break; case ':': /* catch invalid options here */ case '?': break; case 'l': /* This is the default action */ default: action='l'; break; } } /* Get cache filename if specified */ if (argc - optind == 0) print_help(); /* gots to have a filename!! */ in_file = argv[optind]; /* Try to create our DB handle */ if ( db_create(&dns_db, NULL, 0) ) { fprintf(stderr,"Error: unable to create db handle!\n"); exit(1); } /* force sane TTL value */ if (rec_ttl > 99) rec_ttl=99; if (rec_ttl < 0 ) rec_ttl=7; /* Branch on 'action' specified */ switch (action) { case 'a': add_rec(); break; case 'c': create_cache(); break; case 'd': del_rec(); break; case 'f': find_rec(); break; case 'i': import_cache(); break; case 's': stat_cache(); break; case 'p': purge_cache(); break; case 'x': export_cache(); break; case 'l': default: list_cache(); break; } exit(0); } /*********************************************/ /* LIST_CACHE - Dump out cache contents */ /*********************************************/ void list_cache() { int i; char ip_buf[48]; u_int64_t t_rec=0; u_int64_t t_num=0; /* open the database (read-only) */ if ((i=dns_db->open(dns_db, NULL, in_file, NULL, DB_HASH, DB_RDONLY, 0))) { /* Error opening the cache file.. tell user and exit */ fprintf(stderr,"Error: %s: %s\n",in_file,db_strerror(i)); exit(1); } /* Create a cursor */ if ( dns_db->cursor(dns_db, NULL, &cursorp, 0) ) { fprintf(stderr,"Error: Unable to create cursor!\n"); exit(1); } /* get our runtime for TTL calculations */ time(&runtime); if (verbose) { printf("Webalizer DNS Cache file listing generated %s\n",ctime(&runtime)); printf("IP Address TTL Age Hostname\n"); printf("--------------- ------------- ------------------------" \ "-----------------------\n"); } /* initalize data areas */ memset(&q, 0, sizeof(DBT)); memset(&r, 0, sizeof(DBT)); memset(&dns_rec, 0, sizeof(struct dnsRec)); /* Loop through database */ while (!cursorp->c_get(cursorp, &q, &r, DB_NEXT)) { /* got a record */ t_rec++; memset(ip_buf, 0, sizeof(ip_buf)); strncpy(ip_buf, q.data, (q.size>47)?47:q.size); /* save IP address */ memcpy(&dns_rec, r.data, r.size); if (dns_rec.numeric) t_num++; printf("%-15s [%s] %s\n",ip_buf, (dns_rec.timeStamp)? ttl_age(runtime, dns_rec.timeStamp): "-permanent-", dns_rec.hostName); /* done, clear for next rec */ memset(&q, 0, sizeof(DBT)); memset(&r, 0, sizeof(DBT)); } if (verbose) { printf("------------------------------------------------------" \ "-----------------------\n"); printf("Filename: %s (%llu records)\n",in_file, t_rec); } } /*********************************************/ /* PURGE_CACHE - Purge cache of expired recs */ /*********************************************/ void purge_cache() { int i; char ip_buf[48]; u_int64_t age=0; u_int64_t t_in=0; u_int64_t t_out=0; u_int64_t t_exp=0; /* file control struct */ struct flock our_flock; if (verbose) printf("Purging records over %d days from '%s'\n", rec_ttl, in_file); /* open the input database (read-write) */ if ((i=dns_db->open(dns_db, NULL, in_file, NULL, DB_HASH, 0, 0))) { /* Error opening the cache file.. tell user and exit */ fprintf(stderr,"Error: %s: %s\n",in_file,db_strerror(i)); exit(1); } /* get file descriptor */ dns_db->fd(dns_db, &dns_fd); /* Try to lock the file */ our_flock.l_whence=SEEK_SET; our_flock.l_start=0; our_flock.l_len=0; our_flock.l_type=F_WRLCK; if (fcntl(dns_fd,F_SETLK,&our_flock) <0) { /* Error - can't lock file */ printf("Error: Unable to lock cache file: %s\n",strerror(errno)); exit(1); } /* Create a cursor */ if ( dns_db->cursor(dns_db, NULL, &cursorp, 0) ) { fprintf(stderr,"Error: Unable to create cursor!\n"); exit(1); } /* Try to create our output DB handle */ if ( db_create(&out_db, NULL, 0) ) { fprintf(stderr,"Error: unable to create output db handle!\n"); exit(1); } /* generate output filename */ memset(out_file, 0, sizeof(out_file)); sprintf(out_file, "%s.new", in_file); /* open the output database (read-write) */ if ((i=out_db->open(out_db, NULL, out_file, NULL, DB_HASH, DB_CREATE|DB_EXCL, 0644))) { /* Error opening the cache file.. tell user and exit */ fprintf(stderr,"Error: %s: %s\n",out_file,db_strerror(i)); exit(1); } /* get our runtime for TTL calculations */ time(&runtime); /* initalize data areas */ memset(&q, 0, sizeof(DBT)); memset(&r, 0, sizeof(DBT)); /* Loop through database */ while (!cursorp->c_get(cursorp, &q, &r, DB_NEXT)) { /* got a record */ t_in++; memcpy(&dns_rec, r.data, r.size); /* get record ttl age */ if (dns_rec.timeStamp==0) age=0; else age = runtime - dns_rec.timeStamp; if ( age <= (rec_ttl*86400) ) { /* Good record.. insert into new cache file */ if ( (i=out_db->put(out_db, NULL, &q, &r, 0)) != 0 ) { fprintf(stderr,"Error: db_put fail: %s!\n",db_strerror(i)); exit(1); } else t_out++; } else { /* Expired record */ t_exp++; if (verbose) { memset(ip_buf, 0, sizeof(ip_buf)); strncpy(ip_buf, q.data, (q.size>47)?47:q.size); printf("Purging %-16s [%s]\n",ip_buf, ttl_age(runtime,dns_rec.timeStamp)); } } /* done, clear for next rec */ memset(&q, 0, sizeof(DBT)); memset(&r, 0, sizeof(DBT)); } /* Successful exit! */ our_flock.l_type=F_UNLCK; fcntl(dns_fd, F_SETLK, &our_flock); dns_db->close(dns_db, 0); out_db->close(out_db, 0); /* rename files */ if (rename(out_file, in_file)) { fprintf(stderr,"Error renaming file: %s\n",strerror(errno)); exit(1); } if (verbose) printf("%llu of %llu records purged from '%s'\n",t_exp,t_in,in_file); } /*********************************************/ /* STAT_CACHE - Display cache stats/info */ /*********************************************/ void stat_cache() { /* Define some variables */ int i; time_t min_age=0; /* min/max TTL age in cache */ time_t max_age=0; u_int64_t t_rec=0; /* Various record totals */ u_int64_t t_err=0; u_int64_t t_name=0; u_int64_t t_num=0; u_int64_t t_perm=0; u_int64_t t_old=0; time_t age; /* open the database (read-only) */ if ((i=dns_db->open(dns_db, NULL, in_file, NULL, DB_HASH, DB_RDONLY, 0))) { /* Error opening the cache file.. tell user and exit */ fprintf(stderr,"Error: %s: %s\n",in_file,db_strerror(i)); exit(1); } /* Create a cursor */ if ( dns_db->cursor(dns_db, NULL, &cursorp, 0) ) { fprintf(stderr,"Error: Unable to create cursor!\n"); exit(1); } /* get our runtime for TTL calculations */ time(&runtime); /* initalize data areas */ memset(&q, 0, sizeof(DBT)); memset(&r, 0, sizeof(DBT)); memset(&dns_rec, 0, sizeof(struct dnsRec)); /* Loop through database */ while (!cursorp->c_get(cursorp, &q, &r, DB_NEXT)) { t_rec++; /* add to total */ if (r.size >= sizeof(dns_rec)) { t_err++; continue; } /* size error? */ memcpy(&dns_rec, r.data, r.size); /* get record */ if (dns_rec.numeric) t_num++; else t_name++; /* resolved? */ if (dns_rec.timeStamp!=0) /* permanent? */ { age=runtime-dns_rec.timeStamp; /* calc age */ if ((age < min_age) || (t_rec==1) ) min_age=age; /* min/max age */ if ( age > max_age ) max_age=age; /* if not perm */ if ( age > (rec_ttl*86400)) t_old++; /* purgable? */ } else t_perm++; /* inc counter */ /* done, clear for next rec */ memset(&q, 0, sizeof(DBT)); memset(&r, 0, sizeof(DBT)); } /* Print actual record counts */ printf("Report generated on: %s",ctime(&runtime)); printf("DNS Cache Filename : %s\n",in_file); printf("Total Records : %llu\n",t_rec); printf("Total Resolved : %llu\n",t_name); printf("Total Unresolved : %llu\n",t_num); printf("Total Permanent : %llu\n",t_perm); printf("Newest Record age : %s\n",ttl_age(min_age,0)); printf("Oldest Record age : %s\n",ttl_age(max_age,0)); printf("Total over %02d days : %llu\n",rec_ttl,t_old); if (t_err) printf("Record Size Errors : %llu\n",t_err); printf("\n"); } /*********************************************/ /* FIND_REC - Find IP record in cache */ /*********************************************/ void find_rec() { int i; char ip_buf[48]; /* open the database (read-only) */ if ((i=dns_db->open(dns_db, NULL, in_file, NULL, DB_HASH, DB_RDONLY, 0))) { /* Error opening the cache file.. tell user and exit */ fprintf(stderr,"Error: %s: %s\n",in_file,db_strerror(i)); exit(1); } /* get our runtime for TTL calculations */ time(&runtime); /* initalize data areas */ memset(&q, 0, sizeof(DBT)); memset(&r, 0, sizeof(DBT)); memset(&dns_rec, 0, sizeof(struct dnsRec)); /* search the cache */ q.data = &addr; q.size = strlen(addr); if ( (i=dns_db->get(dns_db, NULL, &q, &r, 0)) == 0) { /* We found it! display info */ memset(ip_buf, 0, sizeof(ip_buf)); strncpy(ip_buf, q.data, (q.size>47)?47:q.size); /* save IP address */ memcpy(&dns_rec, r.data, r.size); if (verbose) { /* Verbose display */ printf("Address : %s\n",ip_buf); printf("Hostname : %s\n",dns_rec.hostName); printf("Resolved : %s\n",(dns_rec.numeric)?"No":"Yes"); if (dns_rec.timeStamp) { /* Not Permanent */ printf("Timestamp: %s",ctime(&dns_rec.timeStamp)); printf("TTL age : %s\n\n",ttl_age(runtime, dns_rec.timeStamp)); } else { printf("Timestamp: N/A\n"); printf("TTL age : Permanent\n"); } } else { /* Standard 1 line display */ printf("%-15s [%s] %s\n",ip_buf, (dns_rec.timeStamp)? ttl_age(runtime, dns_rec.timeStamp): "-permanent-", dns_rec.hostName); } } else { if (i==DB_NOTFOUND) printf("%s not found!\n",addr); else printf("Error: %s\n",db_strerror(i)); } } /*********************************************/ /* DEL_REC - Delete record from cache file */ /*********************************************/ void del_rec() { int i; char *cp; /* ensure we have addr string */ if (addr[0]!='\0') cp=addr; else { fprintf(stderr,"Error: No IP address specified!\n"); exit(1); } /* ensure IPv6 addresses are lowercase */ cp=addr; while (*cp!='\0') *cp++=tolower(*cp); /* open the database (read-write) */ if ((i=dns_db->open(dns_db, NULL, in_file, NULL, DB_HASH, 0, 0))) { /* Error opening the cache file.. tell user and exit */ fprintf(stderr,"Error: %s: %s\n",in_file,db_strerror(i)); exit(1); } /* initalize data areas */ memset(&q, 0, sizeof(DBT)); memset(&r, 0, sizeof(DBT)); memset(&dns_rec, 0, sizeof(struct dnsRec)); /* search the cache */ q.data = &addr; q.size = strlen(addr); /* Try to delete the record */ if ( (i=dns_db->del(dns_db, NULL, &q, 0)) ) { if (i==DB_NOTFOUND) { printf("%s not found in cache!\n",addr); exit(1); } else { fprintf(stderr,"Error: %s\n",db_strerror(i)); exit(1); } } dns_db->close(dns_db, 0); if (verbose) printf("%s sucessfully deleted from cache file\n",addr); } /*********************************************/ /* ADD_REC - Add record to cache file */ /*********************************************/ void add_rec() { int i; char *cp; /* ensure we have addr string */ if (addr[0]!='\0') cp=addr; else { fprintf(stderr,"Error: No IP address specified!\n"); exit(1); } /* and check size */ if (strlen(addr)>47) { fprintf(stderr,"Error: IP address too long!\n"); exit(1); } /* ensure everything is lowercase */ cp=addr; while (*cp!='\0') *cp++=tolower(*cp); if (name[0]!='\0') { cp=name; while (*cp!='\0') *cp++=tolower(*cp); } /* open the database (read-write) */ if ((i=dns_db->open(dns_db, NULL, in_file, NULL, DB_HASH, 0, 0))) { /* Error opening the cache file.. tell user and exit */ fprintf(stderr,"Error: %s: %s\n",in_file,db_strerror(i)); exit(1); } /* get our runtime for TTL calculations */ time(&runtime); /* initalize data areas */ memset(&q, 0, sizeof(DBT)); memset(&r, 0, sizeof(DBT)); memset(&dns_rec, 0, sizeof(struct dnsRec)); /* search the cache */ q.data = &addr; q.size = strlen(addr); if ( (i=dns_db->get(dns_db, NULL, &q, &r, 0)) == 0) { fprintf(stderr,"Error: %s already exists in cache!\n",addr); exit(1); } else { if (i!=DB_NOTFOUND) { fprintf(stderr,"Error: %s\n",db_strerror(i)); exit(1); } else { /* check hostname */ if (name[0]=='\0') strncpy(name,addr,strlen(addr)); /* check if perm */ if (rec_ttl==0) runtime=0; /* put it in the database */ if (db_put(addr, name, (strcmp(name,addr))?0:1, runtime)==0) dns_db->close(dns_db,0); if (verbose) printf("%s sucessfully added to cache file\n",addr); } } } /*********************************************/ /* CREATE_CACHE - Create a new cache file */ /*********************************************/ void create_cache() { int i; /* create the database */ if ((i=dns_db->open(dns_db,NULL,in_file,NULL, DB_HASH,DB_CREATE|DB_EXCL,0644))) { /* Error opening the cache file.. tell user and exit */ fprintf(stderr,"Error: %s: %s\n",in_file,db_strerror(i)); exit(1); } dns_db->close(dns_db,0); if (verbose) printf("Cache file %s created successfully\n",in_file); } /*********************************************/ /* IMPORT_CACHE - import cache from tab file */ /*********************************************/ void import_cache() { int i, flag=0; u_int64_t t_rec=0; FILE *in_fp; char ip_buf[48]; char buffer[4096]; /* open the database (read-write) */ if (create) flag=DB_CREATE|DB_EXCL; if ((i=dns_db->open(dns_db, NULL, in_file, NULL, DB_HASH, flag, 0644))) { /* Error opening the cache file.. tell user and exit */ fprintf(stderr,"Error: %s: %s\n",in_file,db_strerror(i)); exit(1); } /* open our import file */ in_fp=fopen(out_file,"r"); if (in_fp) { while ((fgets(buffer,4096,in_fp)) != NULL) { memset(&dns_rec, 0, sizeof(dns_rec)); memset(&ip_buf, 0, sizeof(ip_buf)); i = sscanf(buffer,"%s\t%lu\t%d\t%s", ip_buf, &dns_rec.timeStamp, &dns_rec.numeric, dns_rec.hostName); if (ip_buf[0]=='#') continue; /* skip comments */ if (i!=4) { fprintf(stderr,"Error reading tab file %s\n",out_file); exit(1); } t_rec++; /* bump totals */ /* put it in the database */ if (db_put(ip_buf, dns_rec.hostName, dns_rec.numeric, dns_rec.timeStamp)!=0) { fprintf(stderr,"Error inserting cache record:\n%s\n",buffer); exit(1); } } } else fprintf(stderr,"Error: File not found: %s\n",out_file); dns_db->close(dns_db,0); if (verbose) printf("%llu records imported into '%s' from file '%s'\n", t_rec, in_file, out_file); } /*********************************************/ /* EXPORT_CACHE - export cache to tab file */ /*********************************************/ void export_cache() { int i; u_int64_t t_rec=0; char ip_buf[48]; FILE *out_fp; struct stat out_stat; /* make sure files are different! */ if (!strcmp(in_file,out_file)) { fprintf(stderr,"Error: Bad export filename: %s\n",out_file); exit(1); } /* open the database (read-only) */ if ((i=dns_db->open(dns_db, NULL, in_file, NULL, DB_HASH, DB_RDONLY, 0))) { /* Error opening the cache file.. tell user and exit */ fprintf(stderr,"Error: %s: %s\n",in_file,db_strerror(i)); exit(1); } /* Create a cursor */ if ( dns_db->cursor(dns_db, NULL, &cursorp, 0) ) { fprintf(stderr,"Error: Unable to create cursor!\n"); exit(1); } /* stat output file */ if ( !(lstat(out_file, &out_stat)) ) { /* check if the file is a symlink */ if ( S_ISLNK(out_stat.st_mode) ) { fprintf(stderr,"%s %s\n","Error: File is a symlink:",out_file); exit(1); } } /* open output file */ if ( (out_fp=fopen(out_file,"w")) == NULL) { fprintf(stderr,"%s %s\n","Error: Cannot create file:",out_file); exit(1); } /* initalize data areas */ memset(&q, 0, sizeof(DBT)); memset(&r, 0, sizeof(DBT)); memset(&dns_rec, 0, sizeof(struct dnsRec)); /* Loop through database */ while (!cursorp->c_get(cursorp, &q, &r, DB_NEXT)) { /* got a record */ t_rec++; memset(ip_buf, 0, sizeof(ip_buf)); strncpy(ip_buf, q.data, (q.size>47)?47:q.size); /* save IP address */ memcpy(&dns_rec, r.data, r.size); /* Print out tab delimited line */ /* Format: IP timestamp numeric hostname */ fprintf(out_fp,"%s\t%lu\t%d\t%s\n", ip_buf,dns_rec.timeStamp, dns_rec.numeric, dns_rec.hostName); /* done, clear for next rec */ memset(&q, 0, sizeof(DBT)); memset(&r, 0, sizeof(DBT)); } dns_db->close(dns_db,0); fclose(out_fp); if (verbose) printf("%llu records exported from '%s' to file '%s'\n", t_rec, in_file, out_file); } /*********************************************/ /* DB_PUT - put key/val in the cache db */ /*********************************************/ static int db_put(char *key, char *value, int numeric, time_t ttl) { /* dnsRecord structure used in database */ struct dnsRecord { time_t timeStamp; /* Timestamp of resolv data */ int numeric; /* 0: Name, 1: IP-address */ char hostName[1]; /* Hostname buffer (variable) */ }; int i; DBT k, v; struct dnsRecord *recPtr = NULL; int nameLen = strlen(value)+1; /* Align to multiple of eight bytes */ int recSize = (sizeof(struct dnsRecord)+nameLen+7) & ~0x7; /* make sure we have a db ;) */ if(dns_db) { if((recPtr = calloc(1, recSize))) { recPtr->timeStamp = ttl; recPtr->numeric = numeric; memcpy(&recPtr->hostName, value, nameLen); memset(&k, 0, sizeof(k)); memset(&v, 0, sizeof(v)); k.data = key; k.size = strlen(key); v.size = recSize; v.data = recPtr; if ( (i=dns_db->put(dns_db, NULL, &k, &v, 0)) != 0 ) fprintf(stderr,"Error: db_put fail: %s!\n",db_strerror(i)); free(recPtr); } else return 1; } else return 1; return i; } #endif /* USE_DNS */ ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������webalizer-2.23-05/webalizer.1�����������������������������������������������������������������������0000644�0001750�0001750�00000105725�11510253233�014323� 0����������������������������������������������������������������������������������������������������ustar �brad����������������������������brad�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.TH webalizer 1 "12-Jul-2008" "Version 2.20" "The Webalizer" .SH NAME webalizer - A web server log file analysis tool. .SH SYNOPSIS .B webalizer [\fI option ... \fP] [\fI log-file \fP] .PP .B webazolver [\fI option ... \fP] [\fI log-file \fP] .PP .SH DESCRIPTION The \fIWebalizer\fP is a web server log file analysis program which produces usage statistics in HTML format for viewing with a browser. The results are presented in both columnar and graphical format, which facilitates interpretation. Yearly, monthly, daily and hourly usage statistics are presented, along with the ability to display usage by site, URL, referrer, user agent (browser), username, search strings, entry/exit pages, and country (some information may not be available if not present in the log file being processed). .PP The \fIWebalizer\fP supports \fBCLF\fP (common log format) log files, as well as \fBCombined\fP log formats as defined by NCSA and others, and variations of these which it attempts to handle intelligently. In addition, the \fIWebalizer\fP supports \fBxferlog\fP formatted (\fIFTP\fP) log files, \fBsquid\fP proxy logs and \fBW3C\fP extended format logs. Logs may also be compressed, via \fIgzip\fP (.gz) or, if enabled at compile time, \fIbzip2\fP (.bz2). If a compressed log file is detected, it will be automatically uncompressed while it is read. Compressed logs must have the standard \fIgzip\fP extension of \fB.gz\fP or \fIbzip2\fP extension of \fB.bz2\fP. .PP \fIwebazolver\fP is normally just a symbolic link to the \fIWebalizer\fP. When run as \fIwebazolver\fP, only DNS file creation/updates are performed, and the program will exit once complete. All normal options and configuration directives are available, however many will not be used. In addition, a DNS cache file must be specified. If the number of DNS children processes to use are not specified, the \fIwebazolver\fP will default to \fB5\fP. .PP This documentation applies to The Webalizer Version 2.20 .SH RUNNING THE WEBALIZER The \fIWebalizer\fP was designed to be run from a Unix command line prompt or as a \fBcrond(8)\fP job. Once executed, the general flow of the program is: .TP 8 .B o A default configuration file is scanned for. A file named \fIwebalizer.conf\fP is searched for in the current directory, and if found, it's configuration data is parsed. If the file is not present in the current directory, the file \fI/etc/webalizer.conf\fP is searched for and, if found, is used instead. .TP 8 .B o Any command line arguments given to the program are parsed. This may include the specification of a configuration file, which is processed at the time it is encountered. .TP 8 .B o If a log file was specified, it is opened and made ready for processing. If no log file was given, \fISTDIN\fP is used for input. If the log filename '\fB-\fP' is specified, \fISTDIN\fP will be forced. .TP 8 .B o If an output directory was specified, the program does a \fBchdir(2)\fP to that directory in preparation for generating output. If no output directory was given, the current directory is used. .TP 8 .B o If a non-zero number of DNS Children processes were specified, they will be started, and the specified log file will be processed, creating or updating the specified DNS cache file. .TP 8 .B o If no hostname was given, the program attempts to get the hostname using a \fBuname(2)\fP system call. If that fails, \fIlocalhost\fP is used. .TP 8 .B o A history file is searched for in the current directory (output directory) and read if found. This file keeps totals for previous months, which is used in the main \fIindex.html\fP HTML document. .B Note: The file location can now be specified with the \fIHistoryName\fP configuration option. .TP 8 .B o If incremental processing was specified, a data file is searched for and loaded if found, containing the 'internal state' data of the program at the end of a previous run. .B Note: The file location can now be specified with the \fIIncrementalName\fP configuration option. .TP 8 .B o Main processing begins on the log file. If the log spans multiple months, a separate HTML document is created for each month. .TP 8 .B o After main processing, the main \fIindex.html\fP page is created, which has totals by month and links to each months HTML document. .TP 8 .B o A new history file is saved to disk, which includes totals generated by The \fIWebalizer\fP during the current run. .TP 8 .B o If incremental processing was specified, a data file is written that contains the 'internal state' data at the end of this run. .SH INCREMENTAL PROCESSING The \fIWebalizer\fP supports incremental run capability. Simply put, this allows processing large log files by breaking them up into smaller pieces, and processing these pieces instead. What this means in real terms is that you can now rotate your log files as often as you want, and still be able to produce monthly usage statistics without the loss of any detail. Basically, The \fIWebalizer\fP saves and restores all internal data in a file named \fIwebalizer.current\fP. This allows the program to 'start where it left off' so to speak, and allows the preservation of detail from one run to the next. The data file is placed in the current output directory, and is a plain ASCII text file that can be viewed with any standard text editor. It's location and name may be changed using the \fIIncrementalName\fP configuration keyword. .PP Some special precautions need to be taken when using the incremental run capability of The \fIWebalizer\fP. Configuration options should not be changed between runs, as that could cause corruption of the internal data stored. For example, changing the \fIMangleAgents\fP level will cause different representations of user agents to be stored, producing invalid results in the user agents section of the report. If you need to change configuration options, do it at the end of the month after normal processing of the previous month and before processing the current month. You may also want to delete the \fIwebalizer.current\fP file as well. .PP The \fIWebalizer\fP also attempts to prevent data duplication by keeping track of the timestamp of the last record processed. This timestamp is then compared to current records being processed, and any records that were logged previous to that timestamp are ignored. This, in theory, should allow you to re-process logs that have already been processed, or process logs that contain a mix of processed/not yet processed records, and not produce duplication of statistics. The only time this may break is if you have duplicate timestamps in two separate log files... any records in the second log file that do have the same timestamp as the last record in the previous log file processed, will be discarded as if they had already been processed. There are lots of ways to prevent this however, for example, stopping the web server before rotating logs will prevent this situation. This setup also necessitates that you always process logs in chronological order, otherwise data loss will occur as a result of the timestamp compare. .SH REVERSE DNS LOOKUPS The \fIWebalizer\fP fully supports IPv4 and IPv6 DNS lookups, and maintains a cache of those lookups to reduce processing the same addresses in subsequent runs. The cache file can be created at run-time, or may be created before running the webalizer using either the stand alone '\fIwebazolver\fP' program, or The Webalizer (DNS) Cache file manager program '\fIwcmgr\fP'. In order to perform reverse lookups, a \fBDNSCache\fP file must be specified, either on the command line or in a configuration file. In order to create/update the cache file at run-time, the number of \fBDNSChildren\fP must also be specified, and can be anything between 1 and 100. This specifies the number of child processes to be forked, each of which will perform network DNS queries in order to lookup up the addresses and update the cache. Cached entries that are older than a specified TTL (time to live) will be expired, and if encountered again in a log, will be looked up at that time in order to 'freshen' them (verify the name is still the same and update its timestamp). The default TTL is 7 days, however may be set to anything between 1 and 100 days. Using the '\fIwcmgr\fP' program, entries may also be marked as 'permanent', in which case they will persist (with an infinite TTL) in the cache until manually removed. See the file \fBDNS.README\fP for additional information and examples. .SH GEOLOCATION LOOKUPS The \fIWebalizer\fP has the ability to perform geolocation lookups on IP addresses using either it's own internal \fIGeoDB\fP database, or optionally the \fIGeoIP\fP database from MaxMind, Inc. (www.maxmind.com). If used, unresolved addresses will be searched for in the database and its country of origin will be returned if found. This actually produces more accurate \fICountry\fP information than DNS lookups, since the DNS address space has additional \fIgcTLDs\fP that do not necessarily map to a specific country (such as \fI.net\fP and \fI.com\fP). It is possible to use both DNS lookups and geolocation lookups at the same time, which will cause any addresses that could not be resolved using DNS lookups to then be looked up in the database, greatly reducing the number of \fIUnknown/Unresolved\fP entries in the generated reports. The native \fIGeoDB\fP geolocation database provided by The \fIWebalizer\fP fully supports both \fIIPv4\fP and \fIIPv6\fP lookups, is updated regularly and is the preferred geolocation method for use with The \fIWebalizer\fP. The most current version of the database can be obtained from our ftp site (\fIftp://ftp.mrunix.net/\fP). .SH COMMAND LINE OPTIONS The \fIWebalizer\fP supports many different configuration options that will alter the way the program behaves and generates output. Most of these can be specified on the command line, while some can only be specified in a configuration file. The command line options are listed below, with references to the corresponding configuration file keywords. .PP .I General Options .TP 8 .B \-h Display all available command line options and exit program. .TP 8 .B \-v Be verbose. Will cause the program to output informational and \fIDebug\fP messages at run-time. .TP 8 .B \-V Display the program version and exit. Additional program specific information will be displayed if \fIverbose\fP mode is also used (e.g. '\fI-vV\fP'), which can be useful when submitting bug reports. .TP 8 .B \-d \fBDebug\fP. Display debugging information for errors and warnings. .TP 8 .B \-i \fBIgnoreHist\fP. Ignore history. \fBUSE WITH CAUTION\fP. This will cause The \fIWebalizer\fP to ignore any previous monthly history file only. Incremental data (if present) is still processed. .TP 8 .B \-b \fBIgnoreState\fP. Ignore incremental data file. \fBUSE WITH CAUTION\fP. This will cause The \fIWebalizer\fP to ignore any existing incremental data file. By ignoring the incremental data file, all previous processing for the current month will be lost and those logs must be re-processed. .TP 8 .B \-p \fBIncremental\fP. Preserve internal data between runs. .TP 8 .B \-q \fBQuiet\fP. Suppress informational messages. Does not suppress warnings or errors. .TP 8 .B \-Q \fBReallyQuiet\fP. Suppress all messages including warnings and errors. .TP 8 .B \-T \fBTimeMe\fP. Force display of timing information at end of processing. .TP 8 .B \-c \fIfile\fP Use configuration file \fIfile\fP. .TP 8 .B \-n \fIname\fP \fBHostName\fP. Use the hostname \fIname\fP. .TP 8 .B \-o \fIdir\fP \fBOutputDir\fP. Use output directory \fIdir\fP. .TP 8 .B \-t \fIname\fP \fBReportTitle\fP. Use \fIname\fP for report title. .TP 8 .B \-F \fP( \fBc\fPlf | \fBf\fPtp | \fBs\fPquid | \fBw\fP3c ) \fBLogType\fP. Specify log type to be processed. Value can be either \fIc\fPlf, \fIf\fPtp, \fIs\fPquid or \fIw\fP3c format. If not specified, will default to \fBCLF\fP format. \fIFTP\fP logs must be in standard wu-ftpd \fIxferlog\fP format. .TP 8 .B \-f \fBFoldSeqErr\fP. Fold out of sequence log records back into analysis, by treating as if they were the same date/time as the last good record. Normally, out of sequence log records are simply ignored. .TP 8 .B \-Y \fBCountryGraph\fP. Suppress country graph. .TP 8 .B \-G \fBHourlyGraph\fP. Suppress hourly graph. .TP 8 .B \-x \fIname\fP \fBHTMLExtension\fP. Defines HTML file extension to use. If not specified, defaults to \fIhtml\fP. Do not include the leading period. .TP 8 .B \-H \fBHourlyStats\fP. Suppress hourly statistics. .TP 8 .B \-K \fInum\fP \fBIndexMonths\fP. Specify how many months should be displayed in the main index (yearly summary) table. Default is 12 months. Can be set to anything between 12 and 120 months (1 to 10 years). .TP 8 .B \-k \fInum\fP \fBGraphMonths\fP. Specify how many months should be displayed in the main index (yearly summary) graph. Default is 12 months. Can be set to anything between 12 and 72 months (1 to 6 years). .TP 8 .B \-L \fBGraphLegend\fP. Suppress color coded graph legends. .TP 8 .B \-l \fInum\fP \fBGraphLines\fP. Specify number of background lines. Default is 2. Use zero ('0') to disable the lines. .TP 8 .B \-P \fIname\fP \fBPageType\fP. Specify file extensions that are considered \fIpages\fP. Sometimes referred to as \fIpageviews\fP. .TP 8 .B \-O \fIname\fP \fBOmitPage\fP. Specify URLs to exclude from being counted as \fIpages\fP. .TP 8 .B \-m \fInum\fP \fBVisitTimeout\fP. Specify the Visit timeout period. Specified in number of seconds. Default is 1800 seconds (30 minutes). .TP 8 .B \-I \fIname\fP \fBIndexAlias\fP. Use the filename \fIname\fP as an additional alias for \fIindex.\fP. .TP 8 .B \-M \fInum\fP \fBMangleAgents\fP. Mangle user agent names according to the mangle level specified by \fInum\fP. Mangle levels are: .RS .TP 12 .B 5 Browser name and major version. .TP 12 .B 4 Browser name, major and minor version. .TP 12 .B 3 Browser name, major version, minor version to two decimal places. .TP 12 .B 2 Browser name, major and minor versions and sub-version. .TP 12 .B 1 Browser name, version and machine type if possible. .TP 12 .B 0 All information (left unchanged). .RE .TP 8 .B \-g \fInum\fP \fBGroupDomains\fP. Automatically group sites by domain. The grouping level specified by \fInum\fP can be thought of as 'the number of dots' to display in the grouping. The default value of \fB0\fP disables any domain grouping. .TP 8 .B \-D \fIname\fP \fBDNSCache\fP. Use the DNS cache file \fIname\fP. .TP 8 .B \-N \fInum\fP \fBDNSChildren\fP. Use \fInum\fP DNS children processes to perform DNS lookups, either creating or updating the DNS cache file. Specify zero (\fB0\fP) to disable cache file creation/updates. If given, a DNS cache filename must be specified. .TP 8 .B \-j Enable \fIGeoDB\fP. This enables the internal GeoDB geolocation services provided by The \fIWebalizer\fP. .TP 8 .B \-J \fIname\fP \fBGeoDBDatabase\fP. Use the alternate GeoDB database \fIname\fP. .TP 8 .B \-w Enable \fIGeoIP\fP. Enables GeoIP (by MaxMind Inc.) geolocation services. If native \fIGeoDB\fP services are also enabled, then this option will have no effect. .TP 8 .B \-W \fIname\fP \fBGeoIPDatabase\fP. Use the alternate GeoIP database \fIname\fP. .TP 8 .B \-z \fIname\fP \fBFlagDir\fP. Specify location of the country flag graphics and enable their display in the top country table. The directory \fIname\fP is relative to the output directory being used unless an absolute path is given (ie: starts with a leading '/'). .PP .I Hide Options .TP 8 .B \-a \fIname\fP \fBHideAgent\fP. Hide user agents matching \fIname\fP. .TP 8 .B \-r \fIname\fP \fBHideReferrer\fP. Hide referrer matching \fIname\fP. .TP 8 .B \-s \fIname\fP \fBHideSite\fP. Hide site matching \fIname\fP. .TP 8 .B \-X \fBHideAllSites\fP. Hide all individual sites (only display groups). .TP 8 .B \-u \fIname\fP \fBHideURL\fP. Hide URL matching \fIname\fP. .PP .I Table size options .TP 8 .B \-A \fInum\fP \fBTopAgents\fP. Display the top \fInum\fP user agents table. .TP 8 .B \-R \fInum\fP \fBTopReferrers\fP. Display the top \fInum\fP referrers table. .TP 8 .B \-S \fInum\fP \fBTopSites\fP. Display the top \fInum\fP sites table. .TP 8 .B \-U \fInum\fP \fBTopURLs\fP. Display the top \fInum\fP URLs table. .TP 8 .B \-C \fInum\fP \fBTopCountries\fP. Display the top \fInum\fP countries table. .TP 8 .B \-e \fInum\fP \fBTopEntry\fP. Display the top \fInum\fP entry pages table. .TP 8 .B \-E \fInum\fP \fBTopExit\fP. Display the top \fInum\fP exit pages table. .SH CONFIGURATION FILES Configuration files are standard \fBASCII(7)\fP text files that may be created or edited using any standard editor. Blank lines and lines that begin with a pound sign ('#') are ignored. Any other lines are considered to be configuration lines, and have the form "Keyword Value", where the \'Keyword\' is one of the currently available configuration keywords defined below, and 'Value' is the value to assign to that particular option. Any text found after the keyword up to the end of the line is considered the keyword's value, so you should not include anything after the actual value on the line that is not actually part of the value being assigned. The file \fIsample.conf\fP provided with the distribution contains lots of useful documentation and examples as well. .I General Configuration Keywords .TP 8 .B LogFile \fIname\fP Use log file named \fIname\fP. If none specified, \fISTDIN\fP will be used. .TP 8 .B LogType \fIname\fP Specify log file type as \fIname\fP. Values can be either \fIclf\fP, \fIsquid\fP, \fIftp\fP or \fIw3c\fP, with the default being \fBclf\fP. .TP 8 .B OutputDir \fIdir\fP Create output in the directory \fIdir\fP. If none specified, the current directory will be used. .TP 8 .B HistoryName \fIname\fP Filename to use for history file. Relative to output directory unless absolute name is given (ie: starts with '/'). Defaults to \'\fBwebalizer.hist\fP' in the standard output directory. .TP 8 .B ReportTitle \fIname\fP Use the title string \fIname\fP for the report title. If none specified, use the default of (in english) "\fIUsage Statistics for \fP". .TP 8 .B HostName \fIname\fP Set the hostname for the report as \fIname\fP. If none specified, an attempt will be made to gather the hostname via a \fBuname(2)\fP system call. If that fails, \fIlocalhost\fP will be used. .TP 8 .B UseHTTPS \fP( yes | \fBno\fP ) Use \fIhttps://\fP on links to URLS, instead of the default \fIhttp://\fP, in the '\fBTop URLs\fP' table. .TP 8 .B HTAccess \fP( yes | \fBno\fP ) Enables the creation of a default .htaccess file in the output directory. .TP 8 .B Quiet \fP( yes | \fBno\fP ) Suppress informational messages. Warning and Error messages will not be suppressed. .TP 8 .B ReallyQuiet \fP( yes | \fBno\fP ) Suppress all messages, including Warning and Error messages. .TP 8 .B Debug \fP( yes | \fBno\fP ) Print extra debugging information on Warnings and Errors. .TP 8 .B TimeMe \fP( yes | \fBno\fP ) Force timing information at end of processing. .TP 8 .B GMTTime \fP( yes | \fBno\fP ) Use \fIGMT \fP(\fIUTC\fP) time instead of local timezone for reports. .TP 8 .B IgnoreHist \fP( yes | \fBno\fP ) Ignore previous monthly history file. \fBUSE WITH CAUTION\fP. Does not prevent \fIIncremental\fP file processing. .TP 8 .B IgnoreState \fP( yes | \fBno\fP ) Ignore incremental data file. \fBUSE WITH CAUTION\fP. By ignoring the incremental data file, all previous processing for the current month will be lost and those logs must be re-processed. .TP 8 .B FoldSeqErr \fP( yes | \fBno\fP ) Fold out of sequence log records back into analysis by treating them as if they had the same date/time as the last good record. Normally, out of sequence log records are ignored. .TP 8 .B CountryGraph \fP( \fByes\fP | no ) Display Country Usage Graph in output report. .TP 8 .B CountryFlags \fP( yes | \fBno\fP ) Enable or disable the display of flags in the top country table. .TP 8 .B FlagDir \fIname\fP Specifies the directory \fIname\fP where the flag graphics are located. If not specified, the default is in the \fIflags\fP directory directly under the output directory being used. If specified, the display of country flags will be enabled by default. Using '\fIFlagDir flags\fP' is identical to using '\fICountryFlags yes\fP'. .TP 8 .B DailyGraph \fP( \fByes\fP | no ) Display Daily Graph in output report. .TP 8 .B DailyStats \fP( \fByes\fP | no ) Display Daily Statistics in output report. .TP 8 .B HourlyGraph \fP( \fByes\fP | no ) Display Hourly Graph in output report. .TP 8 .B HourlyStats \fP( \fByes\fP | no ) Display Hourly Statistics in output report. .TP 8 .B PageType \fIname\fP Define the file extensions to consider as a \fIpage\fP. If a file is found to have the same extension as \fIname\fP, it will be counted as a \fIpage\fP (sometimes called a \fIpageview\fP). .TP 8 .B PagePrefix \fIname\fP Allows URLs with the prefix \fIname\fP to be counted as a \fIpage\fP type regardless of actual file type. This allows you to treat contents under specified directories as pages no matter what their extension is. .TP 8 .B OmitPage \fIname\fP Specifies URLs which should not be counted as pages, regardless of their extension (or lack thereof). .TP 8 .B GraphLegend \fP( \fByes\fP | no ) Allows the color coded graph legends to be enabled/disabled. .TP 8 .B GraphLines \fInum\fP Specify the number of background reference lines displayed on the graphs produced. Disable by using zero ('\fB0\fP'), default is \fB2\fP. .TP 8 .B IndexMonths \fInum\fP Specify the number of months to display in the main index (yearly summary) table. Default is 12 months. Can be set to anything between 12 and 120 months (1 to 10 years). .TP 8 .B YearHeaders \fP( \fByes\fP | no ) Enable/disable the display of year headers in the main index (yearly summary) table. If enabled, year headers will be shown when the table is displaying more than 16 months worth of data. Values can be 'yes' or 'no'. Default is 'yes'. .TP 8 .B YearTotals \fP( \fByes\fP | no ) Enable/disable the display of year totals in the main index (yearly summary) table. If enabled, year totals will be shown when the table is displaying more than 16 months worth of data. Values can be 'yes' or 'no'. Default is 'yes'. .TP 8 .B GraphMonths \fInum\fP Specify the number of months to display in the main index (yearly summary) graph. Default is 12 months. Can be set to anything between 12 and 72 months (1 to 6 years). .TP 8 .B VisitTimeout \fInum\fP Specifies the visit timeout value. Default is \fI1800 seconds\fP (30 minutes). A visit is determined by looking at the difference in time between the current and last request from a specific site. If the difference is greater or equal to the timeout value, the request is counted as a new visit. Specified in seconds. .TP 8 .B IndexAlias \fIname\fP Use \fIname\fP as an additional alias for \fIindex.*\fP. .TP 8 .B DefaultIndex \fP( \fByes\fP | no ) Enables or disables the use of '\fBindex.\fP' as a default index name to be stripped from the end of URLs. This does not effect any index names that may be defined with the \fIIndexAlias\fP option. .TP 8 .B MangleAgents \fInum\fP Mangle user agent names based on mangle level \fInum\fP. See the \fI-M\fP command line switch for mangle levels and their meaning. The default is \fB0\fP, which doesn't mangle user agents at all. .TP 8 .B StripCGI \fP( \fByes\fP | no ) Determines if URL CGI variables should be stripped from the end of URLs. Values may be 'yes' or 'no', with the default being 'yes'. .TP 8 .B TrimSquidURL \fInum\fP Allows squid log URLs to be reduced in granularity by truncating them after \fInum\fP slashes ('/') after the http:// prefix. A setting of one (1) will cause all URLs to be summarized by domain only. The default value is zero (0), which will disable any URL modifications and leave them exactly as found in the log file. .TP 8 .B SearchEngine\fP \fIname\fP \fIvariable\fP Allows the specification of search engines and their query strings. The \fIname\fP is the name to match against the referrer string for a given search engine. The \fIvariable\fP is the cgi variable that the search engine uses for queries. See the \fBsample.conf\fP file for example usage with common search engines. .TP 8 .B SearchCaseI\fP ( \fByes\fP | no ) Determines if search strings should be treated case insensitive or not. The default is 'yes', which lowercases all search strings (treat as case insensitive). .TP 8 .B Incremental \fP( yes | \fBno\fP ) Enable Incremental mode processing. .TP 8 .B IncrementalName \fIname\fP Filename to use for incremental data. Relative to output directory unless an absolute name is given (ie: starts with '/'). Defaults to \'\fBwebalizer.current\fP' in the standard output directory. .TP 8 .B DNSCache \fIname\fP Filename to use for the DNS cache. Relative to output directory unless an absolute name is given (ie: starts with '/'). .TP 8 .B DNSChildren \fInum\fP Number of children DNS processes to run in order to create/update the DNS cache file. Specify zero (\fB0\fP) to disable. .TP 8 .B CacheIPs \fP( yes | \fBno\fP ) Cache unresolved IP addresses in the DNS database. Default is '\fBno\fP'. .TP 8 .B CacheTTL \fInum\fP DNS cache entry time to live (TTL) in days. Default is 7 days. May be any value between 1 and 100. .TP 8 .B GeoDB \fP( yes | \fBno\fP ) Allows native GeoDB geolocation services to be enabled or disabled. Default value is '\fBno\fP'. .TP 8 .B GeoDBDatabase \fIname\fP Allows the use of an alternate GeoDB database \fIname\fP. If not specified, the default database will be used. .TP 8 .B GeoIP \fP( yes | \fBno\fP ) Allows GeoIP (by MaxMind Inc.) geolocation services to be enabled or disabled. Default is '\fBno\fP'. If native \fIGeoDB\fP geolocation services are also enabled, then this option will have no effect (and the native \fIGeoDB\fP services will be used). .TP 8 .B GeoIPDatabase \fIname\fP Allows the use of an alternate GeoIP database \fIname\fP. If not specified, the default database will be used. .PP .I Top Table Keywords .TP 8 .B TopAgents \fInum\fP Display the top \fInum\fP User Agents table. Use zero to disable. .TP 8 .B AllAgents \fP( yes | \fBno\fP ) Create separate HTML page with \fBAll\fP User Agents. .TP 8 .B TopReferrers \fInum\fP Display the top \fInum\fP Referrers table. Use zero to disable. .TP 8 .B AllReferrers \fP( yes | \fBno\fP ) Create separate HTML page with \fBAll\fP Referrers. .TP 8 .B TopSites \fInum\fP Display the top \fInum\fP Sites table. Use zero to disable. .TP 8 .B TopKSites \fInum\fP Display the top \fInum\fP Sites (by KByte) table. Use zero to disable. .TP 8 .B AllSites \fP( yes | \fBno\fP ) Create separate HTML page with \fBAll\fP Sites. .TP 8 .B TopURLs \fInum\fP Display the top \fInum\fP URLs table. Use zero to disable. .TP 8 .B TopKURLs \fInum\fP Display the top \fInum\fP URLs (by KByte) table. Use zero to disable. .TP 8 .B AllURLs \fP( yes | \fBno\fP ) Create separate HTML page with \fBAll\fP URLs. .TP 8 .B TopCountries \fInum\fP Display the top \fInum\fP Countries in the table. Use zero to disable. .TP 8 .B TopEntry \fInum\fP Display the top \fInum\fP Entry Pages in the table. Use zero to disable. .TP 8 .B TopExit \fInum\fP Display the top \fInum\fP Exit Pages in the table. Use zero to disable. .TP 8 .B TopSearch \fInum\fP Display the top \fInum\fP Search Strings in the table. Use zero to disable. .TP 8 .B AllSearchStr \fP( yes | \fBno\fP ) Create separate HTML page with \fBAll\fP Search Strings. .TP 8 .B TopUsers \fInum\fP Display the top \fInum\fP Usernames in the table. Use zero to disable. Usernames are only available if using http based authentication. .TP 8 .B AllUsers \fP( yes | \fBno\fP ) Create separate HTML page with \fBAll\fP Usernames. .PP .I Hide/Ignore/Group/Include Keywords .TP 8 .B HideAgent \fIname\fP Hide User Agents that match \fIname\fP. .TP 8 .B HideReferrer \fIname\fP Hide Referrers that match \fIname\fP. .TP 8 .B HideSite \fIname\fP Hide Sites that match \fIname\fP. .TP 8 .B HideAllSites \fP( yes | \fBno\fP ) Hide all individual sites. This causes only grouped sites to be displayed. .TP 8 .B HideURL \fIname\fP Hide URLs that match \fIname\fP. .TP 8 .B HideUser \fIname\fP Hide Usernames that match \fIname\fP. .TP 8 .B IgnoreAgent \fIname\fP Ignore User Agents that match \fIname\fP. .TP 8 .B IgnoreReferrer \fIname\fP Ignore Referrers that match \fIname\fP. .TP 8 .B IgnoreSite \fIname\fP Ignore Sites that match \fIname\fP. .TP 8 .B IgnoreURL \fIname\fP Ignore URLs that match \fIname\fP. .TP 8 .B IgnoreUser \fIname\fP Ignore Usernames that match \fIname\fP. .TP 8 .B GroupAgent \fIname\fP [\fILabel\fP] Group User Agents that match \fIname\fP. Display \fILabel\fP in 'Top Agent' table if given (instead of \fIname\fP). \fIname\fP may be enclosed in quotes. .TP 8 .B GroupReferrer \fIname\fP [\fILabel\fP] Group Referrers that match \fIname\fP. Display \fILabel\fP in 'Top Referrer' table if given (instead of \fIname\fP). \fIname\fP may be enclosed in quotes. .TP 8 .B GroupSite \fIname\fP [\fILabel\fP] Group Sites that match \fIname\fP. Display \fILabel\fP in 'Top Site' table if given (instead of \fIname\fP). \fIname\fP may be enclosed in quotes. .TP 8 .B GroupDomains \fInum\fP Automatically group sites by domain. The value \fInum\fP specifies the level of grouping, and can be thought of as the 'number of dots' to be displayed. The default value of \fB0\fP disables domain grouping. .TP 8 .B GroupURL \fIname\fP [\fILabel\fP] Group URLs that match \fIname\fP. Display \fILabel\fP in 'Top URL' table if given (instead of \fIname\fP). \fIname\fP may be enclosed in quotes. .TP 8 .B GroupUser \fIname\fP [\fILabel\fP] Group Usernames that match \fIname\fP. Display \fILabel\fP in 'Top Usernames' table if given (instead of \fIname\fP). \fIname\fP may be enclosed in quotes. .TP 8 .B IncludeSite \fIname\fP Force inclusion of sites that match \fIname\fP. Takes precedence over \fBIgnore*\fP keywords. .TP 8 .B IncludeURL \fIname\fP Force inclusion of URLs that match \fIname\fP. Takes precedence over \fBIgnore*\fP keywords. .TP 8 .B IncludeReferrer \fIname\fP Force inclusion of Referrers that match \fIname\fP. Takes precedence over \fBIgnore*\fP keywords. .TP 8 .B IncludeAgent \fIname\fP Force inclusion of User Agents that match \fIname\fP. Takes precedence over \fBIgnore*\fP keywords. .TP 8 .B IncludeUser \fIname\fP Force inclusion of Usernames that match \fIname\fP. Takes precedence over \fBIgnore*\fP keywords. .PP .I HTML Generation Keywords .TP 8 .B HTMLExtension \fItext\fP Defines the HTML file extension to use. Default is \fIhtml\fP. Do not include the leading period! .TP 8 .B HTMLPre \fItext\fP Insert \fItext\fP at the very beginning of the generated HTML file. Defaults to a standard html 3.2 \fIDOCTYPE\fP record. .TP 8 .B HTMLHead \fItext\fP Insert \fItext\fP within the <HEAD></HEAD> block of the HTML file. .TP 8 .B HTMLBody \fItext\fP Insert \fItext\fP in HTML page, starting with the <BODY> tag. If used, the first line must be a \fI<BODY ...>\fP tag. Multiple lines may be specified. .TP 8 .B HTMLPost \fItext\fP Insert \fItext\fP at top (before horiz. rule) of HTML pages. Multiple lines may be specified. .TP 8 .B HTMLTail \fItext\fP Insert \fItext\fP at bottom of the HTML page. The \fItext\fP is top and right aligned within a table column at the end of the report. .TP 8 .B HTMLEnd \fItext\fP Insert \fItext\fP at the very end of the HTML page. If not specified, the default is to insert the ending </BODY> and </HTML> tags. If used, you \fImust\fP supply these tags yourself. .TP 8 .B LinkReferrer \fP( yes | \fBno\fP ) Determines if the referrers listed in the top referrers table should be displayed as plain text, or as a link to the referrer URL. .TP 8 .B ColorHit \fP( rrggbb | \fB00805c\fP ) Sets the graph's hit-color to the specified html color (no '#'). .TP 8 .B ColorFile \fP( rrggbb | \fB0040ff\fP ) Sets the graph's file-color to the specified html color (no '#'). .TP 8 .B ColorSite \fP( rrggbb | \fBff8000\fP ) Sets the graph's site-color to the specified html color (no '#'). .TP 8 .B ColorKbyte \fP( rrggbb | \fBff0000\fP ) Sets the graph's kilobyte-color to the specified html color (no '#'). .TP 8 .B ColorPage \fP( rrggbb | \fB00e0ff\fP ) Sets the graph's page-color to the specified html color (no '#'). .TP 8 .B ColorVisit \fP( rrggbb | \fBffff00\fP ) Sets the graph's visit-color to the specified html color (no '#'). .TP 8 .B ColorMisc \fP( rrggbb | \fB00e0ff\fP ) Sets the 'miscellaneous' color for table headers (not graphs) to the specified html color (no '#'). .TP 8 .B PieColor1 \fP( rrggbb | \fB800080\fP ) Sets the pie's first optional color to the specified html color (no '#'). .TP 8 .B PieColor2 \fP( rrggbb | \fB80ffc0\fP ) Sets the pie's second optional color to the specified html color (no '#'). .TP 8 .B PieColor3 \fP( rrggbb | \fBff00ff\fP ) Sets the pie's third optional color to the specified html color (no '#'). .TP 8 .B PieColor4 \fP( rrggbb | \fBffc480\fP ) Sets the pie's fourth optional color to the specified html color (no '#'). .PP .I Dump Object Keywords .PP The \fIWebalizer\fP allows you to export processed data to other programs by using \fItab delimited\fP text files. The \fIDump*\fP commands specify which files are to be written, and where. .TP 8 .B DumpPath \fIname\fP Save dump files in directory \fIname\fP. If not specified, the default output directory will be used. Do not specify a trailing slash ('/'). .TP 8 .B DumpExtension \fIname\fP Use \fIname\fP as the filename extension for dump files. If not given, the default of \fBtab\fP will be used. .TP 8 .B DumpHeader \fP( yes | \fBno\fP ) Print a column header as the first record of the file. .TP 8 .B DumpSites \fP( yes | \fBno\fP ) Dump the sites data to a tab delimited file. .TP 8 .B DumpURLs \fP( yes | \fBno\fP ) Dump the url data to a tab delimited file. .TP 8 .B DumpReferrers \fP( yes | \fBno\fP ) Dump the referrer data to a tab delimited file. This data is only available if using a log that contains referrer information (ie: a combined format web log). .TP 8 .B DumpAgents \fP( yes | \fBno\fP ) Dump the user agent data to a tab delimited file. This data is only available if using a log that contains user agent information (ie: a combined format web log). .TP 8 .B DumpUsers \fP( yes | \fBno\fP ) Dump the username data to a tab delimited file. This data is only available if processing a wu-ftpd xferlog or a web log that contains http authentication information. .TP 8 .B DumpSearchStr \fP( yes | \fBno\fP ) Dump the search string data to a tab delimited file. This data is only available if processing a web log that contains referrer information and had search string information present. .SH FILES .TP 20 .I webalizer.conf Default configuration file. Is searched for in the current directory and if not found, in the \fI/etc/\fP directory. .TP 20 .I webalizer.hist Monthly history file for previous months. (can be changed) .TP 20 .I webalizer.current Current state data file (Incremental processing). (can be changed) .TP 20 .I xxxxx_YYYYMM.html Various monthly \fIHTML\fP output files produced. (extension can be changed) .TP 20 .I xxxxx_YYYYMM.png Various monthly image files used in the reports. .TP 20 .I xxxxx_YYYYMM.tab Monthly tab delimited text files. (extension can be changed) .SH BUGS Please report bugs to the author. .SH COPYRIGHT Copyright (C) 1997-2011 by Bradford L. Barrett. Distributed under the GNU GPL. See the files "\fICOPYING\fP" and "\fICopyright\fP", supplied with all distributions for additional information. .SH AUTHOR Bradford L. Barrett <\fIbrad at mrunix dot net\fP> �������������������������������������������webalizer-2.23-05/webalizer.LSM���������������������������������������������������������������������0000644�0001750�0001750�00000002646�11032254167�014622� 0����������������������������������������������������������������������������������������������������ustar �brad����������������������������brad�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Begin3 Title: The Webalizer Version: 2.20 Entered-date: 01JUN2008 Description: A fast, free web server log file analysis program. Produces HTML output for viewing with a web browser. Written in C on a Linux platform, however designed to be as ANSI/POSIX compliant as possible so porting to other UNIX platforms should be painless. Binary distributions for most popular platforms are available. Features multiple language support, incremental processing capabilities, reverse DNS lookup support, native geolocation support as well as geolocation support via the optional GeoIP library and database from MaxMind Inc., data export via tab delimited ASCII files to popular databases and spreadsheets, and much more. Supports all standard CLF and combined web logs, wu-ftpd xferlog, squid proxy and extended W3C format logs, all of which can be either in standard text format or compressed using gzip or bzip2. Keywords: Web Analysis, Log Analysis, Linux, Unix, apache, wcmgr, GeoDB Author: Bradford L. Barrett Maintained-by: Bradford L. Barrett Primary-site: http://www.webalizer.org/ Original-site: ftp://ftp.webalizer.org/pub/webalizer/ Platforms: Linux/Unix, OS/2, Win32, MacOSX, POSIX Copying-policy: GPL End ������������������������������������������������������������������������������������������webalizer-2.23-05/webalizer.c�����������������������������������������������������������������������0000644�0001750�0001750�00000304215�11551756456�014424� 0����������������������������������������������������������������������������������������������������ustar �brad����������������������������brad�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* webalizer - a web server log analysis program Copyright (C) 1997-2011 Bradford L. Barrett This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version, and provided that the above copyright and permission notice is included with all distributed copies of this or derived software. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ /*********************************************/ /* STANDARD INCLUDES */ /*********************************************/ /* Fix broken Zlib 64 bitness */ #if _FILE_OFFSET_BITS == 64 #ifndef _LARGEFILE64_SOURCE #define _LARGEFILE64_SOURCE 1 #endif #endif #include <time.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <errno.h> #include <unistd.h> /* normal stuff */ #include <locale.h> #include <ctype.h> #include <sys/utsname.h> #include <zlib.h> #include <sys/stat.h> /* ensure getopt */ #ifdef HAVE_GETOPT_H #include <getopt.h> #endif /* ensure sys/types */ #ifndef _SYS_TYPES_H #include <sys/types.h> #endif /* Need socket header? */ #ifdef HAVE_SYS_SOCKET_H #include <sys/socket.h> #endif /* some systems need this */ #ifdef HAVE_MATH_H #include <math.h> #endif #ifdef USE_DNS #include <netdb.h> #include <netinet/in.h> #include <arpa/inet.h> #include <db.h> #endif /* USE_DNS */ #ifdef USE_GEOIP #include <GeoIP.h> #endif #ifdef USE_BZIP #include <bzlib.h> int bz2_rewind(void **, char *, char *); #endif #include "webalizer.h" /* main header */ #include "output.h" #include "parser.h" #include "preserve.h" #include "hashtab.h" #include "linklist.h" #include "webalizer_lang.h" /* lang. support */ #ifdef USE_DNS #include "dns_resolv.h" #endif /* internal function prototypes */ void clear_month(); /* clear monthly stuff */ char *unescape(char *); /* unescape URLs */ void print_opts(char *); /* print options */ void print_version(); /* duhh... */ int isurlchar(unsigned char, int); /* valid URL char fnc. */ void get_config(char *); /* Read a config file */ static char *save_opt(char *); /* save conf option */ void srch_string(char *); /* srch str analysis */ char *get_domain(char *); /* return domain name */ void agent_mangle(char *); /* reformat user agent */ char *our_gzgets(void *, char *, int); /* our gzgets */ int ouricmp(char *, char *); /* case ins. compare */ int isipaddr(char *); /* is IP address test */ /*********************************************/ /* GLOBAL VARIABLES */ /*********************************************/ char *version = "2.23"; /* program version */ char *editlvl = "05"; /* edit level */ char *moddate = "14-Apr-2011"; /* modification date */ char *copyright = "Copyright 1997-2011 by Bradford L. Barrett"; int verbose = 2; /* 2=verbose,1=err, 0=none */ int debug_mode = 0; /* debug mode flag */ int time_me = 0; /* timing display flag */ int local_time = 1; /* 1=localtime 0=GMT (UTC) */ int hist_gap = 0; /* 1=error w/hist, save bkp */ int ignore_hist = 0; /* history flag (1=skip) */ int ignore_state = 0; /* state flag (1=skip) */ int default_index= 1; /* default index. (1=yes) */ int hourly_graph = 1; /* hourly graph display */ int hourly_stats = 1; /* hourly stats table */ int daily_graph = 1; /* daily graph display */ int daily_stats = 1; /* daily stats table */ int ctry_graph = 1; /* country graph display */ int shade_groups = 1; /* Group shading 0=no 1=yes */ int hlite_groups = 1; /* Group hlite 0=no 1=yes */ int mangle_agent = 0; /* mangle user agents */ int incremental = 0; /* incremental mode 1=yes */ int use_https = 0; /* use 'https://' on URLs */ int htaccess = 0; /* create .htaccess? (0=no) */ int stripcgi = 1; /* strip url cgi (0=no) */ int normalize = 1; /* normalize CLF URL (0=no) */ int trimsquid = 0; /* trim squid urls (0=no) */ int searchcasei = 1; /* case insensitive search */ int visit_timeout= 1800; /* visit timeout (seconds) */ int graph_legend = 1; /* graph legend (1=yes) */ int graph_lines = 2; /* graph lines (0=none) */ int fold_seq_err = 0; /* fold seq err (0=no) */ int log_type = LOG_CLF; /* log type (default=CLF) */ int group_domains= 0; /* Group domains 0=none */ int hide_sites = 0; /* Hide ind. sites (0=no) */ int link_referrer= 0; /* Link referrers (0=no) */ char *hname = NULL; /* hostname for reports */ char *state_fname = "webalizer.current"; /* run state file name */ char *hist_fname = "webalizer.hist"; /* name of history file */ char *html_ext = "html"; /* HTML file suffix */ char *dump_ext = "tab"; /* Dump file suffix */ char *conf_fname = NULL; /* name of config file */ char *log_fname = NULL; /* log file pointer */ char *out_dir = NULL; /* output directory */ char *blank_str = ""; /* blank string */ char *geodb_fname = NULL; /* GeoDB database filename */ char *dns_cache = NULL; /* DNS cache file name */ int dns_children = 0; /* DNS children (0=don't do)*/ int cache_ips = 0; /* CacheIPs in DB (0=no) */ int cache_ttl = 7; /* DNS Cache TTL (days) */ int geodb = 0; /* Use GeoDB (0=no) */ int graph_mths = 12; /* # months in index graph */ int index_mths = 12; /* # months in index table */ int year_hdrs = 1; /* index year seperators */ int year_totals = 1; /* index year subtotals */ int use_flags = 0; /* Show flags in ctry table */ char *flag_dir = "flags"; /* location of flag icons */ #ifdef USE_GEOIP int geoip = 0; /* Use GeoIP (0=no) */ char *geoip_db = NULL; /* GeoIP database filename */ GeoIP *geo_fp = NULL; /* GeoIP database handle */ #endif int ntop_sites = 30; /* top n sites to display */ int ntop_sitesK = 10; /* top n sites (by kbytes) */ int ntop_urls = 30; /* top n url's to display */ int ntop_urlsK = 10; /* top n url's (by kbytes) */ int ntop_entry = 10; /* top n entry url's */ int ntop_exit = 10; /* top n exit url's */ int ntop_refs = 30; /* top n referrers "" */ int ntop_agents = 15; /* top n user agents "" */ int ntop_ctrys = 30; /* top n countries "" */ int ntop_search = 20; /* top n search strings */ int ntop_users = 20; /* top n users to display */ int all_sites = 0; /* List All sites (0=no) */ int all_urls = 0; /* List All URLs (0=no) */ int all_refs = 0; /* List All Referrers */ int all_agents = 0; /* List All User Agents */ int all_search = 0; /* List All Search Strings */ int all_users = 0; /* List All Usernames */ int dump_sites = 0; /* Dump tab delimited sites */ int dump_urls = 0; /* URLs */ int dump_refs = 0; /* Referrers */ int dump_agents = 0; /* User Agents */ int dump_users = 0; /* Usernames */ int dump_search = 0; /* Search strings */ int dump_header = 0; /* Dump header as first rec */ char *dump_path = NULL; /* Path for dump files */ int cur_year=0, cur_month=0, /* year/month/day/hour */ cur_day=0, cur_hour=0, /* tracking variables */ cur_min=0, cur_sec=0; u_int64_t cur_tstamp=0; /* Timestamp... */ u_int64_t rec_tstamp=0; u_int64_t req_tstamp=0; u_int64_t epoch; /* used for timestamp adj. */ int check_dup=0; /* check for dup flag */ int gz_log=COMP_NONE; /* gziped log? (0=no) */ double t_xfer=0.0; /* monthly total xfer value */ u_int64_t t_hit=0,t_file=0,t_site=0, /* monthly total vars */ t_url=0,t_ref=0,t_agent=0, t_page=0, t_visit=0, t_user=0; double tm_xfer[31]; /* daily transfer totals */ u_int64_t tm_hit[31], tm_file[31], /* daily total arrays */ tm_site[31], tm_page[31], tm_visit[31]; u_int64_t dt_site; /* daily 'sites' total */ u_int64_t ht_hit=0, mh_hit=0; /* hourly hits totals */ u_int64_t th_hit[24], th_file[24], /* hourly total arrays */ th_page[24]; double th_xfer[24]; int f_day,l_day; /* first/last day vars */ struct utsname system_info; /* system info structure */ u_int64_t ul_bogus =0; /* Dummy counter for groups */ struct log_struct log_rec; /* expanded log storage */ void *zlog_fp; /* compressed logfile ptr */ FILE *log_fp; /* regular logfile pointer */ char buffer[BUFSIZE]; /* log file record buffer */ char tmp_buf[BUFSIZE]; /* used to temp save above */ CLISTPTR *top_ctrys = NULL; /* Top countries table */ #define GZ_BUFSIZE 16384 /* our_getfs buffer size */ char f_buf[GZ_BUFSIZE]; /* our_getfs buffer */ char *f_cp=f_buf+GZ_BUFSIZE; /* pointer into the buffer */ int f_end=0; /* count to end of buffer */ char hit_color[] = "#00805c"; /* graph hit color */ char file_color[] = "#0040ff"; /* graph file color */ char site_color[] = "#ff8000"; /* graph site color */ char kbyte_color[] = "#ff0000"; /* graph kbyte color */ char page_color[] = "#00e0ff"; /* graph page color */ char visit_color[] = "#ffff00"; /* graph visit color */ char misc_color[] = "#00e0ff"; /* graph misc color */ char pie_color1[] = "#800080"; /* pie additionnal color 1 */ char pie_color2[] = "#80ffc0"; /* pie additionnal color 2 */ char pie_color3[] = "#ff00ff"; /* pie additionnal color 3 */ char pie_color4[] = "#ffc080"; /* pie additionnal color 4 */ /*********************************************/ /* MAIN - start here */ /*********************************************/ int main(int argc, char *argv[]) { int i; /* generic counter */ char *cp1, *cp2, *cp3; /* generic char pointers */ char host_buf[MAXHOST+1]; /* used to save hostname */ NLISTPTR lptr; /* generic list pointer */ extern char *optarg; /* used for command line */ extern int optind; /* parsing routine 'getopt' */ extern int opterr; time_t start_time, end_time; /* program timers */ float temp_time; /* temporary time storage */ int rec_year,rec_month=1,rec_day,rec_hour,rec_min,rec_sec; int good_rec =0; /* 1 if we had a good record */ u_int64_t total_rec =0; /* Total Records Processed */ u_int64_t total_ignore=0; /* Total Records Ignored */ u_int64_t total_bad =0; /* Total Bad Records */ int max_ctry; /* max countries defined */ /* month names used for parsing logfile (shouldn't be lang specific) */ char *log_month[12]={ "jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec"}; /* stat struct for files */ struct stat log_stat; /* Assume that LC_CTYPE is what the user wants for non-ASCII chars */ setlocale(LC_CTYPE,""); /* initalize epoch */ epoch=jdate(1,1,1970); /* used for timestamp adj. */ sprintf(tmp_buf,"%s/webalizer.conf",ETCDIR); /* check for default config file */ if (!access("webalizer.conf",F_OK)) get_config("webalizer.conf"); else if (!access(tmp_buf,F_OK)) get_config(tmp_buf); /* get command line options */ opterr = 0; /* disable parser errors */ while ((i=getopt(argc,argv,"a:A:bc:C:dD:e:E:fF:g:GhHiI:jJ:k:K:l:Lm:M:n:N:o:O:pP:qQr:R:s:S:t:Tu:U:vVwW:x:XYz:Z"))!=EOF) { switch (i) { case 'a': add_nlist(optarg,&hidden_agents); break; /* Hide agents */ case 'A': ntop_agents=atoi(optarg); break; /* Top agents */ case 'b': ignore_state=1; break; /* Ignore state file */ case 'c': get_config(optarg); break; /* Config file */ case 'C': ntop_ctrys=atoi(optarg); break; /* Top countries */ case 'd': debug_mode=1; break; /* Debug */ case 'D': dns_cache=optarg; break; /* DNS Cache filename */ case 'e': ntop_entry=atoi(optarg); break; /* Top entry pages */ case 'E': ntop_exit=atoi(optarg); break; /* Top exit pages */ case 'f': fold_seq_err=1; break; /* Fold sequence errs */ case 'F': log_type=(tolower(optarg[0])=='f')? LOG_FTP:(tolower(optarg[0])=='s')? LOG_SQUID:(tolower(optarg[0])=='w')? LOG_W3C:LOG_CLF; break; /* define log type */ case 'g': group_domains=atoi(optarg); break; /* GroupDomains (0=no) */ case 'G': hourly_graph=0; break; /* no hourly graph */ case 'h': print_opts(argv[0]); break; /* help */ case 'H': hourly_stats=0; break; /* no hourly stats */ case 'i': ignore_hist=1; break; /* Ignore history */ case 'I': add_nlist(optarg,&index_alias); break; /* Index alias */ case 'j': geodb=1; break; /* Enable GeoDB */ case 'J': geodb_fname=optarg; break; /* GeoDB db filename */ case 'k': graph_mths=atoi(optarg); break; /* # months idx graph */ case 'K': index_mths=atoi(optarg); break; /* # months idx table */ case 'l': graph_lines=atoi(optarg); break; /* Graph Lines */ case 'L': graph_legend=0; break; /* Graph Legends */ case 'm': visit_timeout=atoi(optarg); break; /* Visit Timeout */ case 'M': mangle_agent=atoi(optarg); break; /* mangle user agents */ case 'n': hname=optarg; break; /* Hostname */ case 'N': dns_children=atoi(optarg); break; /* # of DNS children */ case 'o': out_dir=optarg; break; /* Output directory */ case 'O': add_nlist(optarg,&omit_page); break; /* pages not counted */ case 'p': incremental=1; break; /* Incremental run */ case 'P': add_nlist(optarg,&page_type); break; /* page view types */ case 'q': verbose=1; break; /* Quiet (verbose=1) */ case 'Q': verbose=0; break; /* Really Quiet */ case 'r': add_nlist(optarg,&hidden_refs); break; /* Hide referrer */ case 'R': ntop_refs=atoi(optarg); break; /* Top referrers */ case 's': add_nlist(optarg,&hidden_sites); break; /* Hide site */ case 'S': ntop_sites=atoi(optarg); break; /* Top sites */ case 't': msg_title=optarg; break; /* Report title */ case 'T': time_me=1; break; /* TimeMe */ case 'u': add_nlist(optarg,&hidden_urls); break; /* hide URL */ case 'U': ntop_urls=atoi(optarg); break; /* Top urls */ case 'v': verbose=2; debug_mode=1; break; /* Verbose */ case 'V': print_version(); break; /* Version */ #ifdef USE_GEOIP case 'w': geoip=1; break; /* Enable GeoIP */ case 'W': geoip_db=optarg; break; /* GeoIP database name */ #endif case 'x': html_ext=optarg; break; /* HTML file extension */ case 'X': hide_sites=1; break; /* Hide ind. sites */ case 'Y': ctry_graph=0; break; /* Supress ctry graph */ case 'Z': normalize=0; break; /* Dont normalize URLs */ case 'z': use_flags=1; flag_dir=optarg; break; /* Ctry flag dir */ } } if (argc - optind != 0) log_fname = argv[optind]; if ( log_fname && (log_fname[0]=='-')) log_fname=NULL; /* force STDIN? */ /* check for gzipped file - .gz */ if (log_fname) if (!strcmp((log_fname+strlen(log_fname)-3),".gz")) gz_log=COMP_GZIP; #ifdef USE_BZIP /* check for bzip file - .bz2 */ if (log_fname) if (!strcmp((log_fname+strlen(log_fname)-4),".bz2")) gz_log=COMP_BZIP; #endif /* setup our internal variables */ init_counters(); /* initalize (zero) main counters */ memset(hist, 0, sizeof(hist)); /* initalize (zero) history array */ /* add default index. alias if needed */ if (default_index) add_nlist("index.",&index_alias); if (page_type==NULL) /* check if page types present */ { if ((log_type==LOG_CLF)||(log_type==LOG_SQUID)||(log_type==LOG_W3C)) { add_nlist("htm*" ,&page_type); /* if no page types specified, we */ add_nlist("cgi" ,&page_type); /* use the default ones here... */ if (!isinlist(page_type,html_ext)) add_nlist(html_ext,&page_type); } else add_nlist("txt" ,&page_type); /* FTP logs default to .txt */ } for (max_ctry=0;ctry[max_ctry].desc;max_ctry++); if (ntop_ctrys > max_ctry) ntop_ctrys = max_ctry; /* force upper limit */ if (graph_lines> 20) graph_lines= 20; /* keep graphs sane! */ if (graph_mths<12) graph_mths=12; if (graph_mths>GRAPHMAX) graph_mths=GRAPHMAX; if (index_mths<12) index_mths=12; if (index_mths>HISTSIZE) index_mths=HISTSIZE; if (log_type == LOG_FTP) { /* disable stuff for ftp logs */ ntop_entry=ntop_exit=0; ntop_search=0; } else { if (search_list==NULL) { /* If no search engines defined, define some :) */ add_glist(".google. q=" ,&search_list); add_glist("yahoo.com p=" ,&search_list); add_glist("altavista.com q=" ,&search_list); add_glist("aolsearch. query=" ,&search_list); add_glist("ask.co q=" ,&search_list); add_glist("eureka.com q=" ,&search_list); add_glist("lycos.com query=" ,&search_list); add_glist("hotbot.com MT=" ,&search_list); add_glist("msn.com q=" ,&search_list); add_glist("infoseek.com qt=" ,&search_list); add_glist("webcrawler searchText=" ,&search_list); add_glist("excite search=" ,&search_list); add_glist("netscape.com query=" ,&search_list); add_glist("mamma.com query=" ,&search_list); add_glist("alltheweb.com q=" ,&search_list); add_glist("northernlight.com qr=" ,&search_list); } } /* ensure entry/exits don't exceed urls */ i=(ntop_urls>ntop_urlsK)?ntop_urls:ntop_urlsK; if (ntop_entry>i) ntop_entry=i; if (ntop_exit>i) ntop_exit=i; for (i=0;i<MAXHASH;i++) { sm_htab[i]=sd_htab[i]=NULL; /* initalize hash tables */ um_htab[i]=NULL; rm_htab[i]=NULL; am_htab[i]=NULL; sr_htab[i]=NULL; } /* Be polite and announce yourself... */ if (verbose>1) { uname(&system_info); printf("Webalizer V%s-%s (%s %s %s) %s\n", version,editlvl, system_info.sysname, system_info.release, system_info.machine,language); } #ifndef USE_DNS if (strstr(argv[0],"webazolver")!=0) /* DNS support not present, aborting... */ { printf("%s\n",msg_dns_abrt); exit(1); } #else /* Force sane values for cache TTL */ if (cache_ttl<1) cache_ttl=1; if (cache_ttl>100) cache_ttl=100; #endif /* USE_DNS */ /* open log file */ if (log_fname) { /* stat the file */ if ( !(lstat(log_fname, &log_stat)) ) { /* check if the file a symlink */ if ( S_ISLNK(log_stat.st_mode) ) { if (verbose) fprintf(stderr,"%s %s (symlink)\n",msg_log_err,log_fname); exit(EBADF); } } if (gz_log) { /* open compressed file */ #ifdef USE_BZIP if (gz_log==COMP_BZIP) zlog_fp = BZ2_bzopen(log_fname,"rb"); else #endif zlog_fp = gzopen(log_fname, "rb"); if (zlog_fp==Z_NULL) { /* Error: Can't open log file ... */ fprintf(stderr, "%s %s (%d)\n",msg_log_err,log_fname,ENOENT); exit(ENOENT); } } else { /* open regular file */ log_fp = fopen(log_fname,"r"); if (log_fp==NULL) { /* Error: Can't open log file ... */ fprintf(stderr, "%s %s\n",msg_log_err,log_fname); exit(1); } } } /* Using logfile ... */ if (verbose>1) { printf("%s %s (",msg_log_use,log_fname?log_fname:"STDIN"); if (gz_log==COMP_GZIP) printf("gzip-"); #ifdef USE_BZIP if (gz_log==COMP_BZIP) printf("bzip-"); #endif switch (log_type) { /* display log file type hint */ case LOG_CLF: printf("clf)\n"); break; case LOG_FTP: printf("ftp)\n"); break; case LOG_SQUID: printf("squid)\n"); break; case LOG_W3C: printf("w3c)\n"); break; } } /* switch directories if needed */ if (out_dir) { if (chdir(out_dir) != 0) { /* Error: Can't change directory to ... */ fprintf(stderr, "%s %s\n",msg_dir_err,out_dir); exit(1); } } #ifdef USE_DNS if (strstr(argv[0],"webazolver")!=0) { if (!dns_children) dns_children=5; /* default dns children if needed */ if (!dns_cache) { /* No cache file specified, aborting... */ fprintf(stderr,"%s\n",msg_dns_nocf); /* Must have a cache file */ exit(1); } } if (dns_cache && dns_children) /* run-time resolution */ { if (dns_children > MAXCHILD) dns_children=MAXCHILD; /* DNS Lookup (#children): */ if (verbose>1) printf("%s (%d): ",msg_dns_rslv,dns_children); fflush(stdout); (gz_log)?dns_resolver(zlog_fp):dns_resolver(log_fp); #ifdef USE_BZIP (gz_log==COMP_BZIP)?bz2_rewind(&zlog_fp, log_fname, "rb"): #endif (gz_log==COMP_GZIP)?gzrewind(zlog_fp): (log_fname)?rewind(log_fp):exit(0); } if (strstr(argv[0],"webazolver")!=0) exit(0); /* webazolver exits here */ if (dns_cache) { if (!open_cache()) { dns_cache=NULL; dns_db=NULL; } else { /* Using DNS cache file <filaneme> */ if (verbose>1) printf("%s %s\n",msg_dns_usec,dns_cache); } } /* Open GeoDB? */ if (geodb) { geo_db=geodb_open(geodb_fname); if (geo_db==NULL) { if (verbose) printf("%s: %s\n",msg_geo_open, (geodb_fname)?geodb_fname:msg_geo_dflt); if (verbose) printf("GeoDB %s\n",msg_geo_nolu); geodb=0; } else if (verbose>1) printf("%s %s\n", msg_geo_use,geodb_ver(geo_db,buffer)); #ifdef USE_GEOIP if (geoip) geoip=0; /* Disable GeoIP if using GeoDB */ #endif } #endif /* USE_DNS */ #ifdef USE_GEOIP /* open GeoIP database */ if (geoip) { if (geoip_db!=NULL) geo_fp=GeoIP_open(geoip_db, GEOIP_MEMORY_CACHE); else geo_fp=GeoIP_new(GEOIP_MEMORY_CACHE); /* Did we open one? */ if (geo_fp==NULL) { /* couldn't open.. warn user */ if (verbose) printf("GeoIP %s\n",msg_geo_nolu); geoip=0; } else if (verbose>1) printf("%s %s (%s)\n",msg_geo_use, GeoIPDBDescription[(int)geo_fp->databaseType], (geoip_db==NULL)?msg_geo_dflt:geo_fp->file_path); } #endif /* USE_GEOIP */ /* Creating output in ... */ if (verbose>1) printf("%s %s\n",msg_dir_use,out_dir?out_dir:msg_cur_dir); /* prep hostname */ if (!hname) { if (uname(&system_info)) hname="localhost"; else hname=system_info.nodename; } /* Hostname for reports is ... */ if (strlen(hname)) if (verbose>1) printf("%s '%s'\n",msg_hostname,hname); /* get past history */ if (ignore_hist) { if (verbose>1) printf("%s\n",msg_ign_hist); } else get_history(); if (incremental) /* incremental processing? */ { if ((i=restore_state())) /* restore internal data structs */ { /* Error: Unable to restore run data (error num) */ /* if (verbose) fprintf(stderr,"%s (%d)\n",msg_bad_data,i); */ fprintf(stderr,"%s (%d)\n",msg_bad_data,i); exit(1); } } /* Allocate memory for our TOP countries array */ if (ntop_ctrys != 0) { if ( (top_ctrys=calloc(ntop_ctrys,sizeof(CLISTPTR))) == NULL) /* Can't get memory, Top Countries disabled! */ {if (verbose) fprintf(stderr,"%s\n",msg_nomem_tc); ntop_ctrys=0;}} /* get processing start time */ start_time = time(NULL); /*********************************************/ /* MAIN PROCESS LOOP - read through log file */ /*********************************************/ while ( (gz_log)?(our_gzgets(zlog_fp,buffer,BUFSIZE) != Z_NULL): (fgets(buffer,BUFSIZE,log_fname?log_fp:stdin) != NULL)) { total_rec++; if (strlen(buffer) == (BUFSIZE-1)) { if (verbose) { fprintf(stderr,"%s",msg_big_rec); if (debug_mode) fprintf(stderr,":\n%s",buffer); else fprintf(stderr,"\n"); } total_bad++; /* bump bad record counter */ /* get the rest of the record */ while ( (gz_log)?(our_gzgets(zlog_fp,buffer,BUFSIZE)!=Z_NULL): (fgets(buffer,BUFSIZE,log_fname?log_fp:stdin)!=NULL)) { if (strlen(buffer) < BUFSIZE-1) { if (debug_mode && verbose) fprintf(stderr,"%s\n",buffer); break; } if (debug_mode && verbose) fprintf(stderr,"%s",buffer); } continue; /* go get next record if any */ } /* got a record... */ strcpy(tmp_buf, buffer); /* save buffer in case of error */ if (parse_record(buffer)) /* parse the record */ { /*********************************************/ /* PASSED MINIMAL CHECKS, DO A LITTLE MORE */ /*********************************************/ /* convert month name to lowercase */ for (i=4;i<7;i++) log_rec.datetime[i]=tolower(log_rec.datetime[i]); /* lowercase sitename/IPv6 addresses */ cp1=log_rec.hostname; while (*cp1++!='\0') *cp1=tolower(*cp1); /* get year/month/day/hour/min/sec values */ for (i=0;i<12;i++) { if (strncmp(log_month[i],&log_rec.datetime[4],3)==0) { rec_month = i+1; break; } } rec_year=atoi(&log_rec.datetime[8]); /* get year number (int) */ rec_day =atoi(&log_rec.datetime[1]); /* get day number */ rec_hour=atoi(&log_rec.datetime[13]); /* get hour number */ rec_min =atoi(&log_rec.datetime[16]); /* get minute number */ rec_sec =atoi(&log_rec.datetime[19]); /* get second number */ /* Kludge for Netscape server time (0-24?) error */ if (rec_hour>23) rec_hour=0; /* minimal sanity check on date */ if ((i>=12)||(rec_min>59)||(rec_sec>60)||(rec_year<1990)) { total_bad++; /* if a bad date, bump counter */ if (verbose) { fprintf(stderr,"%s: %s [%llu]", msg_bad_date,log_rec.datetime,total_rec); if (debug_mode) fprintf(stderr,":\n%s\n",tmp_buf); else fprintf(stderr,"\n"); } continue; /* and ignore this record */ } /*********************************************/ /* GOOD RECORD, CHECK INCREMENTAL/TIMESTAMPS */ /*********************************************/ /* Flag as a good one */ good_rec = 1; /* get current records timestamp (seconds since epoch) */ req_tstamp=cur_tstamp; rec_tstamp=((jdate(rec_day,rec_month,rec_year)-epoch)*86400)+ (rec_hour*3600)+(rec_min*60)+rec_sec; /* Do we need to check for duplicate records? (incremental mode) */ if (check_dup) { /* check if less than/equal to last record processed */ if ( rec_tstamp <= cur_tstamp ) { /* if it is, assume we have already processed and ignore it */ total_ignore++; continue; } else { /* if it isn't.. disable any more checks this run */ check_dup=0; /* now check if it's a new month */ if ( (cur_month != rec_month) || (cur_year != rec_year) ) { clear_month(); cur_sec = rec_sec; /* set current counters */ cur_min = rec_min; cur_hour = rec_hour; cur_day = rec_day; cur_month = rec_month; cur_year = rec_year; cur_tstamp= rec_tstamp; f_day=l_day=rec_day; /* reset first and last day */ } } } /* check for out of sequence records */ if (rec_tstamp/3600 < cur_tstamp/3600) { if (!fold_seq_err && ((rec_tstamp+SLOP_VAL)/3600<cur_tstamp/3600) ) { total_ignore++; continue; } else { rec_sec = cur_sec; /* if folding sequence */ rec_min = cur_min; /* errors, just make it */ rec_hour = cur_hour; /* look like the last */ rec_day = cur_day; /* good records timestamp */ rec_month = cur_month; rec_year = cur_year; rec_tstamp= cur_tstamp; } } cur_tstamp=rec_tstamp; /* update current timestamp */ /*********************************************/ /* DO SOME PRE-PROCESS FORMATTING */ /*********************************************/ /* un-escape URL */ unescape(log_rec.url); /* fix URL field */ cp1 = cp2 = log_rec.url; /* handle null '-' case here... */ if (*++cp1 == '-') strcpy(log_rec.url,"/INVALID-URL"); else { /* strip actual URL out of request */ while ( (*cp1 != ' ') && (*cp1 != '\0') ) cp1++; if (*cp1 != '\0') { /* scan to begin of actual URL field */ while ((*cp1 == ' ') && (*cp1 != '\0')) cp1++; /* remove duplicate / if needed */ while (( *cp1=='/') && (*(cp1+1)=='/')) cp1++; while (( *cp1!='\0')&&(*cp1!='"')) *cp2++=*cp1++; *cp2='\0'; } } /* strip query portion of cgi scripts */ cp1 = log_rec.url; while (*cp1 != '\0') if (!isurlchar(*cp1, stripcgi)) { *cp1 = '\0'; break; } else cp1++; if (log_rec.url[0]=='\0') { log_rec.url[0]='/'; log_rec.url[1]='\0'; } /* Normalize URL */ if (log_type==LOG_CLF && log_rec.resp_code!=RC_NOTFOUND && normalize) { if ( ((cp2=strstr(log_rec.url,"://"))!=NULL)&&(cp2<log_rec.url+6) ) { cp1=cp2+3; /* see if a '/' is present after it */ if ( (cp2=strchr(cp1,(int)'/'))==NULL) cp1--; else cp1=cp2; /* Ok, now shift url string */ cp2=log_rec.url; while (*cp1!='\0') *cp2++=*cp1++; *cp2='\0'; } /* extra sanity checks on URL string */ while ((cp2=strstr(log_rec.url,"/./"))) { cp1=cp2+2; while (*cp1!='\0') *cp2++=*cp1++; *cp2='\0'; } if (log_rec.url[0]!='/') { if ( log_rec.resp_code==RC_OK || log_rec.resp_code==RC_PARTIALCONTENT || log_rec.resp_code==RC_NOMOD) { if (debug_mode) fprintf(stderr,"Converted URL '%s' to '/'\n",log_rec.url); log_rec.url[0]='/'; log_rec.url[1]='\0'; } else { if (debug_mode) fprintf(stderr,"Invalid URL: '%s'\n",log_rec.url); strcpy(log_rec.url,"/INVALID-URL"); } } while ( log_rec.url[ (i=strlen(log_rec.url)-1) ] == '?' ) log_rec.url[i]='\0'; /* drop trailing ?s if any */ } else { /* check for service (ie: http://) and lowercase if found */ if (((cp2=strstr(log_rec.url,"://"))!= NULL)&&(cp2<log_rec.url+6)) { cp1=log_rec.url; while (cp1!=cp2) { if ( (*cp1>='A') && (*cp1<='Z')) *cp1 += 'a'-'A'; cp1++; } } } /* strip off index.html (or any aliases) */ lptr=index_alias; while (lptr!=NULL) { if ((cp1=strstr(log_rec.url,lptr->string))!=NULL) { if (*(cp1-1)=='/') { if ( !stripcgi && (cp2=strchr(cp1,'?'))!=NULL ) { while(*cp2) *cp1++=*cp2++; *cp1='\0'; } else *cp1='\0'; break; } } lptr=lptr->next; } /* unescape referrer */ unescape(log_rec.refer); /* fix referrer field */ cp1 = log_rec.refer; cp3 = cp2 = cp1++; if ( (*cp2 != '\0') && (*cp2 == '"') ) { while ( *cp1 != '\0' ) { cp3=cp2; if (((unsigned char)*cp1<32&&(unsigned char)*cp1>0) || *cp1==127 || (unsigned char)*cp1=='<') *cp1=0; else *cp2++=*cp1++; } *cp3 = '\0'; } /* get query portion of cgi referrals */ cp1 = log_rec.refer; if (*cp1 != '\0') { while (*cp1 != '\0') { if (!isurlchar(*cp1, 1)) { /* Save query portion in log.rec.srchstr */ strncpy(log_rec.srchstr,(char *)cp1,MAXSRCH); *cp1++='\0'; break; } else cp1++; } /* handle null referrer */ if (log_rec.refer[0]=='\0') { log_rec.refer[0]='-'; log_rec.refer[1]='\0'; } } /* if HTTP request, lowercase http://sitename/ portion */ cp1 = log_rec.refer; if ( (*cp1=='h') || (*cp1=='H')) { while ( (*cp1!='/') && (*cp1!='\0')) { if ( (*cp1>='A') && (*cp1<='Z')) *cp1 += 'a'-'A'; cp1++; } /* now do hostname */ if ( (*cp1=='/') && ( *(cp1+1)=='/')) {cp1++; cp1++;} while ( (*cp1!='/') && (*cp1!='\0')) { if ( (*cp1>='A') && (*cp1<='Z')) *cp1 += 'a'-'A'; cp1++; } } /* Do we need to mangle? */ if (mangle_agent) agent_mangle(log_rec.agent); /* if necessary, shrink referrer to fit storage */ if (strlen(log_rec.refer)>=MAXREFH) { if (verbose) fprintf(stderr,"%s [%llu]\n", msg_big_ref,total_rec); log_rec.refer[MAXREFH-1]='\0'; } /* if necessary, shrink URL to fit storage */ if (strlen(log_rec.url)>=MAXURLH) { if (verbose) fprintf(stderr,"%s [%llu]\n", msg_big_req,total_rec); log_rec.url[MAXURLH-1]='\0'; } /* fix user agent field */ cp1 = log_rec.agent; cp3 = cp2 = cp1++; if ( (*cp2 != '\0') && ((*cp2 == '"')||(*cp2 == '(')) ) { while (*cp1 != '\0') { cp3 = cp2; *cp2++ = *cp1++; } *cp3 = '\0'; } cp1 = log_rec.agent; /* CHANGE !!! */ while (*cp1 != 0) /* get rid of more common _bad_ chars ;) */ { if ( ((unsigned char)*cp1 < 32) || ((unsigned char)*cp1==127) || (*cp1=='<') || (*cp1=='>') ) { *cp1='\0'; break; } else cp1++; } /* fix username if needed */ if (log_rec.ident[0]==0) { log_rec.ident[0]='-'; log_rec.ident[1]='\0'; } else { cp3=log_rec.ident; while ((unsigned char)*cp3>=32 && *cp3!='"') cp3++; *cp3='\0'; } /* unescape user name */ unescape(log_rec.ident); /********************************************/ /* PROCESS RECORD */ /********************************************/ /* first time through? */ if (cur_month == 0) { /* if yes, init our date vars */ cur_month=rec_month; cur_year=rec_year; cur_day=rec_day; cur_hour=rec_hour; cur_min=rec_min; cur_sec=rec_sec; f_day=rec_day; } /* adjust last day processed if different */ if (rec_day > l_day) l_day = rec_day; /* update min/sec stuff */ if (cur_sec != rec_sec) cur_sec = rec_sec; if (cur_min != rec_min) cur_min = rec_min; /* check for hour change */ if (cur_hour != rec_hour) { /* if yes, init hourly stuff */ if (ht_hit > mh_hit) mh_hit = ht_hit; ht_hit = 0; cur_hour = rec_hour; } /* check for day change */ if (cur_day != rec_day) { /* if yes, init daily stuff */ tm_site[cur_day-1]=dt_site; dt_site=0; tm_visit[cur_day-1]=tot_visit(sd_htab); del_hlist(sd_htab); cur_day = rec_day; } /* check for month change */ if ( (cur_month != rec_month) || (cur_year != rec_year) ) { /* if yes, do monthly stuff */ t_visit=tot_visit(sm_htab); month_update_exit(req_tstamp); /* process exit pages */ update_history(); write_month_html(); /* generate HTML for month */ clear_month(); cur_month = rec_month; /* update our flags */ cur_year = rec_year; f_day=l_day=rec_day; } /* save hostname for later */ strncpy(host_buf, log_rec.hostname, sizeof(log_rec.hostname)); #ifdef USE_DNS /* Resolve IP address if needed */ if (dns_db) { struct addrinfo hints, *ares; memset(&hints, 0, sizeof(hints)); hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_STREAM; hints.ai_flags = AI_NUMERICHOST; if (0 == getaddrinfo(log_rec.hostname, "0", &hints, &ares)) { freeaddrinfo(ares); resolve_dns(&log_rec); } } #endif /* lowercase hostname and validity check */ cp1 = log_rec.hostname; i=0; if ( (!isalnum((unsigned char)*cp1)) && (*cp1!=':') ) strncpy(log_rec.hostname, "Invalid", 8); else { while (*cp1 != '\0') /* loop through string */ { if ( (*cp1>='A') && (*cp1<='Z') ) { *cp1++ += 'a'-'A'; continue; } if ( *cp1=='.' ) i++; if ( (isalnum((unsigned char)*cp1)) || (*cp1=='.')||(*cp1=='-') || (*cp1==':')||((*cp1=='_')&&(i==0)) ) cp1++; else { /* Invalid hostname found! */ if (strcmp(log_rec.hostname, host_buf)) strcpy(log_rec.hostname, host_buf); else strncpy(log_rec.hostname,"Invalid",8); break; } } if (*cp1 == '\0') /* did we make it to the end? */ { if (!isalnum((unsigned char)*(cp1-1))) strncpy(log_rec.hostname,"Invalid",8); } } /* Catch blank hostnames here */ if (log_rec.hostname[0]=='\0') strncpy(log_rec.hostname,"Unknown",8); /* Ignore/Include check */ if ( (isinlist(include_sites,log_rec.hostname)==NULL) && (isinlist(include_urls,log_rec.url)==NULL) && (isinlist(include_refs,log_rec.refer)==NULL) && (isinlist(include_agents,log_rec.agent)==NULL) && (isinlist(include_users,log_rec.ident)==NULL) ) { if (isinlist(ignored_sites,log_rec.hostname)!=NULL) { total_ignore++; continue; } if (isinlist(ignored_urls,log_rec.url)!=NULL) { total_ignore++; continue; } if (isinlist(ignored_agents,log_rec.agent)!=NULL) { total_ignore++; continue; } if (isinlist(ignored_refs,log_rec.refer)!=NULL) { total_ignore++; continue; } if (isinlist(ignored_users,log_rec.ident)!=NULL) { total_ignore++; continue; } } /* Bump response code totals */ switch (log_rec.resp_code) { case RC_CONTINUE: i=IDX_CONTINUE; break; case RC_SWITCHPROTO: i=IDX_SWITCHPROTO; break; case RC_OK: i=IDX_OK; break; case RC_CREATED: i=IDX_CREATED; break; case RC_ACCEPTED: i=IDX_ACCEPTED; break; case RC_NONAUTHINFO: i=IDX_NONAUTHINFO; break; case RC_NOCONTENT: i=IDX_NOCONTENT; break; case RC_RESETCONTENT: i=IDX_RESETCONTENT; break; case RC_PARTIALCONTENT: i=IDX_PARTIALCONTENT; break; case RC_MULTIPLECHOICES: i=IDX_MULTIPLECHOICES; break; case RC_MOVEDPERM: i=IDX_MOVEDPERM; break; case RC_MOVEDTEMP: i=IDX_MOVEDTEMP; break; case RC_SEEOTHER: i=IDX_SEEOTHER; break; case RC_NOMOD: i=IDX_NOMOD; break; case RC_USEPROXY: i=IDX_USEPROXY; break; case RC_MOVEDTEMPORARILY: i=IDX_MOVEDTEMPORARILY; break; case RC_BAD: i=IDX_BAD; break; case RC_UNAUTH: i=IDX_UNAUTH; break; case RC_PAYMENTREQ: i=IDX_PAYMENTREQ; break; case RC_FORBIDDEN: i=IDX_FORBIDDEN; break; case RC_NOTFOUND: i=IDX_NOTFOUND; break; case RC_METHODNOTALLOWED: i=IDX_METHODNOTALLOWED; break; case RC_NOTACCEPTABLE: i=IDX_NOTACCEPTABLE; break; case RC_PROXYAUTHREQ: i=IDX_PROXYAUTHREQ; break; case RC_TIMEOUT: i=IDX_TIMEOUT; break; case RC_CONFLICT: i=IDX_CONFLICT; break; case RC_GONE: i=IDX_GONE; break; case RC_LENGTHREQ: i=IDX_LENGTHREQ; break; case RC_PREFAILED: i=IDX_PREFAILED; break; case RC_REQENTTOOLARGE: i=IDX_REQENTTOOLARGE; break; case RC_REQURITOOLARGE: i=IDX_REQURITOOLARGE; break; case RC_UNSUPMEDIATYPE: i=IDX_UNSUPMEDIATYPE; break; case RC_RNGNOTSATISFIABLE:i=IDX_RNGNOTSATISFIABLE;break; case RC_EXPECTATIONFAILED:i=IDX_EXPECTATIONFAILED;break; case RC_SERVERERR: i=IDX_SERVERERR; break; case RC_NOTIMPLEMENTED: i=IDX_NOTIMPLEMENTED; break; case RC_BADGATEWAY: i=IDX_BADGATEWAY; break; case RC_UNAVAIL: i=IDX_UNAVAIL; break; case RC_GATEWAYTIMEOUT: i=IDX_GATEWAYTIMEOUT; break; case RC_BADHTTPVER: i=IDX_BADHTTPVER; break; default: i=IDX_UNDEFINED; break; } response[i].count++; /* now save in the various hash tables... */ if (log_rec.resp_code==RC_OK || log_rec.resp_code==RC_PARTIALCONTENT) i=1; else i=0; /* URL/ident hash table (only if valid response code) */ if ((log_rec.resp_code==RC_OK)||(log_rec.resp_code==RC_NOMOD)|| (log_rec.resp_code==RC_PARTIALCONTENT)) { /* URL hash table */ if (put_unode(log_rec.url,OBJ_REG,(u_int64_t)1, log_rec.xfer_size,&t_url,(u_int64_t)0,(u_int64_t)0,um_htab)) { if (verbose) /* Error adding URL node, skipping ... */ fprintf(stderr,"%s %s\n", msg_nomem_u, log_rec.url); } /* ident (username) hash table */ if (put_inode(log_rec.ident,OBJ_REG, 1,(u_int64_t)i,log_rec.xfer_size,&t_user, 0,rec_tstamp,im_htab)) { if (verbose) /* Error adding ident node, skipping .... */ fprintf(stderr,"%s %s\n", msg_nomem_i, log_rec.ident); } } /* referrer hash table */ if (ntop_refs) { if (log_rec.refer[0]!='\0') if (put_rnode(log_rec.refer,OBJ_REG,(u_int64_t)1,&t_ref,rm_htab)) { if (verbose) fprintf(stderr,"%s %s\n", msg_nomem_r, log_rec.refer); } } /* hostname (site) hash table - daily */ if (put_hnode(log_rec.hostname,OBJ_REG, 1,(u_int64_t)i,log_rec.xfer_size,&dt_site, 0,rec_tstamp,"",sd_htab)) { if (verbose) /* Error adding host node (daily), skipping .... */ fprintf(stderr,"%s %s\n",msg_nomem_dh, log_rec.hostname); } /* hostname (site) hash table - monthly */ if (put_hnode(log_rec.hostname,OBJ_REG, 1,(u_int64_t)i,log_rec.xfer_size,&t_site, 0,rec_tstamp,"",sm_htab)) { if (verbose) /* Error adding host node (monthly), skipping .... */ fprintf(stderr,"%s %s\n", msg_nomem_mh, log_rec.hostname); } /* user agent hash table */ if (ntop_agents) { if (log_rec.agent[0]!='\0') if (put_anode(log_rec.agent,OBJ_REG,(u_int64_t)1,&t_agent,am_htab)) { if (verbose) fprintf(stderr,"%s %s\n", msg_nomem_a, log_rec.agent); } } /* bump monthly/daily/hourly totals */ t_hit++; ht_hit++; /* daily/hourly hits */ t_xfer += log_rec.xfer_size; /* total xfer size */ tm_xfer[rec_day-1] += log_rec.xfer_size; /* daily xfer total */ tm_hit[rec_day-1]++; /* daily hits total */ th_xfer[rec_hour] += log_rec.xfer_size; /* hourly xfer total */ th_hit[rec_hour]++; /* hourly hits total */ /* if RC_OK, increase file counters */ if (log_rec.resp_code == RC_OK) { t_file++; tm_file[rec_day-1]++; th_file[rec_hour]++; } /* Pages (pageview) calculation */ if (ispage(log_rec.url)) { t_page++; tm_page[rec_day-1]++; th_page[rec_hour]++; /* do search string stuff if needed */ if (ntop_search) srch_string(log_rec.srchstr); } /*********************************************/ /* RECORD PROCESSED - DO GROUPS HERE */ /*********************************************/ /* URL Grouping */ if ( (cp1=isinglist(group_urls,log_rec.url))!=NULL) { if (put_unode(cp1,OBJ_GRP,(u_int64_t)1,log_rec.xfer_size, &ul_bogus,(u_int64_t)0,(u_int64_t)0,um_htab)) { if (verbose) /* Error adding URL node, skipping ... */ fprintf(stderr,"%s %s\n", msg_nomem_u, cp1); } } /* Site Grouping */ if ( (cp1=isinglist(group_sites,log_rec.hostname))!=NULL) { if (put_hnode(cp1,OBJ_GRP,1, (u_int64_t)(log_rec.resp_code==RC_OK)?1:0, log_rec.xfer_size,&ul_bogus, 0,rec_tstamp,"",sm_htab)) { if (verbose) /* Error adding Site node, skipping ... */ fprintf(stderr,"%s %s\n", msg_nomem_mh, cp1); } } else { /* Domain Grouping */ if (group_domains) { cp1 = get_domain(log_rec.hostname); if (cp1 != NULL) { if (put_hnode(cp1,OBJ_GRP,1, (u_int64_t)(log_rec.resp_code==RC_OK)?1:0, log_rec.xfer_size,&ul_bogus, 0,rec_tstamp,"",sm_htab)) { if (verbose) /* Error adding Site node, skipping ... */ fprintf(stderr,"%s %s\n", msg_nomem_mh, cp1); } } } } /* Referrer Grouping */ if ( (cp1=isinglist(group_refs,log_rec.refer))!=NULL) { if (put_rnode(cp1,OBJ_GRP,(u_int64_t)1,&ul_bogus,rm_htab)) { if (verbose) /* Error adding Referrer node, skipping ... */ fprintf(stderr,"%s %s\n", msg_nomem_r, cp1); } } /* User Agent Grouping */ if ( (cp1=isinglist(group_agents,log_rec.agent))!=NULL) { if (put_anode(cp1,OBJ_GRP,(u_int64_t)1,&ul_bogus,am_htab)) { if (verbose) /* Error adding User Agent node, skipping ... */ fprintf(stderr,"%s %s\n", msg_nomem_a, cp1); } } /* Ident (username) Grouping */ if ( (cp1=isinglist(group_users,log_rec.ident))!=NULL) { if (put_inode(cp1,OBJ_GRP,1, (u_int64_t)(log_rec.resp_code==RC_OK)?1:0, log_rec.xfer_size,&ul_bogus, 0,rec_tstamp,im_htab)) { if (verbose) /* Error adding Username node, skipping ... */ fprintf(stderr,"%s %s\n", msg_nomem_i, cp1); } } } /*********************************************/ /* BAD RECORD */ /*********************************************/ else { /* If first record, check if stupid Netscape header stuff */ if ( (total_rec==1) && (strncmp(buffer,"format=",7)==0) ) { /* Skipping Netscape header record */ if (verbose>1) printf("%s\n",msg_ign_nscp); /* count it as ignored... */ total_ignore++; } else { /* Check if it's a W3C header or IIS Null-Character line */ if ((buffer[0]=='\0') || (buffer[0]=='#')) { total_ignore++; } else { /* really bad record... */ total_bad++; if (verbose) { fprintf(stderr,"%s (%llu)",msg_bad_rec,total_rec); if (debug_mode) fprintf(stderr,":\n%s\n",tmp_buf); else fprintf(stderr,"\n"); } } } } } /*********************************************/ /* DONE READING LOG FILE - final processing */ /*********************************************/ /* close log file if needed */ #ifdef USE_BZIP if (gz_log) (gz_log==COMP_BZIP)?BZ2_bzclose(zlog_fp):gzclose(zlog_fp); #else if (gz_log) gzclose(zlog_fp); #endif else if (log_fname) fclose(log_fp); if (good_rec) /* were any good records? */ { tm_site[cur_day-1]=dt_site; /* If yes, clean up a bit */ tm_visit[cur_day-1]=tot_visit(sd_htab); t_visit=tot_visit(sm_htab); if (ht_hit > mh_hit) mh_hit = ht_hit; if (total_rec > (total_ignore+total_bad)) /* did we process any? */ { if (incremental) { if (save_state()) /* incremental stuff */ { /* Error: Unable to save current run data */ if (verbose) fprintf(stderr,"%s\n",msg_data_err); unlink(state_fname); } } month_update_exit(rec_tstamp); /* calculate exit pages */ update_history(); write_month_html(); /* write monthly HTML file */ put_history(); /* write history */ } if (hist[0].month!=0) write_main_index(); /* write main HTML file */ /* get processing end time */ end_time = time(NULL); /* display end of processing statistics */ if (time_me || (verbose>1)) { printf("%llu %s ",total_rec, msg_records); if (total_ignore) { printf("(%llu %s",total_ignore,msg_ignored); if (total_bad) printf(", %llu %s) ",total_bad,msg_bad); else printf(") "); } else if (total_bad) printf("(%llu %s) ",total_bad,msg_bad); /* totoal processing time in seconds */ temp_time = difftime(end_time, start_time); if (temp_time==0) temp_time=1; printf("%s %.0f %s", msg_in, temp_time, msg_seconds); /* calculate records per second */ if (temp_time) i=( (int)( (float)total_rec/temp_time ) ); else i=0; if ( (i>0) && (i<=total_rec) ) printf(", %d/sec\n", i); else printf("\n"); } #ifdef USE_DNS /* Close DNS cache file */ if (dns_db) close_cache(); /* Close GeoDB database */ if (geo_db) geodb_close(geo_db); #endif #ifdef USE_GEOIP /* Close GeoIP database */ if (geo_fp) GeoIP_delete(geo_fp); #endif /* Whew, all done! Exit with completion status (0) */ exit(0); } else { /* No valid records found... exit with error (1) */ if (verbose) printf("%s\n",msg_no_vrec); if (hist[0].month!=0) write_main_index(); /* write main HTML file */ exit(1); } } /*********************************************/ /* GET_CONFIG - get configuration file info */ /*********************************************/ void get_config(char *fname) { char *kwords[]= { "Undefined", /* 0 = undefined keyword 0 */ "OutputDir", /* Output directory 1 */ "LogFile", /* Log file to use for input 2 */ "ReportTitle", /* Title for reports 3 */ "HostName", /* Hostname to use 4 */ "IgnoreHist", /* Ignore history file 5 */ "Quiet", /* Run in quiet mode 6 */ "TimeMe", /* Produce timing results 7 */ "Debug", /* Produce debug information 8 */ "HourlyGraph", /* Hourly stats graph 9 */ "HourlyStats", /* Hourly stats table 10 */ "TopSites", /* Top sites 11 */ "TopURLs", /* Top URLs 12 */ "TopReferrers", /* Top Referrers 13 */ "TopAgents", /* Top User Agents 14 */ "TopCountries", /* Top Countries 15 */ "HideSite", /* Sites to hide 16 */ "HideURL", /* URLs to hide 17 */ "HideReferrer", /* Referrers to hide 18 */ "HideAgent", /* User Agents to hide 19 */ "IndexAlias", /* Aliases for index.html 20 */ "HTMLHead", /* HTML Top1 code 21 */ "HTMLPost", /* HTML Top2 code 22 */ "HTMLTail", /* HTML Tail code 23 */ "MangleAgents", /* Mangle User Agents 24 */ "IgnoreSite", /* Sites to ignore 25 */ "IgnoreURL", /* Url's to ignore 26 */ "IgnoreReferrer", /* Referrers to ignore 27 */ "IgnoreAgent", /* User Agents to ignore 28 */ "ReallyQuiet", /* Dont display ANY messages 29 */ "GMTTime", /* Local or UTC time? 30 */ "GroupURL", /* Group URLs 31 */ "GroupSite", /* Group Sites 32 */ "GroupReferrer", /* Group Referrers 33 */ "GroupAgent", /* Group Agents 34 */ "GroupShading", /* Shade Grouped entries 35 */ "GroupHighlight", /* BOLD Grouped entries 36 */ "Incremental", /* Incremental runs 37 */ "IncrementalName", /* Filename for state data 38 */ "HistoryName", /* Filename for history data 39 */ "HTMLExtension", /* HTML filename extension 40 */ "HTMLPre", /* HTML code at beginning 41 */ "HTMLBody", /* HTML body code 42 */ "HTMLEnd", /* HTML code at end 43 */ "UseHTTPS", /* Use https:// on URLs 44 */ "IncludeSite", /* Sites to always include 45 */ "IncludeURL", /* URLs to always include 46 */ "IncludeReferrer", /* Referrers to include 47 */ "IncludeAgent", /* User Agents to include 48 */ "PageType", /* Page Type (pageview) 49 */ "VisitTimeout", /* Visit timeout (seconds) 50 */ "GraphLegend", /* Graph Legends (yes/no) 51 */ "GraphLines", /* Graph Lines (0=none) 52 */ "FoldSeqErr", /* Fold sequence errors 53 */ "CountryGraph", /* Display ctry graph (0=no) 54 */ "TopKSites", /* Top sites (by KBytes) 55 */ "TopKURLs", /* Top URLs (by KBytes) 56 */ "TopEntry", /* Top Entry Pages 57 */ "TopExit", /* Top Exit Pages 58 */ "TopSearch", /* Top Search Strings 59 */ "LogType", /* Log Type (clf/ftp/squid) 60 */ "SearchEngine", /* SearchEngine strings 61 */ "GroupDomains", /* Group domains (n=level) 62 */ "HideAllSites", /* Hide ind. sites (0=no) 63 */ "AllSites", /* List all sites? 64 */ "AllURLs", /* List all URLs? 65 */ "AllReferrers", /* List all Referrers? 66 */ "AllAgents", /* List all User Agents? 67 */ "AllSearchStr", /* List all Search Strings? 68 */ "AllUsers", /* List all Users? 69 */ "TopUsers", /* Top Usernames to show 70 */ "HideUser", /* Usernames to hide 71 */ "IgnoreUser", /* Usernames to ignore 72 */ "IncludeUser", /* Usernames to include 73 */ "GroupUser", /* Usernames to group 74 */ "DumpPath", /* Path for dump files 75 */ "DumpExtension", /* Dump filename extension 76 */ "DumpHeader", /* Dump header as first rec? 77 */ "DumpSites", /* Dump sites tab file 78 */ "DumpURLs", /* Dump urls tab file 79 */ "DumpReferrers", /* Dump referrers tab file 80 */ "DumpAgents", /* Dump user agents tab file 81 */ "DumpUsers", /* Dump usernames tab file 82 */ "DumpSearchStr", /* Dump search str tab file 83 */ "DNSCache", /* DNS Cache file name 84 */ "DNSChildren", /* DNS Children (0=no DNS) 85 */ "DailyGraph", /* Daily Graph (0=no) 86 */ "DailyStats", /* Daily Stats (0=no) 87 */ "LinkReferrer", /* Link referrer (0=no) 88 */ "PagePrefix", /* PagePrefix - treat as page 89 */ "ColorHit", /* Hit Color (def=00805c) 90 */ "ColorFile", /* File Color (def=0040ff) 91 */ "ColorSite", /* Site Color (def=ff8000) 92 */ "ColorKbyte", /* Kbyte Color (def=ff0000) 93 */ "ColorPage", /* Page Color (def=00e0ff) 94 */ "ColorVisit", /* Visit Color (def=ffff00) 95 */ "ColorMisc", /* Misc Color (def=00e0ff) 96 */ "PieColor1", /* Pie Color 1 (def=800080) 97 */ "PieColor2", /* Pie Color 2 (def=80ffc0) 98 */ "PieColor3", /* Pie Color 3 (def=ff00ff) 99 */ "PieColor4", /* Pie Color 4 (def=ffc080) 100 */ "CacheIPs", /* Cache IPs in DNS DB (0=no) 101 */ "CacheTTL", /* DNS Cache entry TTL (days) 102 */ "GeoDB", /* GeoDB lookups (0=no) 103 */ "GeoDBDatabase", /* GeoDB database filename 104 */ "StripCGI", /* Strip CGI in URLS (0=no) 105 */ "TrimSquidURL", /* Trim squid URLs (0=none) 106 */ "OmitPage", /* URLs not counted as pages 107 */ "HTAccess", /* Write .httaccess files? 108 */ "IgnoreState", /* Ignore state file (0=no) 109 */ "DefaultIndex", /* Default index.* (1=yes) 110 */ "GeoIP", /* Use GeoIP? (1=yes) 111 */ "GeoIPDatabase", /* Database to use for GeoIP 112 */ "NormalizeURL", /* Normalize CLF URLs (1=yes) 113 */ "IndexMonths", /* # months for main page 114 */ "GraphMonths", /* # months for yearly graph 115 */ "YearHeaders", /* use year headers? (1=yes) 116 */ "YearTotals", /* show year subtotals (0=no) 117 */ "CountryFlags", /* show country flags? (0-no) 118 */ "FlagDir", /* directory w/flag images 119 */ "SearchCaseI" /* srch str case insensitive 120 */ }; FILE *fp; char buffer[BUFSIZE]; char keyword[MAXKWORD]; char value[MAXKVAL]; char *cp1, *cp2; int i,key,count; int num_kwords=sizeof(kwords)/sizeof(char *); if ( (fp=fopen(fname,"r")) == NULL) { if (verbose) fprintf(stderr,"%s %s\n",msg_bad_conf,fname); return; } while ( (fgets(buffer,BUFSIZE,fp)) != NULL) { /* skip comments and blank lines */ if ( (buffer[0]=='#') || isspace((unsigned char)buffer[0]) ) continue; /* Get keyword */ cp1=buffer;cp2=keyword;count=MAXKWORD-1; while ( (isalnum((unsigned char)*cp1)) && count ) { *cp2++ = *cp1++; count--; } *cp2='\0'; /* Get value */ cp2=value; count=MAXKVAL-1; while ((*cp1!='\n')&&(*cp1!='\0')&&(isspace((unsigned char)*cp1))) cp1++; while ((*cp1!='\n')&&(*cp1!='\0')&&count ) { *cp2++ = *cp1++; count--; } *cp2--='\0'; while ((isspace((unsigned char)*cp2)) && (cp2 != value) ) *cp2--='\0'; /* check if blank keyword/value */ if ( (keyword[0]=='\0') || (value[0]=='\0') ) continue; key=0; for (i=0;i<num_kwords;i++) if (!ouricmp(keyword,kwords[i])) { key=i; break; } if (key==0) { printf("%s '%s' (%s)\n", /* Invalid keyword */ msg_bad_key,keyword,fname); continue; } switch (key) { case 1: out_dir=save_opt(value); break; /* OutputDir */ case 2: log_fname=save_opt(value); break; /* LogFile */ case 3: msg_title=save_opt(value); break; /* ReportTitle */ case 4: hname=save_opt(value); break; /* HostName */ case 5: ignore_hist= (tolower(value[0])=='y')?1:0; break; /* IgnoreHist */ case 6: verbose= (tolower(value[0])=='y')?1:2; break; /* Quiet */ case 7: time_me= (tolower(value[0])=='n')?0:1; break; /* TimeMe */ case 8: debug_mode= (tolower(value[0])=='y')?1:0; break; /* Debug */ case 9: hourly_graph= (tolower(value[0])=='n')?0:1; break; /* HourlyGraph */ case 10: hourly_stats= (tolower(value[0])=='n')?0:1; break; /* HourlyStats */ case 11: ntop_sites = atoi(value); break; /* TopSites */ case 12: ntop_urls = atoi(value); break; /* TopURLs */ case 13: ntop_refs = atoi(value); break; /* TopRefs */ case 14: ntop_agents = atoi(value); break; /* TopAgents */ case 15: ntop_ctrys = atoi(value); break; /* TopCountries */ case 16: add_nlist(value,&hidden_sites); break; /* HideSite */ case 17: add_nlist(value,&hidden_urls); break; /* HideURL */ case 18: add_nlist(value,&hidden_refs); break; /* HideReferrer */ case 19: add_nlist(value,&hidden_agents); break; /* HideAgent */ case 20: add_nlist(value,&index_alias); break; /* IndexAlias */ case 21: add_nlist(value,&html_head); break; /* HTMLHead */ case 22: add_nlist(value,&html_post); break; /* HTMLPost */ case 23: add_nlist(value,&html_tail); break; /* HTMLTail */ case 24: mangle_agent=atoi(value); break; /* MangleAgents */ case 25: add_nlist(value,&ignored_sites); break; /* IgnoreSite */ case 26: add_nlist(value,&ignored_urls); break; /* IgnoreURL */ case 27: add_nlist(value,&ignored_refs); break; /* IgnoreReferrer */ case 28: add_nlist(value,&ignored_agents); break; /* IgnoreAgent */ case 29: if (tolower(value[0])=='y') verbose=0; break; /* ReallyQuiet */ case 30: local_time= (tolower(value[0])=='y')?0:1; break; /* GMTTime */ case 31: add_glist(value,&group_urls); break; /* GroupURL */ case 32: add_glist(value,&group_sites); break; /* GroupSite */ case 33: add_glist(value,&group_refs); break; /* GroupReferrer */ case 34: add_glist(value,&group_agents); break; /* GroupAgent */ case 35: shade_groups= (tolower(value[0])=='n')?0:1; break; /* GroupShading */ case 36: hlite_groups= (tolower(value[0])=='n')?0:1; break; /* GroupHighlight */ case 37: incremental= (tolower(value[0])=='y')?1:0; break; /* Incremental */ case 38: state_fname=save_opt(value); break; /* State FName */ case 39: hist_fname=save_opt(value); break; /* History FName */ case 40: html_ext=save_opt(value); break; /* HTML extension */ case 41: add_nlist(value,&html_pre); break; /* HTML Pre code */ case 42: add_nlist(value,&html_body); break; /* HTML Body code */ case 43: add_nlist(value,&html_end); break; /* HTML End code */ case 44: use_https= (tolower(value[0])=='y')?1:0; break; /* Use https:// */ case 45: add_nlist(value,&include_sites); break; /* IncludeSite */ case 46: add_nlist(value,&include_urls); break; /* IncludeURL */ case 47: add_nlist(value,&include_refs); break; /* IncludeReferrer*/ case 48: add_nlist(value,&include_agents); break; /* IncludeAgent */ case 49: add_nlist(value,&page_type); break; /* PageType */ case 50: visit_timeout=atoi(value); break; /* VisitTimeout */ case 51: graph_legend= (tolower(value[0])=='n')?0:1; break; /* GraphLegend */ case 52: graph_lines = atoi(value); break; /* GraphLines */ case 53: fold_seq_err= (tolower(value[0])=='y')?1:0; break; /* FoldSeqErr */ case 54: ctry_graph= (tolower(value[0])=='n')?0:1; break; /* CountryGraph */ case 55: ntop_sitesK = atoi(value); break; /* TopKSites (KB) */ case 56: ntop_urlsK = atoi(value); break; /* TopKUrls (KB) */ case 57: ntop_entry = atoi(value); break; /* Top Entry pgs */ case 58: ntop_exit = atoi(value); break; /* Top Exit pages */ case 59: ntop_search = atoi(value); break; /* Top Search pgs */ case 60: log_type=(tolower(value[0])=='f')? LOG_FTP:((tolower(value[0])=='s')? LOG_SQUID:((tolower(value[0])=='w')? LOG_W3C:LOG_CLF)); break; /* LogType */ case 61: add_glist(value,&search_list); break; /* SearchEngine */ case 62: group_domains=atoi(value); break; /* GroupDomains */ case 63: hide_sites= (tolower(value[0])=='y')?1:0; break; /* HideAllSites */ case 64: all_sites= (tolower(value[0])=='y')?1:0; break; /* All Sites? */ case 65: all_urls= (tolower(value[0])=='y')?1:0; break; /* All URLs? */ case 66: all_refs= (tolower(value[0])=='y')?1:0; break; /* All Refs */ case 67: all_agents= (tolower(value[0])=='y')?1:0; break; /* All Agents? */ case 68: all_search= (tolower(value[0])=='y')?1:0; break; /* All Srch str */ case 69: all_users= (tolower(value[0])=='y')?1:0; break; /* All Users? */ case 70: ntop_users=atoi(value); break; /* TopUsers */ case 71: add_nlist(value,&hidden_users); break; /* HideUser */ case 72: add_nlist(value,&ignored_users); break; /* IgnoreUser */ case 73: add_nlist(value,&include_users); break; /* IncludeUser */ case 74: add_glist(value,&group_users); break; /* GroupUser */ case 75: dump_path=save_opt(value); break; /* DumpPath */ case 76: dump_ext=save_opt(value); break; /* Dumpfile ext */ case 77: dump_header= (tolower(value[0])=='y')?1:0; break; /* DumpHeader? */ case 78: dump_sites= (tolower(value[0])=='y')?1:0; break; /* DumpSites? */ case 79: dump_urls= (tolower(value[0])=='y')?1:0; break; /* DumpURLs? */ case 80: dump_refs= (tolower(value[0])=='y')?1:0; break; /* DumpReferrers? */ case 81: dump_agents= (tolower(value[0])=='y')?1:0; break; /* DumpAgents? */ case 82: dump_users= (tolower(value[0])=='y')?1:0; break; /* DumpUsers? */ case 83: dump_search= (tolower(value[0])=='y')?1:0; break; /* DumpSrchStrs? */ #ifdef USE_DNS case 84: dns_cache=save_opt(value); break; /* DNSCache fname */ case 85: dns_children=atoi(value); break; /* DNSChildren */ #else case 84: /* Disable DNSCache and DNSChildren if DNS is not enabled */ case 85: printf("%s '%s' (%s)\n",msg_bad_key,keyword,fname); break; #endif /* USE_DNS */ case 86: daily_graph= (tolower(value[0])=='n')?0:1; break; /* HourlyGraph */ case 87: daily_stats= (tolower(value[0])=='n')?0:1; break; /* HourlyStats */ case 88: link_referrer= (tolower(value[0])=='y')?1:0; break; /* LinkReferrer */ case 89: add_nlist(value,&page_prefix); break; /* PagePrefix */ case 90: strncpy(hit_color+1, value, 6); break; /* ColorHit */ case 91: strncpy(file_color+1, value, 6); break; /* ColorFile */ case 92: strncpy(site_color+1, value, 6); break; /* ColorSite */ case 93: strncpy(kbyte_color+1,value, 6); break; /* ColorKbyte */ case 94: strncpy(page_color+1, value, 6); break; /* ColorPage */ case 95: strncpy(visit_color+1,value, 6); break; /* ColorVisit */ case 96: strncpy(misc_color+1, value, 6); break; /* ColorMisc */ case 97: strncpy(pie_color1+1, value, 6); break; /* PieColor1 */ case 98: strncpy(pie_color2+1, value, 6); break; /* PieColor2 */ case 99: strncpy(pie_color3+1, value, 6); break; /* PieColor3 */ case 100:strncpy(pie_color4+1, value, 6); break; /* PieColor4 */ #ifdef USE_DNS case 101: cache_ips= (tolower(value[0])=='y')?1:0; break; /* CacheIPs */ case 102: cache_ttl=atoi(value); break; /* CacheTTL days */ case 103: geodb= (tolower(value[0])=='y')?1:0; break; /* GeoDB */ case 104: geodb_fname=save_opt(value); break; /* GeoDBDatabase */ #else case 101: /* Disable CacheIPs/CacheTTL/GeoDB/GeoDBDatabase if none */ case 102: case 103: case 104: printf("%s '%s' (%s)\n",msg_bad_key,keyword,fname); break; #endif /* USE_DNS */ case 105: stripcgi= (tolower(value[0])=='n')?0:1; break; /* StripCGI */ case 106: trimsquid=atoi(value); break; /* TrimSquidURL */ case 107: add_nlist(value,&omit_page); break; /* OmitPage */ case 108: htaccess= (tolower(value[0])=='y')?1:0; break; /* HTAccess */ case 109: ignore_state= (tolower(value[0])=='y')?1:0; break; /* IgnoreState */ case 110: default_index= (tolower(value[0])=='n')?0:1; break; /* DefaultIndex */ #ifdef USE_GEOIP case 111: geoip= (tolower(value[0])=='y')?1:0; break; /* GeoIP */ case 112: geoip_db=save_opt(value); break; /* GeoIPDatabase */ #else case 111: /* Disable GeoIP and GeoIPDatabase if not enabled */ case 112: printf("%s '%s' (%s)\n",msg_bad_key,keyword,fname); break; #endif case 113: normalize= (tolower(value[0])=='n')?0:1; break; /* NormalizeURL */ case 114: index_mths=atoi(value); break; /* IndexMonths */ case 115: graph_mths=atoi(value); break; /* GraphMonths */ case 116: year_hdrs= (tolower(value[0])=='n')?0:1; break; /* YearHeaders */ case 117: year_totals= (tolower(value[0])=='n')?0:1; break; /* YearTotals */ case 118: use_flags= (tolower(value[0])=='y')?1:0; break; /* CountryFlags */ case 119: use_flags=1; flag_dir=save_opt(value); break; /* FlagDir */ case 120: searchcasei= (tolower(value[0])=='n')?0:1; break; /* SearchCaseI */ } } fclose(fp); } /*********************************************/ /* SAVE_OPT - save option from config file */ /*********************************************/ static char *save_opt(char *str) { char *cp1; if ( (cp1=malloc(strlen(str)+1))==NULL) return NULL; strcpy(cp1,str); return cp1; } /*********************************************/ /* CLEAR_MONTH - initalize monthly stuff */ /*********************************************/ void clear_month() { int i; init_counters(); /* reset monthly counters */ del_htabs(); /* clear hash tables */ if (ntop_ctrys!=0 ) for (i=0;i<ntop_ctrys;i++) top_ctrys[i]=NULL; } /*********************************************/ /* INIT_COUNTERS - prep counters for use */ /*********************************************/ void init_counters() { int i; for (i=0;i<TOTAL_RC;i++) response[i].count = 0; for (i=0;i<31;i++) /* monthly totals */ { tm_xfer[i]=0.0; tm_hit[i]=tm_file[i]=tm_site[i]=tm_page[i]=tm_visit[i]=0; } for (i=0;i<24;i++) /* hourly totals */ { th_hit[i]=th_file[i]=th_page[i]=0; th_xfer[i]=0.0; } for (i=0;ctry[i].desc;i++) /* country totals */ { ctry[i].count=0; ctry[i].files=0; ctry[i].xfer=0; } t_hit=t_file=t_site=t_url=t_ref=t_agent=t_page=t_visit=t_user=0; t_xfer=0.0; mh_hit = dt_site = 0; f_day=l_day=1; } /*********************************************/ /* PRINT_OPTS - print command line options */ /*********************************************/ void print_opts(char *pname) { int i; printf("%s: %s %s\n",h_usage1,pname,h_usage2); for (i=0;h_msg[i];i++) printf("%s\n",h_msg[i]); exit(1); } /*********************************************/ /* PRINT_VERSION */ /*********************************************/ void print_version() { char buf[128]=""; uname(&system_info); printf("Webalizer V%s-%s (%s %s %s) %s\n%s\n", version,editlvl, system_info.sysname,system_info.release,system_info.machine, language,copyright); #ifdef USE_DNS strncpy(&buf[strlen(buf)],"DNS/GeoDB ",11); #endif #ifdef USE_BZIP strncpy(&buf[strlen(buf)],"BZip2 ",7); #endif #ifdef USE_GEOIP strncpy(&buf[strlen(buf)],"GeoIP ",7); #endif if (debug_mode) { printf("Mod date: %s Options: ",moddate); if (buf[0]!=0) printf("%s",buf); else printf("none"); printf("\n"); #if USE_DNS printf("Default GeoDB dir : %s\n",GEODB_LOC); #endif printf("Default config dir: %s\n",ETCDIR); printf("\n"); } else printf("\n"); exit(1); } /*********************************************/ /* CUR_TIME - return date/time as a string */ /*********************************************/ char *cur_time() { time_t now; static char timestamp[48]; /* get system time */ now = time(NULL); /* convert to timestamp string */ if (local_time) strftime(timestamp,sizeof(timestamp),"%d-%b-%Y %H:%M %Z", localtime(&now)); else strftime(timestamp,sizeof(timestamp),"%d-%b-%Y %H:%M GMT", gmtime(&now)); return timestamp; } /*********************************************/ /* ISPAGE - determine if an HTML page or not */ /*********************************************/ int ispage(char *str) { NLISTPTR t; char *cp1, *cp2; if (isinlist(omit_page,str)!=NULL) return 0; cp1=cp2=str; while (*cp1!='\0') { if (*cp1=='.') cp2=cp1; cp1++; } if ((cp2++==str)||(*(--cp1)=='/')) return 1; t=page_prefix; while(t!=NULL) { /* Check if a PagePrefix matches */ if(strncmp(str,t->string,strlen(t->string))==0) return 1; t=t->next; } return (isinlist(page_type,cp2)!=NULL); } /*********************************************/ /* ISURLCHAR - checks for valid URL chars */ /*********************************************/ int isurlchar(unsigned char ch, int flag) { if (isalnum(ch)) return 1; /* allow letters, numbers... */ if (ch > 127) return 1; /* allow extended chars... */ if (flag) /* and filter some others */ return (strchr(":/\\.,' *!-+_@~()[]!",ch)!=NULL); /* strip cgi vars */ else return (strchr(":/\\.,' *!-+_@~()[]!;?&=",ch)!=NULL); /* keep cgi vars */ } /*********************************************/ /* CTRY_IDX - create unique # from TLD */ /*********************************************/ u_int64_t ctry_idx(char *str) { int i=strlen(str),j=0; u_int64_t idx=0; char *cp=str+i; for (;i>0;i--) { idx+=((*--cp-'a'+1)<<j); j+=(j==0)?7:5; } return idx; } /*********************************************/ /* UN_IDX - get TLD from index # */ /*********************************************/ char *un_idx(u_int64_t idx) { int i,j; char *cp; static char buf[8]; memset(buf, 0, sizeof(buf)); if (idx<=0) return buf; if ((j=(idx&0x7f))>32) /* only for a1, a2 and o1 */ { buf[0]=(idx>>7)+'a'; buf[1]=j-32; return buf; } for (i=5;i>=0;i--) buf[i]=(i==5)?(idx&0x7f)+'a'-1:(j=(idx>>(((5-i)*5)+2))&0x1f)?j+'a'-1:' '; cp=buf; while (*cp==' ') { for (i=0;i<6;i++) buf[i]=buf[i+1]; } return buf; } /*********************************************/ /* FROM_HEX - convert hex char to decimal */ /*********************************************/ char from_hex(char c) /* convert hex to dec */ { c = (c>='0'&&c<='9')?c-'0': /* 0-9? */ (c>='A'&&c<='F')?c-'A'+10: /* A-F? */ c - 'a' + 10; /* lowercase... */ return (c<0||c>15)?0:c; /* return 0 if bad... */ } /*********************************************/ /* UNESCAPE - convert escape seqs to chars */ /*********************************************/ char *unescape(char *str) { unsigned char *cp1=(unsigned char *)str; /* force unsigned so we */ unsigned char *cp2=cp1; /* can do > 127 */ if (!str) return NULL; /* make sure strings valid */ while (*cp1) { if (*cp1=='%') /* Found an escape? */ { cp1++; if (isxdigit(*cp1)) /* ensure a hex digit */ { if (*cp1) *cp2=from_hex(*cp1++)*16; /* convert hex to an ASCII */ if (*cp1) *cp2+=from_hex(*cp1); /* (hopefully) character */ if ((*cp2<32)||(*cp2==127)) *cp2='_'; /* make '_' if its bad */ if (*cp1) { cp2++; cp1++; } } else *cp2++='%'; } else *cp2++ = *cp1++; /* if not, just continue */ } *cp2=*cp1; /* don't forget terminator */ return str; /* return the string */ } /*********************************************/ /* OURICMP - Case insensitive string compare */ /*********************************************/ int ouricmp(char *str1, char *str2) { while((*str1!=0) && (tolower((unsigned char)*str1)==tolower((unsigned char)*str2))) { str1++;str2++; } if (*str1==0) return 0; else return 1; } /*********************************************/ /* SRCH_STRING - get search strings from ref */ /*********************************************/ void srch_string(char *ptr) { /* ptr should point to unescaped query string */ char tmpbuf[BUFSIZE]; char srch[80]=""; unsigned char *cp1, *cp2, *cps; int sp_flg=0; /* Check if search engine referrer or return */ if ( (cps=(unsigned char *)isinglist(search_list,log_rec.refer))==NULL) return; /* Try to find query variable */ srch[0]='?'; srch[sizeof(srch)-1] = '\0'; strncpy(&srch[1],(char *)cps,sizeof(srch)-2); /* First, try "?..." */ if ((cp1=(unsigned char *)strstr(ptr,srch))==NULL) { srch[0]='&'; /* Next, try "&..." */ if ((cp1=(unsigned char *)strstr(ptr,srch))==NULL) return; } cp2=(unsigned char *)tmpbuf; while (*cp1!='=' && *cp1!=0) cp1++; if (*cp1!=0) cp1++; while (*cp1!='&' && *cp1!=0) { if (*cp1=='"' || *cp1==',' || *cp1=='?') { cp1++; continue; } /* skip bad ones.. */ else { if (*cp1=='+') *cp1=' '; /* change + to space */ if (sp_flg && *cp1==' ') { cp1++; continue; } /* compress spaces */ if (*cp1==' ') sp_flg=1; else sp_flg=0; /* (flag spaces here) */ if (searchcasei) *cp2++=tolower(*cp1++); /* normal character */ else *cp2++=*cp1++; } } *cp2=0; cp2=(unsigned char *)tmpbuf; if (tmpbuf[0]=='?') tmpbuf[0]=' '; /* format fix ? */ while( *cp2!=0 && isspace((unsigned char)*cp2) ) cp2++; /* skip sps. */ if (*cp2==0) return; /* any trailing spaces? */ cp1=cp2+strlen((char *)cp2)-1; while (cp1!=cp2) if (isspace((unsigned char)*cp1)) *cp1--='\0'; else break; /* strip invalid chars */ cp1=cp2; while (*cp1!=0) { if ((*cp1<32)||(*cp1==127)) *cp1='_'; cp1++; } if (put_snode((char *)cp2,(u_int64_t)1,sr_htab)) { if (verbose) /* Error adding search string node, skipping .... */ fprintf(stderr,"%s %s\n", msg_nomem_sc, tmpbuf); } return; } /*********************************************/ /* GET_DOMAIN - Get domain portion of host */ /*********************************************/ char *get_domain(char *str) { char *cp; int i=group_domains+1; if (isipaddr(str)) return NULL; cp = str+strlen(str)-1; while (cp!=str) { if (*cp=='.') if (!(--i)) return ++cp; cp--; } return cp; } /*********************************************/ /* AGENT_MANGLE - Re-format user agent */ /*********************************************/ void agent_mangle(char *str) { char *cp1, *cp2, *cp3; str=cp2=log_rec.agent; cp1=strstr(str,"ompatible"); /* check known fakers */ if (cp1!=NULL) { while (*cp1!=';'&&*cp1!='\0') cp1++; /* kludge for Mozilla/3.01 (compatible;) */ if (*cp1++==';' && strcmp(cp1,")\"")) /* success! */ { /* Opera can hide as MSIE */ cp3=strstr(str,"Opera"); if (cp3!=NULL) { while (*cp3!='.'&&*cp3!='\0') { if(*cp3=='/') *cp2++=' '; else *cp2++=*cp3; cp3++; } cp1=cp3; } else { while (*cp1 == ' ') cp1++; /* eat spaces */ while (*cp1!='.'&&*cp1!='\0'&&*cp1!=';') *cp2++=*cp1++; } if (mangle_agent<5) { while (*cp1!='.'&&*cp1!=';'&&*cp1!='\0') *cp2++=*cp1++; if (*cp1!=';'&&*cp1!='\0') { *cp2++=*cp1++; *cp2++=*cp1++; } } if (mangle_agent<4) if (*cp1>='0'&&*cp1<='9') *cp2++=*cp1++; if (mangle_agent<3) while (*cp1!=';'&&*cp1!='\0'&&*cp1!='('&&*cp1!=' ') *cp2++=*cp1++; if (mangle_agent<2) { /* Level 1 - try to get OS */ cp1=strstr(cp1,")"); if (cp1!=NULL) { *cp2++=' '; *cp2++='('; while (*cp1!=';'&&*cp1!='('&&cp1!=str) cp1--; if (cp1!=str&&*cp1!='\0') cp1++; while (*cp1==' '&&*cp1!='\0') cp1++; while (*cp1!=')'&&*cp1!='\0') *cp2++=*cp1++; *cp2++=')'; } } *cp2='\0'; } else { /* nothing after "compatible", should we mangle? */ /* not for now */ } } else { cp1=strstr(str,"Opera"); /* Opera flavor */ if (cp1!=NULL) { while (*cp1!='/'&&*cp1!=' '&&*cp1!='\0') *cp2++=*cp1++; while (*cp1!='.'&&*cp1!='\0') { if(*cp1=='/') *cp2++=' '; else *cp2++=*cp1; cp1++; } if (mangle_agent<5) { while (*cp1!='.'&&*cp1!='\0') *cp2++=*cp1++; *cp2++=*cp1++; *cp2++=*cp1++; } if (mangle_agent<4) if (*cp1>='0'&&*cp1<='9') *cp2++=*cp1++; if (mangle_agent<3) while (*cp1!=' '&&*cp1!='\0'&&*cp1!='(') *cp2++=*cp1++; if (mangle_agent<2) { cp1=strstr(cp1,"("); if (cp1!=NULL) { cp1++; *cp2++=' '; *cp2++='('; while (*cp1!=';'&&*cp1!=')'&&*cp1!='\0') *cp2++=*cp1++; *cp2++=')'; } } *cp2='\0'; } else { cp1=strstr(str,"Mozilla"); /* Netscape flavor */ if (cp1!=NULL) { while (*cp1!='/'&&*cp1!=' '&&*cp1!='\0') *cp2++=*cp1++; if (*cp1==' ') *cp1='/'; while (*cp1!='.'&&*cp1!='\0') *cp2++=*cp1++; if (mangle_agent<5) { while (*cp1!='.'&&*cp1!='\0') *cp2++=*cp1++; *cp2++=*cp1++; *cp2++=*cp1++; } if (mangle_agent<4) if (*cp1>='0'&&*cp1<='9') *cp2++=*cp1++; if (mangle_agent<3) while (*cp1!=' '&&*cp1!='\0'&&*cp1!='(') *cp2++=*cp1++; if (mangle_agent<2) { /* Level 1 - Try to get OS */ cp1=strstr(cp1,"("); if (cp1!=NULL) { cp1++; *cp2++=' '; *cp2++='('; while (*cp1!=';'&&*cp1!=')'&&*cp1!='\0') *cp2++=*cp1++; *cp2++=')'; } } *cp2='\0'; } } } } /*********************************************/ /* OUR_GZGETS - enhanced gzgets for log only */ /*********************************************/ char *our_gzgets(void *fp, char *buf, int size) { char *out_cp=buf; /* point to output */ while (1) { if (f_cp>(f_buf+f_end-1)) /* load? */ { #ifdef USE_BZIP f_end=(gz_log==COMP_BZIP)? BZ2_bzread(fp, f_buf, GZ_BUFSIZE): gzread(fp, f_buf, GZ_BUFSIZE); #else f_end=gzread(fp, f_buf, GZ_BUFSIZE); #endif if (f_end<=0) return Z_NULL; f_cp=f_buf; } if (--size) /* more? */ { *out_cp++ = *f_cp; if (*f_cp++ == '\n') { *out_cp='\0'; return buf; } } else { *out_cp='\0'; return buf; } } } #ifdef USE_BZIP /*********************************************/ /* bz2_rewind - our 'rewind' for bz2 files */ /*********************************************/ int bz2_rewind( void **fp, char *fname, char *mode ) { BZ2_bzclose( *fp ); *fp = BZ2_bzopen( fname, "rb"); f_cp=f_buf+GZ_BUFSIZE; f_end=0; /* reset buffer counters */ memset(f_buf, 0, sizeof(f_buf)); if (*fp == Z_NULL) return -1; else return 0; } #endif /* USE_BZIP */ /*********************************************/ /* ISIPADDR - Determine if str is IP address */ /*********************************************/ int isipaddr(char *str) { int i=1,j=0; char *cp; /* generic ptr */ if (strchr(str,':')!=NULL) { /* Possible IPv6 Address */ cp=str; while (strchr(":.abcdef0123456789",*cp)!=NULL && *cp!='\0') { if (*cp=='.') j++; if (*cp++==':') i++; } if (*cp!='\0') return -1; /* bad hostname (has ':') */ if (i>1 && j) return 2; /* IPv4/IPv6 */ return 3; /* IPv6 */ } else { /* Not an IPv6 address, check for IPv4 */ cp=str; while (strchr(".0123456789",*cp)!=NULL && *cp!='\0') { if (*cp++=='.') i++; } if (*cp!='\0') return 0; /* hostname */ if (i!=4) return -1; /* bad hostname */ return 1; /* IPv4 */ } } /*****************************************************************/ /* */ /* JDATE - Julian date calculator */ /* */ /* Calculates the number of days since Jan 1, 0000. */ /* */ /* Originally written by Bradford L. Barrett (03/17/1988) */ /* Returns an unsigned long value representing the number of */ /* days since January 1, 0000. */ /* */ /* Note: Due to the changes made by Pope Gregory XIII in the */ /* 16th Centyry (Feb 24, 1582), dates before 1583 will */ /* not return a truely accurate number (will be at least */ /* 10 days off). Somehow, I don't think this will */ /* present much of a problem for most situations :) */ /* */ /* Usage: days = jdate(day, month, year) */ /* */ /* The number returned is adjusted by 5 to facilitate day of */ /* week calculations. The mod of the returned value gives the */ /* day of the week the date is. (ie: dow = days % 7 ) where */ /* dow will return 0=Sunday, 1=Monday, 2=Tuesday, etc... */ /* */ /*****************************************************************/ u_int64_t jdate( int day, int month, int year ) { u_int64_t days; /* value returned */ int mtable[] = {0,31,59,90,120,151,181,212,243,273,304,334}; /* First, calculate base number including leap and Centenial year stuff */ days=(((u_int64_t)year*365)+day+mtable[month-1]+ ((year+4)/4) - ((year/100)-(year/400))); /* now adjust for leap year before March 1st */ if ((year % 4 == 0) && !((year % 100 == 0) && (year % 400 != 0)) && (month < 3)) --days; /* done, return with calculated value */ return(days+5); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������webalizer-2.23-05/webalizer.h�����������������������������������������������������������������������0000644�0001750�0001750�00000036060�11454021220�014401� 0����������������������������������������������������������������������������������������������������ustar �brad����������������������������brad�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#ifndef _WEBALIZER_H #define _WEBALIZER_H #define PCENT(val,max) ((val)?((double)val/(double)max)*100.0 : 0.0) #define IDX_2C(c1,c2) (((c1-'a'+1)<<7)+(c2-'a'+1) ) #define IDX_3C(c1,c2,c3) (((c1-'a'+1)<<12)+((c2-'a'+1)<<7)+(c3-'a'+1) ) #define IDX_4C(c1,c2,c3,c4) (((c1-'a'+1)<<17)+((c2-'a'+1)<<12)+((c3-'a'+1)<<7)+(c4-'a'+1) ) #define IDX_5C(c1,c2,c3,c4,c5) (((c1-'a'+1)<<22)+((c2-'a'+1)<<17)+((c3-'a'+1)<<12)+((c4-'a'+1)<<7)+(c5-'a'+1) ) #define IDX_6C(c1,c2,c3,c4,c5,c6) (((c1-'a'+1)<<27)+((c2-'a'+1)<<22)+((c3-'a'+1)<<17)+((c4-'a'+1)<<12)+((c5-'a'+1)<<7)+(c6-'a'+1) ) #ifndef MAX #define MAX(a,b) ((a) > (b) ? (a) : (b)) #endif #define MAXHASH 4096 /* Size of our hash tables */ #define BUFSIZE 4096 /* Max buffer size for log record */ #define MAXHOST 128 /* Max hostname buffer size */ #define MAXURL 4096 /* Max HTTP request/URL field size */ #define MAXURLH 512 /* Max URL field size in htab */ #define MAXREF 1024 /* Max referrer field size */ #define MAXREFH 256 /* Max referrer field size in htab */ #define MAXAGENT 128 /* Max user agent field size */ #define MAXCTRY 48 /* Max country name size */ #define MAXSRCH 256 /* Max size of search string buffer */ #define MAXSRCHH 128 /* Max size of search str in htab */ #define MAXIDENT 64 /* Max size of ident string (user) */ #define MAXKWORD 32 /* Max size of config keyword */ #define MAXKVAL 132 /* Max size of config value */ #define HISTSIZE 120 /* Size of history in months */ #define GRAPHMAX 72 /* Max months in index graph */ #define SLOP_VAL 3600 /* out of sequence slop (seconds) */ /* Log types */ #define LOG_CLF 0 /* CLF/combined log type */ #define LOG_FTP 1 /* wu-ftpd xferlog type */ #define LOG_SQUID 2 /* squid proxy log */ #define LOG_W3C 3 /* W3C extended log format */ /* compression */ #define COMP_NONE 0 #define COMP_GZIP 1 #define COMP_BZIP 2 /* Response code defines as per draft ietf HTTP/1.1 rev 6 */ #define RC_CONTINUE 100 #define RC_SWITCHPROTO 101 #define RC_OK 200 #define RC_CREATED 201 #define RC_ACCEPTED 202 #define RC_NONAUTHINFO 203 #define RC_NOCONTENT 204 #define RC_RESETCONTENT 205 #define RC_PARTIALCONTENT 206 #define RC_MULTIPLECHOICES 300 #define RC_MOVEDPERM 301 #define RC_MOVEDTEMP 302 #define RC_SEEOTHER 303 #define RC_NOMOD 304 #define RC_USEPROXY 305 #define RC_MOVEDTEMPORARILY 307 #define RC_BAD 400 #define RC_UNAUTH 401 #define RC_PAYMENTREQ 402 #define RC_FORBIDDEN 403 #define RC_NOTFOUND 404 #define RC_METHODNOTALLOWED 405 #define RC_NOTACCEPTABLE 406 #define RC_PROXYAUTHREQ 407 #define RC_TIMEOUT 408 #define RC_CONFLICT 409 #define RC_GONE 410 #define RC_LENGTHREQ 411 #define RC_PREFAILED 412 #define RC_REQENTTOOLARGE 413 #define RC_REQURITOOLARGE 414 #define RC_UNSUPMEDIATYPE 415 #define RC_RNGNOTSATISFIABLE 416 #define RC_EXPECTATIONFAILED 417 #define RC_SERVERERR 500 #define RC_NOTIMPLEMENTED 501 #define RC_BADGATEWAY 502 #define RC_UNAVAIL 503 #define RC_GATEWAYTIMEOUT 504 #define RC_BADHTTPVER 505 /* Index defines for RC codes */ #define IDX_UNDEFINED 0 #define IDX_CONTINUE 1 #define IDX_SWITCHPROTO 2 #define IDX_OK 3 #define IDX_CREATED 4 #define IDX_ACCEPTED 5 #define IDX_NONAUTHINFO 6 #define IDX_NOCONTENT 7 #define IDX_RESETCONTENT 8 #define IDX_PARTIALCONTENT 9 #define IDX_MULTIPLECHOICES 10 #define IDX_MOVEDPERM 11 #define IDX_MOVEDTEMP 12 #define IDX_SEEOTHER 13 #define IDX_NOMOD 14 #define IDX_USEPROXY 15 #define IDX_MOVEDTEMPORARILY 16 #define IDX_BAD 17 #define IDX_UNAUTH 18 #define IDX_PAYMENTREQ 19 #define IDX_FORBIDDEN 20 #define IDX_NOTFOUND 21 #define IDX_METHODNOTALLOWED 22 #define IDX_NOTACCEPTABLE 23 #define IDX_PROXYAUTHREQ 24 #define IDX_TIMEOUT 25 #define IDX_CONFLICT 26 #define IDX_GONE 27 #define IDX_LENGTHREQ 28 #define IDX_PREFAILED 29 #define IDX_REQENTTOOLARGE 30 #define IDX_REQURITOOLARGE 31 #define IDX_UNSUPMEDIATYPE 32 #define IDX_RNGNOTSATISFIABLE 33 #define IDX_EXPECTATIONFAILED 34 #define IDX_SERVERERR 35 #define IDX_NOTIMPLEMENTED 36 #define IDX_BADGATEWAY 37 #define IDX_UNAVAIL 38 #define IDX_GATEWAYTIMEOUT 39 #define IDX_BADHTTPVER 40 #define TOTAL_RC 41 #ifdef USE_DNS #include <netinet/in.h> /* needed for in_addr structure definition */ #ifndef INADDR_NONE #define INADDR_NONE 0xFFFFFFFF #endif /* INADDR_NONE */ #endif /* Response code structure */ struct response_code { char *desc; /* code description */ u_int64_t count; }; /* hit counter */ /* Country code structure */ struct country_code {u_int64_t idx; /* TLD index number */ char *desc; /* TLD description */ u_int64_t count; /* hit counter */ u_int64_t files; /* file counter */ double xfer; }; /* xfer amt counter */ typedef struct country_code *CLISTPTR; /* log record structure */ struct log_struct { char hostname[MAXHOST]; /* hostname */ char datetime[29]; /* raw timestamp */ char url[MAXURL]; /* raw request field */ int resp_code; /* response code */ u_int64_t xfer_size; /* xfer size in bytes */ char refer[MAXREF]; /* referrer */ char agent[MAXAGENT]; /* user agent (browser) */ char srchstr[MAXSRCH]; /* search string */ char ident[MAXIDENT]; }; /* ident string (user) */ extern struct log_struct log_rec; extern char *version ; /* program version */ extern char *editlvl ; /* edit level */ extern char *moddate ; /* modification date */ extern char *copyright ; extern int verbose ; /* 2=verbose,1=err, 0=none */ extern int debug_mode ; /* debug mode flag */ extern int time_me ; /* timing display flag */ extern int local_time ; /* 1=localtime 0=GMT (UTC) */ extern int hist_gap ; /* hist error, save backup */ extern int ignore_hist ; /* history flag (1=skip) */ extern int ignore_state ; /* state fiag (1=skip) */ extern int hourly_graph ; /* hourly graph display */ extern int hourly_stats ; /* hourly stats table */ extern int daily_graph ; /* daily graph display */ extern int daily_stats ; /* daily stats table */ extern int ctry_graph ; /* country graph display */ extern int shade_groups ; /* Group shading 0=no 1=yes */ extern int hlite_groups ; /* Group hlite 0=no 1=yes */ extern int mangle_agent ; /* mangle user agents */ extern int incremental ; /* incremental mode 1=yes */ extern int use_https ; /* use 'https://' on URLs */ extern int htaccess ; /* create .htaccess? (0=no) */ extern int visit_timeout; /* visit timeout (30 min) */ extern int graph_legend ; /* graph legend (1=yes) */ extern int graph_lines ; /* graph lines (0=none) */ extern int fold_seq_err ; /* fold seq err (0=no) */ extern int log_type ; /* (0=clf, 1=ftp, 2=squid) */ extern int group_domains; /* Group domains 0=none */ extern int hide_sites ; /* Hide ind. sites (0=no) */ extern int graph_mths ; /* # months in index graph */ extern int index_mths ; /* # months in index table */ extern int year_hdrs ; /* Show year headers (0=no) */ extern int year_totals ; /* Show year totals (0=no) */ extern int use_flags ; /* Show flags in ctry table */ extern char *flag_dir ; /* flag directory */ extern char *hname ; /* hostname for reports */ extern char *state_fname ; /* run state file name */ extern char *hist_fname ; /* name of history file */ extern char *html_ext ; /* HTML file prefix */ extern char *dump_ext ; /* Dump file prefix */ extern char *conf_fname ; /* name of config file */ extern char *log_fname ; /* log file pointer */ extern char *out_dir ; /* output directory */ extern char *blank_str ; /* blank string */ extern char *dns_cache ; /* DNS cache file name */ extern int geodb ; /* Use GeoDB flag (0=no) */ extern int dns_children ; /* # of DNS children */ extern int cache_ips ; /* Cache IP addrs (0=no) */ extern int cache_ttl ; /* Cache entry TTL (days) */ extern int link_referrer; /* link referrer (0=no) */ extern int trimsquid ; /* trim squid URLs (0=none) */ extern int searchcasei ; /* case insensitive search */ extern int ntop_sites ; /* top n sites to display */ extern int ntop_sitesK ; /* top n sites (by kbytes) */ extern int ntop_urls ; /* top n url's to display */ extern int ntop_urlsK ; /* top n url's (by kbytes) */ extern int ntop_entry ; /* top n entry url's */ extern int ntop_exit ; /* top n exit url's */ extern int ntop_refs ; /* top n referrers "" */ extern int ntop_agents ; /* top n user agents "" */ extern int ntop_ctrys ; /* top n countries "" */ extern int ntop_search ; /* top n search strings */ extern int ntop_users ; /* top n users to display */ extern int all_sites ; /* List All sites (0=no) */ extern int all_urls ; /* List All URLs (0=no) */ extern int all_refs ; /* List All Referrers */ extern int all_agents ; /* List All User Agents */ extern int all_search ; /* List All Search Strings */ extern int all_users ; /* List All Usernames */ extern int dump_sites ; /* Dump tab delimited sites */ extern int dump_urls ; /* URLs */ extern int dump_refs ; /* Referrers */ extern int dump_agents ; /* User Agents */ extern int dump_users ; /* Usernames */ extern int dump_search ; /* Search strings */ extern int dump_header ; /* Dump header as first rec */ extern char *dump_path ; /* Path for dump files */ extern u_int64_t cur_tstamp; /* Current timestamp */ extern u_int64_t epoch; /* used for timestamp adj. */ extern int check_dup; /* check for dups flag */ extern int cur_year,cur_month, /* year/month/day/hour */ cur_day, cur_hour, /* tracking variables */ cur_min, cur_sec; extern double t_xfer; /* monthly total xfer value */ extern u_int64_t t_hit, t_file, t_site, /* monthly total vars */ t_url, t_ref, t_agent, t_page,t_visit,t_user; extern double tm_xfer[31]; /* daily transfer totals */ extern u_int64_t tm_hit[31], tm_file[31], /* daily total arrays */ tm_site[31],tm_page[31], tm_visit[31]; extern u_int64_t dt_site; /* daily 'sites' total */ extern u_int64_t ht_hit,mh_hit; /* hourly hits totals */ extern u_int64_t th_hit[24], th_file[24], /* hourly total arrays */ th_page[24]; extern double th_xfer[24]; /* hourly xfer array */ extern int f_day,l_day; /* first/last day vars */ extern int gz_log; /* flag for zipped log */ extern CLISTPTR *top_ctrys; /* Top countries table */ extern char hit_color[]; /* graph hit color */ extern char file_color[]; /* graph file color */ extern char site_color[]; /* graph site color */ extern char kbyte_color[]; /* graph kbyte color */ extern char page_color[]; /* graph page color */ extern char visit_color[]; /* graph visit color */ extern char misc_color[]; /* graph misc color */ extern char pie_color1[]; /* pie additionnal color 1 */ extern char pie_color2[]; /* pie additionnal color 2 */ extern char pie_color3[]; /* pie additionnal color 3 */ extern char pie_color4[]; /* pie additionnal color 4 */ /* define our externally visable functions */ extern char *cur_time(); extern u_int64_t ctry_idx(char *); extern char *un_idx(u_int64_t); extern void init_counters(); extern int ispage(char *); extern u_int64_t jdate(int,int,int); extern char from_hex(char); extern int isipaddr(char *); #endif /* _WEBALIZER_H */ ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������webalizer-2.23-05/webalizer.png���������������������������������������������������������������������0000644�0001750�0001750�00000002345�10771016751�014753� 0����������������������������������������������������������������������������������������������������ustar �brad����������������������������brad�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������PNG  ��� IHDR���X������T���gAMA�� a���PLTEŸdnnZmXF7-% #SQSQ��55ddxx탃虙ܥ鰰ڄ珏7HvȓSЙ 11aa|{eee ���Zѓ��IDATx}W:[CKvhݫvV;$`9L^%d_G?~ѯa')wIv[+u(-KU8p'cM0 \ #',8M~vdGpBżnZ-,Q}qƨ#(M/{쵷dQ9u^G{#7Dj"\G2d_TEz�%I> le|/^]*FXӘrՌ~3W epQXdXNE|i kQH?`+$A;F \΀3N`*?(kSifΎv=DWŠUh8V|=U>?[+q|2&Ju>ehPukzh4ݎ /A8r35m-Lj�f"9ECxB`.ӌ!,ѓl[$i<Fߓ$Azl==ҥL+)L9|:&)͝[ŔMF:jίm\6*牞{iq)_(t,qO3{[² L"/jjї;�wE9��;S bF_]U'D($lni,}\#D#z_;1[2رH)tluԢtw X0@`gl6  wBڅ31Z28M^>9zӀ+7MR79Cg-p9zg'/lfOg7u]ܚtmݒ5HY>tI [Ngn"[3Т&#঩~ T/<L}ٙk]7QՄ:#KUfgq>Yl}|guL ngwse����IENDB`�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������webalizer-2.23-05/lang/�����������������������������������������������������������������������������0000755�0001750�0001750�00000000000�11551757724�013207� 5����������������������������������������������������������������������������������������������������ustar �brad����������������������������brad�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������webalizer-2.23-05/lang/webalizer_lang.albanian������������������������������������������������������0000644�0001750�0001750�00000115132�11032527214�017645� 0����������������������������������������������������������������������������������������������������ustar �brad����������������������������brad�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* webalizer_lang.albanian Kartelë Mbulimi Gjuhësor për Shqipen për Webalizer V2.0x. 06-Mar-2006 nga Besnik Bleta besnik@programeshqip.org) 12-May-2008 Updated to current IANA TLDs (brad@mrunix.net) 26-May-2008 Modified for level 2.2 support (brad@mrunix.net) */ /***********************************************************************/ /* DEFINE LANGUAGE NAME here */ /***********************************************************************/ /* char *language = "Shqip"; */ char *language = "Albanian"; char *langcode = "sq"; /***********************************************************************/ /* */ /* Informational messages */ /* */ /* These messages are only displayed while The Webalizer is being run, */ /* usually to the screen, and are not part of the HTML output. */ /* */ /***********************************************************************/ /* these are only used in timing totals */ /* Format: XXX records (XXX ignored, XXX bad) in X.XX seconds */ char *msg_records = "regjistrime"; char *msg_addresses="vendndodhje"; char *msg_ignored = "shpërfillur"; char *msg_bad = "i dëmtuar"; char *msg_in = "në"; char *msg_seconds = "sekonda"; /* mesazhi gabimi gjatë rregullimit dhe ecurisë */ char *msg_log_err = "Gabim: S'hap dot kartelë regjistrimesh"; char *msg_log_use = "Po përdor kartelë regjistrimesh"; char *msg_dir_err = "Gabim: S'ndryshoj dot drejtorinë në"; char *msg_dir_use = "Po krijoj përfundimet në"; char *msg_cur_dir = "drejtorinë e çastit"; char *msg_hostname= "Strehëemri për raportime është"; char *msg_ign_hist= "Po shpërfill historikun e mëparshëm..."; char *msg_no_hist = "Nuk u gjet kartelë historiku..."; char *msg_get_hist= "Po lexoj kartelë historiku..."; char *msg_put_hist= "Po ruaj të dhëna historiku..."; char *msg_hist_err= "Gabim: I pazoti të shkruaj kartelë historiku"; char *msg_bad_hist= "Gabim: Po shpërfill regjistrime të pavlefshëm historiku"; char *msg_bad_conf= "Gabim: I pazoti të hap kartelë formësimi"; char *msg_bad_key = "Kujdes: Fjalëkyç i pavlefshëm"; char *msg_bad_date= "Gabim: Po anashkaloj regjistrime (datë e gabuar)"; char *msg_ign_nscp= "Po anashkaloj regjistrim titujsh Netscape"; char *msg_bad_rec = "Po anashkaloj regjistrim të dëmtuar"; char *msg_no_vrec = "Nuk u gjetën regjistrime të vlefshëm!"; char *msg_gen_rpt = "Po prodhoj raport për"; char *msg_gen_sum = "Po prodhoj raport përmbledhës"; char *msg_get_data= "Po lexoj të dhëna të mëparshme xhirimi.."; char *msg_put_data= "Po ruaj të dhëna të tanishme xhirimi..."; char *msg_no_data = "nuk u gjetën të dhëna të mëparshme xhirimi..."; char *msg_bad_data= "Gabim: I pazoti të rikthej të dhëna xhirimi"; char *msg_data_err= "Gabim: I pazoti të ruaj të dhëna të tanishme xhirimi"; char *msg_dup_data= "Kujdes: Ka gjasa të jenë gjendur të dhëna të përsëritura"; /* Gjëra DNS */ char *msg_dns_nocf= "Nuk u tregua kartelë fshehtine, po e ndërpres..."; char *msg_dns_nodb= "Error: I pazoti të hap kartelë fshehtine DNS"; char *msg_dns_nolk= "Error: I pazoti të kyç kartelë fshehtine DNS"; char *msg_dns_usec= "Po përdor kartelë fshehtine DNS"; char *msg_dns_rslv= "Kërkim DNS"; char *msg_dns_none= "Asnjë për t'u përpunuar"; char *msg_dns_abrt= "DNS support not present, aborting..."; /* Geolocation stuff */ char *msg_geo_open= "Error opening file"; char *msg_geo_use = "Using"; char *msg_geo_nolu= "lookups disabled"; char *msg_geo_dflt= "default"; /* gabime sigurimi kujtese */ char *msg_nomem_ts= "Nuk siguroj dot kujtesë të mjaftueshme, U çaktivizua \"Site\"-e Kryesues!"; char *msg_nomem_tr= "Nuk siguroj dot kujtesë të mjaftueshme, U çaktivizua Përmendësa Kryesues!"; char *msg_nomem_tu= "Nuk siguroj dot kujtesë të mjaftueshme, U çaktivizua URL-ra Kryesuese!"; char *msg_nomem_tc= "Nuk siguroj dot kujtesë të mjaftueshme, U çaktivizua Vende Kryesues!"; char *msg_nomem_ta= "Nuk siguroj dot kujtesë të mjaftueshme, U çaktivizua Agjentë Kryesues Përdoruesi!"; char *msg_nomem_tsr="Nuk siguroj dot kujtesë të mjaftueshme, U çaktivizua Vargje Kryesuese Kërkimi!"; char *msg_nomem_ti= "Nuk siguroj dot kujtesë të mjaftueshme, U çaktivizua Emra Kryesues Përdoruesi!"; char *msg_nomem_dh= "Gabim gjatë shtimit të nyjes për strehë (përditë), po e anashkaloj"; char *msg_nomem_mh= "Gabim gjatë shtimit të nyjes për strehë (çdo muaj), po e anashkaloj"; char *msg_nomem_u = "Gabim gjatë shtimit të nyjes për URL, po e anashkaloj"; char *msg_nomem_a = "Gabim gjatë shtimit të nyjes për Agjent Përdoruesi, po e anashkaloj"; char *msg_nomem_r = "Gabim gjatë shtimit të nyjes për Përmendës, po e anashkaloj"; char *msg_nomem_sc= "Gabim gjatë shtimit të nyjes për Varg Kërkimi, po e anashkaloj"; char *msg_nomem_i = "Gabim gjatë shtimit të nyjes për Emër përdoruesi, po e anashkaloj"; /* gabime zërash regjistrimi */ char *msg_big_rec = "Gabim: Po anashkolaj regjistrim më të madh se ç'duhet"; char *msg_big_host= "Kujdes: Po cungoj emër strehe më të madh se ç'duhet"; char *msg_big_date= "Kujdes: Po cungoj kuti date më të madhe se ç'duhet"; char *msg_big_req = "Kujdes: Po cungoj kuti kërkese më të madhe se ç'duhet"; char *msg_big_ref = "Kujdes: Po cungoj kuti përmendësi më të madhe se ç'duhet"; char *msg_big_user= "Kujdes: Po cungoj emër përdoruesi më të madh se ç'duhet"; char *msg_big_one = "Kujdes: Vargu tejkalon masën e lejuar"; /* gabime të ndryshëm */ char *msg_no_open = "Gabim: I pazoti të hap kartelën"; /* Shfaqje e ndihmës... */ char *h_usage1 = "Përdorimi"; char *h_usage2 = "[mundësi] [kartelë regjistrimi]"; char *h_msg[]= { "-h = shtyp këtë mesazh ndihme" , "-V = shtyp të dhëna versioni" , "-v = be verbose" , "-d = shtyp të dhëna shtesë diagnostikimi" , "-F type = Tip regjistrimi. tipi= (clf | ftp | squid | w3c)", "-f = Fold sequence errors" , "-i = shpërfill kartelë historiku" , "-p = ruaj gjendje (shtues)" , "-b = ignore state (incremental)" , "-q = pa mesazhe informues" , "-Q = pa _ASNJË_ mesazh" , "-Y = pa graf vendesh" , "-G = pa graf të përorshëm" , "-H = pa statistika të përorshme" , "-L = pa legjenda me ngjyra për grafin" , "-l num = përdor në graf rreshta sfondi numrash", "-m num = Vlerë skadimi vizite (sekonda)" , "-T = print timing information" , "-c file = përdor kartelën e formësimit 'kartelë'", "-n name = emër strehe për t'u përdorur" , "-o dir = drejtori për t'u përdorur për përfundime", "-t name = titull raporti 'emër'" , "-a name = fshih agjentin e përdoruesi 'emër'" , "-r name = fshih përmendësin 'emër'" , "-s name = fshih \"site\"-in 'emër'" , "-u name = fshih URL-në 'emër'" , "-x name = Përdor zgjerim emër kartelash 'emër'", "-O name = Omit page 'name'" , "-P name = Zgjerim tipi faqesh 'emër'" , "-I name = Alias treguesi 'emër'" , "-K num = num months in summary table" , "-k num = num months in summary graph" , "-A num = Shfaq num agjentësh kryesues" , "-C num = Shfaq num vendesh kryesuese" , "-R num = Shfaq num përmendësish kryesues" , "-S num = Shfaq num \"site\"-esh kryesues" , "-U num = Shfaq num URL-sh kryesuese" , "-e num = Shfaq num Faqesh Fillimi kryesuese" , "-E num = Shfaq num Faqesh Daljeje kryesues" , "-g num = Grupo Përkatësitë në 'num' nivele" , "-X = Fshih \"site\"-e individualë" , "-z dir = Use country flags in 'dir'" , #ifdef USE_DNS "-D name = Përdor kartelë fshehtine DNS 'emër'" , "-N num = Numër procesesh DNS (0=çaktivizoje)" , "-j = Enable native GeoDB lookups" , "-J name = Use GeoIP database 'emër'" , #endif #ifdef USE_GEOIP "-w = Enable GeoIP lookups" , "-W name = Use GeoIP database 'emër'" , #endif NULL}; /***********************************************************************/ /* */ /* Vargje HTML */ /* */ /* Këta vargje përdoren si pjesë e përfundimit HTML të prodhuar nga */ /* Webalizer-i. */ /* */ /***********************************************************************/ /* header strings */ char *msg_hhdr_sp = "Periudhë Përmbledhëse"; char *msg_hhdr_gt = "Prodhuar"; /* main index strings */ char *msg_main_us = "Përmbledhje përdorimi për"; /* char *msg_main_per= "12 Muajt e Fundit"; */ char *msg_main_per= "Përmbledhje sipas Muajsh"; char *msg_main_sum= "Përmbledhje sipas Muajsh"; char *msg_main_da = "Mes. Ditore"; char *msg_main_mt = "Tërësi Përmujore"; /* month HTML page strings */ char *msg_hmth_du = "Përdorim ditor për"; char *msg_hmth_hu = "Përdorim i përorshëm për"; /* vargje titujsh tabelash */ char *msg_h_by = "Nga"; char *msg_h_avg = "Mes"; char *msg_h_max = "Maks"; char *msg_h_total = "Gjithsej"; char *msg_h_totals= "Tërësi"; char *msg_h_day = "Ditë"; char *msg_h_mth = "Muaj"; char *msg_h_hour = "Orë"; char *msg_h_hits = "Hapje"; char *msg_h_pages = "Faqe"; char *msg_h_visits= "Vizita"; char *msg_h_files = "Kartela"; char *msg_h_sites = "\"Site\"-e"; char *msg_h_xfer = "KBajt"; char *msg_h_hname = "Emërstrehë"; char *msg_h_url = "URL"; char *msg_h_agent = "Agjent Përdoruesi"; char *msg_h_ref = "Përmendës"; char *msg_h_ctry = "Vend"; char *msg_h_search= "Varg Kërkimesh"; char *msg_h_uname = "Emër Përdoruesi"; /* lidhje përgjatë kryesh faqeje */ char *msg_hlnk_ds = "Statistika Ditore"; char *msg_hlnk_hs = "Statistika çdo Orë"; char *msg_hlnk_u = "URL-ra"; char *msg_hlnk_s = "\"Site\"-e"; char *msg_hlnk_a = "Agjentë"; char *msg_hlnk_c = "Vende"; char *msg_hlnk_r = "Përmendësa"; char *msg_hlnk_en = "Hyrje"; char *msg_hlnk_ex = "Dalje"; char *msg_hlnk_sr = "Kërkim"; char *msg_hlnk_i = "Përdoruesa"; /* tabelë tërësie mujore */ char *msg_mtot_ms = "Statistika Mujore për"; char *msg_mtot_th = "Hapje Gjithsej"; char *msg_mtot_tf = "Kartela Gjithsej"; char *msg_mtot_tx = "KBajt Gjithsej"; char *msg_mtot_us = "\"Site\"-e Unikë Gjithsej"; char *msg_mtot_ur = "Përmendësa Unikë Gjithsej"; char *msg_mtot_ua = "Agjentë Unikë Përdoruesi Gjithsej"; char *msg_mtot_uu = "URL Unike Gjithsej"; char *msg_mtot_ui = "Emra Unikë përdoruesish Gjithsej"; char *msg_mtot_mhd= "Hapje në Ditë"; char *msg_mtot_mhh= "Hapje në Orë"; char *msg_mtot_mfd= "Kartela në Ditë"; char *msg_mtot_mpd= "Faqe në Ditë"; char *msg_mtot_msd= "\"Site\"-e në Ditë"; char *msg_mtot_mvd= "Vizita në Ditë"; char *msg_mtot_mkd= "KBajt në Ditë"; char *msg_mtot_rc = "Hapje sipas Kodi Përgjigjesh"; /* tabelë tërësie ditore */ char *msg_dtot_ds = "Statistika Ditore për"; /* tabelë tërësie sipas orësh */ char *msg_htot_hs = "Statistika të Përorshme për"; /* grafik sipas vendesh */ char *msg_ctry_use= "Përdorim sipas Vendesh për"; /* tabela kryesimesh */ /* Formatuar si "xxx kryesues e xxx Tërësisë së diçkaje" */ char *msg_top_top = "Kryesues"; char *msg_top_of = "për"; char *msg_top_s = "\"Site\"-e Gjithsej"; char *msg_top_u = "URL-ra Gjithsej"; char *msg_top_r = "Përmendësa Gjithsej"; char *msg_top_a = "Agjentë Përdoruesish Gjithsej"; char *msg_top_c = "Vende Gjithsej"; char *msg_top_en = "Faqe Hyrjesh Gjithsej"; char *msg_top_ex = "Faqe Daljesh Gjithsej"; char *msg_top_sr = "Vargje Kërkimesh Gjithsej"; char *msg_top_i = "Emra përdoruesish Gjithsej"; char *msg_v_sites = "Shihni Tërë \"Site\"-et"; char *msg_v_urls = "Shihni Tërë URL-tës"; char *msg_v_refs = "Shihni Tërë Përmendësit"; char *msg_v_agents= "Shihni Tërë Agjentët e Përdoruesve"; char *msg_v_search= "Shihni Tërë Vargjet e Kërkimeve"; char *msg_v_users = "Shihni Tërë Emrat e përdoruesve"; /* emrat e shkurtër për muajt DUHET TË JENË 3 SHENJA si madhësi... pad if needed*/ char *s_month[12]={ "Jan", "Shk", "Mar", "Pri", "Maj", "Qer", "Kor", "Gus", "Sht", "Tet", "Nën", "Dhj"}; /* emra të gjatë muajsh - gjatësi çfarëdo */ char *l_month[12]={ "Janar", "Shkurt", "Mars", "Prill", "Maj", "Qershor", "Korrik", "Gusht", "Shtator","Tetor", "Nëntor","Dhjetor"}; /* përshkrim kode përgjigjesh... renditja ËSHTË e rëndësishme! */ struct response_code response[] = { { "Kod përgjigjeje të papërcaktuar", 0 }, { "Kod 100 - Vazhdo", 0 }, { "Kod 101 - Po këmbehen Protokolle", 0 }, { "Kod 200 - OK", 0 }, { "Kod 201 - Krijuar", 0 }, { "Kod 202 - Pranuar", 0 }, { "Kod 203 - Informacion Jo Autoritativ", 0 }, { "Kod 204 - Pa Përmbajtje", 0 }, { "Kod 205 - Rimerr Përmbajtje", 0 }, { "Kod 206 - Përmbajtje e Pjesshme", 0 }, { "Kod 300 - Zgjedhje të Shumëfishta", 0 }, { "Kod 301 - Ikur Përgjithmonë", 0 }, { "Kod 302 - U gjet", 0 }, { "Kod 303 - Shih Tjetër", 0 }, { "Kod 304 - Pa Ndryshim", 0 }, { "Kod 305 - Përdor Proxy", 0 }, { "Kod 307 - Ikur Përkohësisht", 0 }, { "Kod 400 - Kërkesë e Fabuar", 0 }, { "Kod 401 - I paautorizuar", 0 }, { "Kod 402 - Lipset Pagesë", 0 }, { "Kod 403 - E ndaluar", 0 }, { "Kod 404 - Nuk Gjendet", 0 }, { "Kod 405 - Metodë e Palejuar", 0 }, { "Kod 406 - E papranueshme", 0 }, { "Kod 407 - Lipset Mirëfilltësim Proxy", 0 }, { "Kod 408 - Skadim Kohe Kërkese", 0 }, { "Kod 409 - Përplasje", 0 }, { "Kod 410 - Ikur", 0 }, { "Kod 411 - Gjatësi e Nevojshme", 0 }, { "Kod 412 - Prakushti Dështoi", 0 }, { "Kod 413 - Entitet Kërkese Shumë i Gjerë", 0 }, { "Kod 414 - URI Kërkese Shumë I gjatë", 0 }, { "Kod 415 - Tip I pambuluar Media", 0 }, { "Kod 416 - U kërkua interval që s'mund të kënaqet", 0 }, { "Kod 417 - Shpresa Nuk u Pwrmbush", 0 }, { "Kod 500 - Gabim i Brendshëm Shërbyesi", 0 }, { "Kod 501 - I pa vënë ende në jetë", 0 }, { "Kod 502 - \"Gateway\" i Gabuar", 0 }, { "Kod 503 - Shërbim jo i mundshëm", 0 }, { "Kod 504 - Skadim Kohe \"Gateway\"-i", 0 }, { "Kod 505 - Version HTTP i Pambuluar", 0 } }; char *msg_title = "Statistika Përdorimi për"; char *msg_h_other = "Tjetër"; /* Kode Vendesh (dikur te ctry.h header file) */ struct country_code ctry[] = { { 0, "I paftilluar/I panjohur", 0,0,0 }, { IDX_3C('c','o','m'), "Tregtar (com)", 0,0,0 }, { IDX_3C('e','d','u'), "Edukativ (edu)", 0,0,0 }, { IDX_3C('g','o','v'), "US, Qeveritar (gov)", 0,0,0 }, { IDX_3C('i','n','t'), "Ndërkombëtar (int)", 0,0,0 }, { IDX_3C('m','i','l'), "US, Ushtarak (mil)", 0,0,0 }, { IDX_3C('n','e','t'), "Rrjet (net)", 0,0,0 }, { IDX_3C('o','r','g'), "Organizëm Jofitimprurës (org)", 0,0,0 }, { IDX_3C('b','i','z'), "Generic Business (biz)", 0,0,0 }, { IDX_3C('c','a','t'), "Catalan Community (cat)", 0,0,0 }, { IDX_3C('p','r','o'), "Professional (pro)", 0,0,0 }, { IDX_3C('t','e','l'), "Ind. Contact Data (tel)", 0,0,0 }, { IDX_4C('a','e','r','o'),"Air Transport Industry (aero)", 0,0,0 }, { IDX_4C('a','s','i','a'),"Asia Pacific Community (asia)", 0,0,0 }, { IDX_4C('c','o','o','p'),"Cooperative Association (coop)", 0,0,0 }, { IDX_4C('i','n','f','o'),"Generic TLD (info)", 0,0,0 }, { IDX_4C('j','o','b','s'),"Human Resources (jobs)", 0,0,0 }, { IDX_4C('m','o','b','i'),"Generic Mobile TLD (mobi)", 0,0,0 }, { IDX_4C('n','a','m','e'),"Individual (name)", 0,0,0 }, { IDX_4C('a','r','p','a'),"Arpanet stil i vjetër (arpa)", 0,0,0 }, { IDX_4C('n','a','t','o'),"Fushë Nato (nato)", 0,0,0 }, { IDX_6C('m','u','s','e','u','m'), "Museums (museum)", 0,0,0 }, { IDX_6C('t','r','a','v','e','l'), "Travel Ind. (travel)", 0,0,0 }, { IDX_2C('a','c'), "Ascension Island", 0,0,0 }, { IDX_2C('a','d'), "Andorra", 0,0,0 }, { IDX_2C('a','e'), "Emiratet e Bashkuar Arabë", 0,0,0 }, { IDX_2C('a','f'), "Afganistan", 0,0,0 }, { IDX_2C('a','g'), "Antigua dhe Barbuda", 0,0,0 }, { IDX_2C('a','i'), "Anguila", 0,0,0 }, { IDX_2C('a','l'), "Shqipëri", 0,0,0 }, { IDX_2C('a','m'), "Armeni", 0,0,0 }, { IDX_2C('a','n'), "Antilet Holandeze", 0,0,0 }, { IDX_2C('a','o'), "Angola", 0,0,0 }, { IDX_2C('a','q'), "Antarktidë", 0,0,0 }, { IDX_2C('a','r'), "Argjentinë", 0,0,0 }, { IDX_2C('a','s'), "Samoa Amerikane", 0,0,0 }, { IDX_2C('a','t'), "Austri", 0,0,0 }, { IDX_2C('a','u'), "Australi", 0,0,0 }, { IDX_2C('a','w'), "Aruba", 0,0,0 }, { IDX_2C('a','x'), "Aland Islands", 0,0,0 }, { IDX_2C('a','z'), "Azerbaixhan", 0,0,0 }, { IDX_2C('b','a'), "Bosnjë dhe Hercegovinë", 0,0,0 }, { IDX_2C('b','b'), "Barbados", 0,0,0 }, { IDX_2C('b','d'), "Bangladesh", 0,0,0 }, { IDX_2C('b','e'), "Belgjikë", 0,0,0 }, { IDX_2C('b','f'), "Burkina Faso", 0,0,0 }, { IDX_2C('b','g'), "Bullgari", 0,0,0 }, { IDX_2C('b','h'), "Bahrein", 0,0,0 }, { IDX_2C('b','i'), "Burundi", 0,0,0 }, { IDX_2C('b','j'), "Benin", 0,0,0 }, { IDX_2C('b','l'), "Saint Barthelemy", 0,0,0 }, { IDX_2C('b','m'), "Bermuda", 0,0,0 }, { IDX_2C('b','n'), "Brunei Darussalam", 0,0,0 }, { IDX_2C('b','o'), "Bolivi", 0,0,0 }, { IDX_2C('b','r'), "Brazil", 0,0,0 }, { IDX_2C('b','s'), "Bahamas", 0,0,0 }, { IDX_2C('b','t'), "Butan", 0,0,0 }, { IDX_2C('b','v'), "Ishulli Buve", 0,0,0 }, { IDX_2C('b','w'), "Botsvanë", 0,0,0 }, { IDX_2C('b','y'), "Bjellorusi", 0,0,0 }, { IDX_2C('b','z'), "Belize", 0,0,0 }, { IDX_2C('c','a'), "Kanada", 0,0,0 }, { IDX_2C('c','c'), "Ishujt Kokos (Keeling)", 0,0,0 }, { IDX_2C('c','d'), "Congo, Democratic Republic", 0,0,0 }, { IDX_2C('c','f'), "Republika e Afrikës Qendrore", 0,0,0 }, { IDX_2C('c','g'), "Kongo", 0,0,0 }, { IDX_2C('c','h'), "Zvicër", 0,0,0 }, { IDX_2C('c','i'), "Bregu i Fildishtë", 0,0,0 }, { IDX_2C('c','k'), "Ishujt Kuk", 0,0,0 }, { IDX_2C('c','l'), "Kili", 0,0,0 }, { IDX_2C('c','m'), "Kamerun", 0,0,0 }, { IDX_2C('c','n'), "Kinë", 0,0,0 }, { IDX_2C('c','o'), "Kolombi", 0,0,0 }, { IDX_2C('c','r'), "Kosta Rika", 0,0,0 }, { IDX_2C('c','u'), "Kubë", 0,0,0 }, { IDX_2C('c','v'), "Kepi i Gjelbër", 0,0,0 }, { IDX_2C('c','x'), "Ishulli i Krishtlindjes", 0,0,0 }, { IDX_2C('c','y'), "Qipro", 0,0,0 }, { IDX_2C('c','z'), "Republika Çeke", 0,0,0 }, { IDX_2C('d','e'), "Gjermani", 0,0,0 }, { IDX_2C('d','j'), "Xhibuti", 0,0,0 }, { IDX_2C('d','k'), "Danimarkë", 0,0,0 }, { IDX_2C('d','m'), "Dominika", 0,0,0 }, { IDX_2C('d','o'), "Republika Dominikane", 0,0,0 }, { IDX_2C('d','z'), "Algjeri", 0,0,0 }, { IDX_2C('e','c'), "Ekuador", 0,0,0 }, { IDX_2C('e','e'), "Estoni", 0,0,0 }, { IDX_2C('e','g'), "Egjipt", 0,0,0 }, { IDX_2C('e','h'), "Sahara Perëndimore", 0,0,0 }, { IDX_2C('e','r'), "Eritrea", 0,0,0 }, { IDX_2C('e','s'), "Spanjë", 0,0,0 }, { IDX_2C('e','t'), "Etiopi", 0,0,0 }, { IDX_2C('e','u'), "European Union", 0,0,0 }, { IDX_2C('f','i'), "Finlandë", 0,0,0 }, { IDX_2C('f','j'), "Fixhi", 0,0,0 }, { IDX_2C('f','k'), "Ishujt Folkland (Malvinas)", 0,0,0 }, { IDX_2C('f','m'), "Mikronezi", 0,0,0 }, { IDX_2C('f','o'), "Ishujt Faroe", 0,0,0 }, { IDX_2C('f','r'), "Francë", 0,0,0 }, { IDX_2C('g','a'), "Gabon", 0,0,0 }, { IDX_2C('g','b'), "Britani e Madhe (UK)", 0,0,0 }, { IDX_2C('g','d'), "Grenada", 0,0,0 }, { IDX_2C('g','e'), "Gjeorgji", 0,0,0 }, { IDX_2C('g','f'), "Guajana Franceze", 0,0,0 }, { IDX_2C('g','g'), "Guernsey", 0,0,0 }, { IDX_2C('g','h'), "Gana", 0,0,0 }, { IDX_2C('g','i'), "Gjibraltar", 0,0,0 }, { IDX_2C('g','l'), "Groenlanda", 0,0,0 }, { IDX_2C('g','m'), "Gambia", 0,0,0 }, { IDX_2C('g','n'), "Guinea", 0,0,0 }, { IDX_2C('g','p'), "Guadalupi", 0,0,0 }, { IDX_2C('g','q'), "Guinea Ekuatoriale", 0,0,0 }, { IDX_2C('g','r'), "Greqi", 0,0,0 }, { IDX_2C('g','s'), "Ishujt S. Jorgjia dhe S. Sandwich", 0,0,0 }, { IDX_2C('g','t'), "Guatemala", 0,0,0 }, { IDX_2C('g','u'), "Guam", 0,0,0 }, { IDX_2C('g','w'), "Guinea-Bisau", 0,0,0 }, { IDX_2C('g','y'), "Gujanë", 0,0,0 }, { IDX_2C('h','k'), "Hong Kong", 0,0,0 }, { IDX_2C('h','m'), "Ishujt Heard dhe McDonald", 0,0,0 }, { IDX_2C('h','n'), "Honduras", 0,0,0 }, { IDX_2C('h','r'), "Kroaci", 0,0,0 }, { IDX_2C('h','t'), "Haiti", 0,0,0 }, { IDX_2C('h','u'), "Hungari", 0,0,0 }, { IDX_2C('i','d'), "Indonezi", 0,0,0 }, { IDX_2C('i','e'), "Irlandë", 0,0,0 }, { IDX_2C('i','l'), "Izrael", 0,0,0 }, { IDX_2C('i','m'), "Isle of Man", 0,0,0 }, { IDX_2C('i','n'), "Indi", 0,0,0 }, { IDX_2C('i','o'), "Territoret Britanike të Oqeanit Indian", 0,0,0 }, { IDX_2C('i','q'), "Irak", 0,0,0 }, { IDX_2C('i','r'), "Iran", 0,0,0 }, { IDX_2C('i','s'), "Islandë", 0,0,0 }, { IDX_2C('i','t'), "Itali", 0,0,0 }, { IDX_2C('j','e'), "Jersey", 0,0,0 }, { IDX_2C('j','m'), "Xhamaika", 0,0,0 }, { IDX_2C('j','o'), "Jordani", 0,0,0 }, { IDX_2C('j','p'), "Japoni", 0,0,0 }, { IDX_2C('k','e'), "Kenia", 0,0,0 }, { IDX_2C('k','g'), "Kirgizstan", 0,0,0 }, { IDX_2C('k','h'), "Kamboxhia", 0,0,0 }, { IDX_2C('k','i'), "Kiribati", 0,0,0 }, { IDX_2C('k','m'), "Komoros", 0,0,0 }, { IDX_2C('k','n'), "Shën Kits dhe Nevis", 0,0,0 }, { IDX_2C('k','p'), "Korea (e Veriut)", 0,0,0 }, { IDX_2C('k','r'), "Korea (e Jugut)", 0,0,0 }, { IDX_2C('k','w'), "Kuvajt", 0,0,0 }, { IDX_2C('k','y'), "Ishujt Kajman", 0,0,0 }, { IDX_2C('k','z'), "Kazakistan", 0,0,0 }, { IDX_2C('l','a'), "Laos", 0,0,0 }, { IDX_2C('l','b'), "Liban", 0,0,0 }, { IDX_2C('l','c'), "Shën Luçia", 0,0,0 }, { IDX_2C('l','i'), "Lihtenshtejn", 0,0,0 }, { IDX_2C('l','k'), "Sri Lanka", 0,0,0 }, { IDX_2C('l','r'), "Liberia", 0,0,0 }, { IDX_2C('l','s'), "Lesoto", 0,0,0 }, { IDX_2C('l','t'), "Lituani", 0,0,0 }, { IDX_2C('l','u'), "Luksemburg", 0,0,0 }, { IDX_2C('l','v'), "Latvia", 0,0,0 }, { IDX_2C('l','y'), "Libia", 0,0,0 }, { IDX_2C('m','a'), "Marok", 0,0,0 }, { IDX_2C('m','c'), "Monako", 0,0,0 }, { IDX_2C('m','d'), "Moldavi", 0,0,0 }, { IDX_2C('m','e'), "Montenegro", 0,0,0 }, { IDX_2C('m','f'), "Saint Martin (French part)", 0,0,0 }, { IDX_2C('m','g'), "Madagaskar", 0,0,0 }, { IDX_2C('m','h'), "Ishujt Marshall", 0,0,0 }, { IDX_2C('m','k'), "Maqedoni", 0,0,0 }, { IDX_2C('m','l'), "Mali", 0,0,0 }, { IDX_2C('m','m'), "Mianmar", 0,0,0 }, { IDX_2C('m','n'), "Mongoli", 0,0,0 }, { IDX_2C('m','o'), "Makao", 0,0,0 }, { IDX_2C('m','p'), "Ishujt e Marianës Veriore", 0,0,0 }, { IDX_2C('m','q'), "Martinikë", 0,0,0 }, { IDX_2C('m','r'), "Mauritani", 0,0,0 }, { IDX_2C('m','s'), "Montserrat", 0,0,0 }, { IDX_2C('m','t'), "Malta", 0,0,0 }, { IDX_2C('m','u'), "Mauricius", 0,0,0 }, { IDX_2C('m','v'), "Maldive", 0,0,0 }, { IDX_2C('m','w'), "Malaui", 0,0,0 }, { IDX_2C('m','x'), "Meksikë", 0,0,0 }, { IDX_2C('m','y'), "Malajzia", 0,0,0 }, { IDX_2C('m','z'), "Mozambik", 0,0,0 }, { IDX_2C('n','a'), "Namibi", 0,0,0 }, { IDX_2C('n','c'), "Kaledonia e Re", 0,0,0 }, { IDX_2C('n','e'), "Niger", 0,0,0 }, { IDX_2C('n','f'), "Ishulli Norfolk", 0,0,0 }, { IDX_2C('n','g'), "Nigeria", 0,0,0 }, { IDX_2C('n','i'), "Nikaragua", 0,0,0 }, { IDX_2C('n','l'), "Holandë", 0,0,0 }, { IDX_2C('n','o'), "Norvegji", 0,0,0 }, { IDX_2C('n','p'), "Nepal", 0,0,0 }, { IDX_2C('n','r'), "Nauru", 0,0,0 }, { IDX_2C('n','u'), "Niue", 0,0,0 }, { IDX_2C('n','z'), "Zelandë e Re", 0,0,0 }, { IDX_2C('o','m'), "Oman", 0,0,0 }, { IDX_2C('p','a'), "Panama", 0,0,0 }, { IDX_2C('p','e'), "Peru", 0,0,0 }, { IDX_2C('p','f'), "Polinezia Franceze", 0,0,0 }, { IDX_2C('p','g'), "Papua New Guinea", 0,0,0 }, { IDX_2C('p','h'), "Filipine", 0,0,0 }, { IDX_2C('p','k'), "Pakistan", 0,0,0 }, { IDX_2C('p','l'), "Poloni", 0,0,0 }, { IDX_2C('p','m'), "St. Pier dhe Mikelon", 0,0,0 }, { IDX_2C('p','n'), "Pitkern", 0,0,0 }, { IDX_2C('p','r'), "Porto Riko", 0,0,0 }, { IDX_2C('p','s'), "Palestinian Territory, Occupied", 0,0,0 }, { IDX_2C('p','t'), "Portugali", 0,0,0 }, { IDX_2C('p','w'), "Palau", 0,0,0 }, { IDX_2C('p','y'), "Paraguaj", 0,0,0 }, { IDX_2C('q','a'), "Katar", 0,0,0 }, { IDX_2C('r','e'), "Reunion", 0,0,0 }, { IDX_2C('r','o'), "Rumani", 0,0,0 }, { IDX_2C('r','s'), "Serbia", 0,0,0 }, { IDX_2C('r','u'), "Federata Ruse", 0,0,0 }, { IDX_2C('r','w'), "Ruanda", 0,0,0 }, { IDX_2C('s','a'), "Arabia Saudite", 0,0,0 }, { IDX_2C('s','b'), "Ishujt Solomon", 0,0,0 }, { IDX_2C('s','c'), "Sejshelle", 0,0,0 }, { IDX_2C('s','d'), "Sudan", 0,0,0 }, { IDX_2C('s','e'), "Suedi", 0,0,0 }, { IDX_2C('s','g'), "Singapor", 0,0,0 }, { IDX_2C('s','h'), "St. Helena", 0,0,0 }, { IDX_2C('s','i'), "Sloveni", 0,0,0 }, { IDX_2C('s','j'), "Ishujt Svalbard dhe Jan Mayen", 0,0,0 }, { IDX_2C('s','k'), "Republika Slovake", 0,0,0 }, { IDX_2C('s','l'), "Sierra Leone", 0,0,0 }, { IDX_2C('s','m'), "San Marino", 0,0,0 }, { IDX_2C('s','n'), "Senegal", 0,0,0 }, { IDX_2C('s','o'), "Somali", 0,0,0 }, { IDX_2C('s','r'), "Surinam", 0,0,0 }, { IDX_2C('s','t'), "Sao Tome dhe Principe", 0,0,0 }, { IDX_2C('s','u'), "USSR (të dikurshëm)", 0,0,0 }, { IDX_2C('s','v'), "Salvador", 0,0,0 }, { IDX_2C('s','y'), "Siri", 0,0,0 }, { IDX_2C('s','z'), "Svaziland", 0,0,0 }, { IDX_2C('t','c'), "Ishujt Turq dhe Kaiko", 0,0,0 }, { IDX_2C('t','d'), "Çad", 0,0,0 }, { IDX_2C('t','f'), "Territoret Franceze Jugore", 0,0,0 }, { IDX_2C('t','g'), "Togo", 0,0,0 }, { IDX_2C('t','h'), "Tailandë", 0,0,0 }, { IDX_2C('t','j'), "Taxhikistan", 0,0,0 }, { IDX_2C('t','k'), "Tokelau", 0,0,0 }, { IDX_2C('t','l'), "Timor-Leste", 0,0,0 }, { IDX_2C('t','m'), "Turkmenistan", 0,0,0 }, { IDX_2C('t','n'), "Tunizi", 0,0,0 }, { IDX_2C('t','o'), "Tonga", 0,0,0 }, { IDX_2C('t','p'), "Timori Lindor", 0,0,0 }, { IDX_2C('t','r'), "Turqi", 0,0,0 }, { IDX_2C('t','t'), "Trinidad dhe Tobago", 0,0,0 }, { IDX_2C('t','v'), "Tuvalu", 0,0,0 }, { IDX_2C('t','w'), "Taivan", 0,0,0 }, { IDX_2C('t','z'), "Tanzani", 0,0,0 }, { IDX_2C('u','a'), "Ukrainë", 0,0,0 }, { IDX_2C('u','g'), "Ugandë", 0,0,0 }, { IDX_2C('u','k'), "Mbretëri e Bashkuar", 0,0,0 }, { IDX_2C('u','m'), "Ishujt e Vegjël jashtë US", 0,0,0 }, { IDX_2C('u','s'), "Shtetet e Bashkuar", 0,0,0 }, { IDX_2C('u','y'), "Uruguaj", 0,0,0 }, { IDX_2C('u','z'), "Uzbekistan" , 0,0,0 }, { IDX_2C('v','a'), "Qytet Shteti i Vatikanit (Holy See)", 0,0,0 }, { IDX_2C('v','c'), "Saint Vincent dhe Grenadinet", 0,0,0 }, { IDX_2C('v','e'), "Venezuelë", 0,0,0 }, { IDX_2C('v','g'), "Ishujt Virgjini (Britanikë)", 0,0,0 }, { IDX_2C('v','i'), "Ishujt Virgjini (U.S.)", 0,0,0 }, { IDX_2C('v','n'), "Viet Nam", 0,0,0 }, { IDX_2C('v','u'), "Vanuatu", 0,0,0 }, { IDX_2C('w','f'), "Ishujt Vallis dhe Futuna", 0,0,0 }, { IDX_2C('w','s'), "Samoa", 0,0,0 }, { IDX_2C('y','e'), "Jemen", 0,0,0 }, { IDX_2C('y','t'), "Majote", 0,0,0 }, { IDX_2C('y','u'), "FSMZ", 0,0,0 }, { IDX_2C('z','a'), "Afrikë e Jugut", 0,0,0 }, { IDX_2C('z','m'), "Zambia", 0,0,0 }, { IDX_2C('z','w'), "Zimbabue", 0,0,0 }, { IDX_2C('a','1'), "Anonymous Proxy", 0,0,0 }, { IDX_2C('a','2'), "Satellite Provider", 0,0,0 }, { IDX_2C('o','1'), "Other", 0,0,0 }, { IDX_2C('a','p'), "Asia/Pacific Region", 0,0,0 }, { IDX_3C('l','a','n'), "Local Network (lan)", 0,0,0 }, { 0 , NULL, 0,0,0 }}; ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������webalizer-2.23-05/lang/webalizer_lang.arabic��������������������������������������������������������0000644�0001750�0001750�00000111762�11032527214�017326� 0����������������������������������������������������������������������������������������������������ustar �brad����������������������������brad�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* webalizer_lang.english Webalizer V2.0x Language Support file for English. 15-May-1998 by Bradford L. Barrett (brad@mrunix.net) 31-May-1998 Modified for level 1.1 support (brad@mrunix.net) 23-Jul-1998 Modified for level 1.2 support (brad@mrunix.net) 08-Mar-1999 Updated HTTP 1.1 response codes by Yves Lafon (ylafon@w3.org) 28-Jun-1999 Modified for level 1.3 support (brad@mrunix.net) 16-Feb-2000 Modified for level 2.0 support (brad@mrunix.net) 26-Mar-2008 Updated to current IANA TLDs (brad@mrunix.net) 20-May-2008 Tranlated to Arabic by Mohamed SAAD 26-May-2008 Modified for level 2.2 support (brad@mrunix.net) Language files are named using the following convention: webalizer_lang.LANGUAGE where 'LANGUAGE' is the name of the language the file is translated into (ie: webalizer_lang.russian for russian). Either copy the desired language file to webalizer_lang.h or create a symbolic link, then re-compile. If you translate this file into a different language, please send a copy to brad@mrunix.net. */ /***********************************************************************/ /* DEFINE LANGUAGE NAME here */ /***********************************************************************/ char *language = "Arabic"; char *langcode = "ar"; /***********************************************************************/ /* */ /* Informational messages */ /* */ /* These messages are only displayed while The Webalizer is being run, */ /* usually to the screen, and are not part of the HTML output. */ /* */ /***********************************************************************/ /* these are only used in timing totals */ /* Format: XXX records (XXX ignored, XXX bad) in X.XX seconds */ char *msg_records = "تسجيلات"; char *msg_addresses="عناوين"; char *msg_ignored = "غير مستعملة"; char *msg_bad = "غير سليمة"; char *msg_in = "في"; char *msg_seconds = "ثانية"; /* progress and setup error messages */ char *msg_log_err = "خطء: غير قادر على فتح ملف سجل الوقائع"; char *msg_log_use = "جاري إستعمال ملف سجل الوقائع"; char *msg_dir_err = "خطء غير قادر على الإنتقال إلى الدليل "; char *msg_dir_use = "جاري إنشاء الخرج في"; char *msg_cur_dir = "الدليل الحالي"; char *msg_hostname= "إسم المضيف للتقارير هو"; char *msg_ign_hist= "تجاهل ملف السجل الزمني السابق ..."; char *msg_no_hist = "لم أجِد ملف السجل الزمني ..."; char *msg_get_hist= "جاري قراءة ملف السجل الزمني..."; char *msg_put_hist= "جاري حفظ معلومات السجل الزمني ..."; char *msg_hist_err= "خطء: غير قادر على كتابة ملف السجل الزمني"; char *msg_bad_hist= "خطء: تجاهل تسجيل زمني غير صالح"; char *msg_bad_conf= "خطء: غير قادر على فتح ملف الإعداد"; char *msg_bad_key = "تحذير: كلمة بحث غير صاليحة"; char *msg_bad_date= "خطء: قفزة عن التسجيل (التاريخ غير صالح)"; char *msg_ign_nscp= "جاري القفذ عن تسجيل ترويسة Netscape"; char *msg_bad_rec = "قفزة عن تسجيل غير سليم"; char *msg_no_vrec = "لم أجِد تسجيلات صالحة !"; char *msg_gen_rpt = "جاري تكوين التقرير لِ "; char *msg_gen_sum = "جاري تكوين التقرير الموجز"; char *msg_get_data= "جاري قراءة معطيات التنفيذ السابق .."; char *msg_put_data= "جاري حفظ معطيات التنفيذ الحالي ..."; char *msg_no_data = "لم أجِد معطيات التنفيذ السابق ..."; char *msg_bad_data= "خطء: غير قادر على إستعادة معطيات التنفيذ"; char *msg_data_err= "خطء: غير قادر على حفظ معطيات التنفيذ الحالي"; char *msg_dup_data= "تحذير: إحتمال وجود معطيات متكررة مرتين"; /* DNS Stuff */ char *msg_dns_nocf= "No cache file specified, aborting..."; char *msg_dns_nodb= "Error: Unable to open DNS cache file"; char *msg_dns_nolk= "Error: Unable to lock DNS cache file"; char *msg_dns_usec= "Using DNS cache file"; char *msg_dns_rslv= "DNS Lookup"; char *msg_dns_none= "None to process"; char *msg_dns_abrt= "DNS support not present, aborting..."; /* Geolocation stuff */ char *msg_geo_open= "Error opening file"; char *msg_geo_use = "Using"; char *msg_geo_nolu= "lookups disabled"; char *msg_geo_dflt= "default"; /* memory allocation errors */ char *msg_nomem_ts= "Can't allocate enough memory, Top Sites disabled!"; char *msg_nomem_tr= "Can't allocate enough memory, Top Referrers disabled!"; char *msg_nomem_tu= "Can't allocate enough memory, Top URLs disabled!"; char *msg_nomem_tc= "Can't allocate enough memory, Top Countries disabled!"; char *msg_nomem_ta= "Can't allocate enough memory, Top User Agents disabled!"; char *msg_nomem_tsr="Can't allocate enough memory, Top Search Strings disabled!"; char *msg_nomem_ti= "Can't allocate enough memory, Top Usernames disabled!"; char *msg_nomem_dh= "Error adding host node (daily), skipping"; char *msg_nomem_mh= "Error adding host node (monthly), skipping"; char *msg_nomem_u = "Error adding URL node, skipping"; char *msg_nomem_a = "Error adding User Agent node, skipping"; char *msg_nomem_r = "Error adding Referrer node, skipping"; char *msg_nomem_sc= "Error adding Search String Node, skipping"; char *msg_nomem_i = "Error adding Username node, skipping"; /* log record errors */ char *msg_big_rec = "Error: Skipping oversized log record"; char *msg_big_host= "Warning: Truncating oversized hostname"; char *msg_big_date= "Warning: Truncating oversized date field"; char *msg_big_req = "Warning: Truncating oversized request field"; char *msg_big_ref = "Warning: Truncating oversized referrer field"; char *msg_big_user= "Warning: Truncating oversized username"; char *msg_big_one = "Warning: String exceeds storage size"; /* misc errors */ char *msg_no_open = "Error: Unable to open file"; /* Help display... */ char *h_usage1 = "Usage"; char *h_usage2 = "[options] [log file]"; char *h_msg[]= { "-h = print this help message" , "-V = print version information" , "-v = be verbose" , "-d = print additional debug info" , "-F type = Log type. type= (clf | ftp | squid | w3c)", "-f = Fold sequence errors" , "-i = ignore history file" , "-p = preserve state (incremental)" , "-b = ignore state (incremental)" , "-q = supress informational messages" , "-Q = supress _ALL_ messages" , "-Y = supress country graph" , "-G = supress hourly graph" , "-H = supress hourly stats" , "-L = supress color coded graph legends" , "-l num = use num background lines on graph" , "-m num = Visit timout value (seconds)" , "-T = print timing information" , "-c file = use configuration file 'file'" , "-n name = hostname to use" , "-o dir = output directory to use" , "-t name = report title 'name'" , "-a name = hide user agent 'name'" , "-r name = hide referrer 'name'" , "-s name = hide site 'name'" , "-u name = hide URL 'name'" , "-x name = Use filename extension 'name'" , "-O name = Omit page 'name'" , "-P name = Page type extension 'name'" , "-I name = Index alias 'name'" , "-K num = num months in summary table" , "-k num = num months in summary graph" , "-A num = Display num top agents" , "-C num = Display num top countries" , "-R num = Display num top referrers" , "-S num = Display num top sites" , "-U num = Display num top URLs" , "-e num = Display num top Entry Pages" , "-E num = Display num top Exit Pages" , "-g num = Group Domains to 'num' levels" , "-X = Hide individual sites" , "-z dir = Use country flags in 'dir'" , #ifdef USE_DNS "-D name = Use DNS Cache file 'name'" , "-N num = Number of DNS processes (0=disable)" , "-j = Enable native GeoDB lookups" , "-J name = Use GeoDB database 'name'" , #endif #ifdef USE_GEOIP "-w = Enable GeoIP lookups" , "-W name = Use GeoIP database 'name'" , #endif NULL}; /***********************************************************************/ /* */ /* HTML strings */ /* */ /* These strings are used as part of the HTML output generated by The */ /* Webalizer. */ /* */ /***********************************************************************/ /* header strings */ char *msg_hhdr_sp = "فترة الموجز"; char *msg_hhdr_gt = "تمّ الإنشاء"; /* main index strings */ char *msg_main_us = "ملخص الإستعمال لِ "; /* char *msg_main_per= "الأشهر الإثني عشر السابقة"; */ char *msg_main_per= "الملخص حسب الشهر"; char *msg_main_sum= "الملخص حسب الشهر"; char *msg_main_da = "المعدل اليومي"; char *msg_main_mt = "المجموعات الشهرية"; /* month HTML page strings */ char *msg_hmth_du = "الإستعمال اليومي لِ "; char *msg_hmth_hu = "الإستعمال حسب الساعة لِ "; /* table header strings */ char *msg_h_by = "حسب"; char *msg_h_avg = "المعدل"; char *msg_h_max = "الأقصى"; char *msg_h_total = "المجموع"; char *msg_h_totals= "المجموعات"; char *msg_h_day = "اليوم"; char *msg_h_mth = "الشهر"; char *msg_h_hour = "الساعة"; char *msg_h_hits = "الإصابات"; char *msg_h_pages = "الصفحات"; char *msg_h_visits= "الزيارات"; char *msg_h_files = "الملفات"; char *msg_h_sites = "المواقع"; char *msg_h_xfer = "كيلو بايت"; char *msg_h_hname = "إسم المضيف"; char *msg_h_url = "عنوان المورد المنتظم URL"; char *msg_h_agent = "عميل المستخدم"; char *msg_h_ref = "المحوّل"; char *msg_h_ctry = "البلد"; char *msg_h_search= "جملة البحث"; char *msg_h_uname = "إسم المستخدم"; /* links along top of page */ char *msg_hlnk_ds = "الإحصاءات اليومية"; char *msg_hlnk_hs = "الإحصاءات حسب الساعة"; char *msg_hlnk_u = "عناوين الموارد المنتظمة URLs"; char *msg_hlnk_s = "المواقع"; char *msg_hlnk_a = "العملاء"; char *msg_hlnk_c = "البلاد"; char *msg_hlnk_r = "المحوّلون"; char *msg_hlnk_en = "الدخول"; char *msg_hlnk_ex = "الخروج"; char *msg_hlnk_sr = "البحث"; char *msg_hlnk_i = "المستخدمون"; /* monthly total table */ char *msg_mtot_ms = "الإحصاءات الشهرية لِ "; char *msg_mtot_th = "مجموع الإصابات"; char *msg_mtot_tf = "مجموع الملفات"; char *msg_mtot_tx = "مجموع الكيلو بايت"; char *msg_mtot_us = "مجموع المواقع المنفردة"; char *msg_mtot_ur = "مجموع المحولين المنفردة"; char *msg_mtot_ua = "مجموع عملاء المستخدمين المنفردة"; char *msg_mtot_uu = "مجموع عناوين الموارد المنتظمة المنفردة"; char *msg_mtot_ui = "مجموع أسماء المستخدمين المنفردة"; char *msg_mtot_mhd= "الإصابات حسب اليوم"; char *msg_mtot_mhh= "الإصابات حسب الساعة"; char *msg_mtot_mfd= "الملفات حسب اليوم"; char *msg_mtot_mpd= "الصفحات حسب اليوم"; char *msg_mtot_msd= "المواقع حسب اليوم"; char *msg_mtot_mvd= "الزيارات حسب اليوم"; char *msg_mtot_mkd= "كيلو بايت في اليوم"; char *msg_mtot_rc = "الإصابات حسب رمز الإجابة"; /* daily total table */ char *msg_dtot_ds = "الإحصاءات اليومية لِ "; /* hourly total table */ char *msg_htot_hs = "الإحصاءات حسب الساعة لِ "; /* country pie chart */ char *msg_ctry_use= "الإستعمال حسب البلد لِ "; /* top tables */ /* Formatted as "Top xxx of xxx Total something" */ char *msg_top_top = "الأعلى"; char *msg_top_of = "من اصل"; char *msg_top_s = "مجموع المواقع"; char *msg_top_u = "مجموع عناوين الموارد المنتظمة URLs"; char *msg_top_r = "مجموع المحولين"; char *msg_top_a = "مجموع عملاء المستخدمين"; char *msg_top_c = "مجموع البلاد"; char *msg_top_en = "مجموع صفحات الدخول"; char *msg_top_ex = "مجوع صفحات الخروج"; char *msg_top_sr = "مجموع مفردات البحث"; char *msg_top_i = "مجموع أسماء المستخدمين"; char *msg_v_sites = "راجع كل المواقع"; char *msg_v_urls = "راجع كل عناوين الموارد المنتظمة"; char *msg_v_refs = "راجع كل المحولون"; char *msg_v_agents= "راجع كل عملاء المستخدمين"; char *msg_v_search= "راجع كل مفردات البحث"; char *msg_v_users = "راجع كل أسماء المستخدمين"; /* short month names MUST BE 3 CHARS in size... pad if needed*/ char *s_month[12]={ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"}; /* long month names - can be any length */ char *l_month[12]={ "January", "February", "March", "April", "May", "June", "July", "August", "September","October", "November","December"}; /* response code descriptions... order IS important! */ struct response_code response[] = { { "Undefined response code", 0 }, { "Code 100 - Continue", 0 }, { "Code 101 - Switching Protocols", 0 }, { "Code 200 - OK", 0 }, { "Code 201 - Created", 0 }, { "Code 202 - Accepted", 0 }, { "Code 203 - Non-Authoritative Information", 0 }, { "Code 204 - No Content", 0 }, { "Code 205 - Reset Content", 0 }, { "Code 206 - Partial Content", 0 }, { "Code 300 - Multiple Choices", 0 }, { "Code 301 - Moved Permanently", 0 }, { "Code 302 - Found", 0 }, { "Code 303 - See Other", 0 }, { "Code 304 - Not Modified", 0 }, { "Code 305 - Use Proxy", 0 }, { "Code 307 - Moved Temporarily", 0 }, { "Code 400 - Bad Request", 0 }, { "Code 401 - Unauthorized", 0 }, { "Code 402 - Payment Required", 0 }, { "Code 403 - Forbidden", 0 }, { "Code 404 - Not Found", 0 }, { "Code 405 - Method Not Allowed", 0 }, { "Code 406 - Not Acceptable", 0 }, { "Code 407 - Proxy Authentication Required", 0 }, { "Code 408 - Request Timeout", 0 }, { "Code 409 - Conflict", 0 }, { "Code 410 - Gone", 0 }, { "Code 411 - Length Required", 0 }, { "Code 412 - Precondition Failed", 0 }, { "Code 413 - Request Entity Too Large", 0 }, { "Code 414 - Request-URI Too Long", 0 }, { "Code 415 - Unsupported Media Type", 0 }, { "Code 416 - Requested Range Not Satisfiable", 0 }, { "Code 417 - Expectation Failed", 0 }, { "Code 500 - Internal Server Error", 0 }, { "Code 501 - Not Implemented", 0 }, { "Code 502 - Bad Gateway", 0 }, { "Code 503 - Service Unavailable", 0 }, { "Code 504 - Gateway Timeout", 0 }, { "Code 505 - HTTP Version Not Supported", 0 } }; char *msg_title = "Usage Statistics for"; char *msg_h_other = "Other"; /* Country codes (previously in ctry.h header file) */ struct country_code ctry[] = { { 0, "Unresolved/Unknown", 0,0,0 }, { IDX_3C('c','o','m'), "Commercial (com)", 0,0,0 }, { IDX_3C('e','d','u'), "Educational (edu)", 0,0,0 }, { IDX_3C('g','o','v'), "US Government (gov)", 0,0,0 }, { IDX_3C('i','n','t'), "International (int)", 0,0,0 }, { IDX_3C('m','i','l'), "US Military (mil)", 0,0,0 }, { IDX_3C('n','e','t'), "Network (net)", 0,0,0 }, { IDX_3C('o','r','g'), "Non-Profit (org)", 0,0,0 }, { IDX_3C('b','i','z'), "Generic Business (biz)", 0,0,0 }, { IDX_3C('c','a','t'), "Catalan Community (cat)", 0,0,0 }, { IDX_3C('p','r','o'), "Professional (pro)", 0,0,0 }, { IDX_3C('t','e','l'), "Ind. Contact Data (tel)", 0,0,0 }, { IDX_4C('a','e','r','o'),"Air Transport Industry (aero)", 0,0,0 }, { IDX_4C('a','s','i','a'),"Asia Pacific Community (asia)", 0,0,0 }, { IDX_4C('c','o','o','p'),"Cooperative Association (coop)", 0,0,0 }, { IDX_4C('i','n','f','o'),"Generic TLD (info)", 0,0,0 }, { IDX_4C('j','o','b','s'),"Human Resources (jobs)", 0,0,0 }, { IDX_4C('m','o','b','i'),"Generic Mobile TLD (mobi)", 0,0,0 }, { IDX_4C('n','a','m','e'),"Individual (name)", 0,0,0 }, { IDX_4C('a','r','p','a'),"Address Routing (arpa)", 0,0,0 }, { IDX_4C('n','a','t','o'),"Nato field (nato)", 0,0,0 }, { IDX_6C('m','u','s','e','u','m'), "Museums (museum)", 0,0,0 }, { IDX_6C('t','r','a','v','e','l'), "Travel Ind. (travel)", 0,0,0 }, { IDX_2C('a','c'), "Ascension Island", 0,0,0 }, { IDX_2C('a','d'), "Andorra", 0,0,0 }, { IDX_2C('a','e'), "United Arab Emirates", 0,0,0 }, { IDX_2C('a','f'), "Afghanistan", 0,0,0 }, { IDX_2C('a','g'), "Antigua and Barbuda", 0,0,0 }, { IDX_2C('a','i'), "Anguilla", 0,0,0 }, { IDX_2C('a','l'), "Albania", 0,0,0 }, { IDX_2C('a','m'), "Armenia", 0,0,0 }, { IDX_2C('a','n'), "Netherlands Antilles", 0,0,0 }, { IDX_2C('a','o'), "Angola", 0,0,0 }, { IDX_2C('a','q'), "Antarctica", 0,0,0 }, { IDX_2C('a','r'), "Argentina", 0,0,0 }, { IDX_2C('a','s'), "American Samoa", 0,0,0 }, { IDX_2C('a','t'), "Austria", 0,0,0 }, { IDX_2C('a','u'), "Australia", 0,0,0 }, { IDX_2C('a','w'), "Aruba", 0,0,0 }, { IDX_2C('a','x'), "Aland Islands", 0,0,0 }, { IDX_2C('a','z'), "Azerbaijan", 0,0,0 }, { IDX_2C('b','a'), "Bosnia and Herzegovina", 0,0,0 }, { IDX_2C('b','b'), "Barbados", 0,0,0 }, { IDX_2C('b','d'), "Bangladesh", 0,0,0 }, { IDX_2C('b','e'), "Belgium", 0,0,0 }, { IDX_2C('b','f'), "Burkina Faso", 0,0,0 }, { IDX_2C('b','g'), "Bulgaria", 0,0,0 }, { IDX_2C('b','h'), "Bahrain", 0,0,0 }, { IDX_2C('b','i'), "Burundi", 0,0,0 }, { IDX_2C('b','j'), "Benin", 0,0,0 }, { IDX_2C('b','l'), "Saint Barthelemy", 0,0,0 }, { IDX_2C('b','m'), "Bermuda", 0,0,0 }, { IDX_2C('b','n'), "Brunei Darussalam", 0,0,0 }, { IDX_2C('b','o'), "Bolivia", 0,0,0 }, { IDX_2C('b','r'), "Brazil", 0,0,0 }, { IDX_2C('b','s'), "Bahamas", 0,0,0 }, { IDX_2C('b','t'), "Bhutan", 0,0,0 }, { IDX_2C('b','v'), "Bouvet Island", 0,0,0 }, { IDX_2C('b','w'), "Botswana", 0,0,0 }, { IDX_2C('b','y'), "Belarus", 0,0,0 }, { IDX_2C('b','z'), "Belize", 0,0,0 }, { IDX_2C('c','a'), "Canada", 0,0,0 }, { IDX_2C('c','c'), "Cocos (Keeling) Islands", 0,0,0 }, { IDX_2C('c','d'), "Congo, Democratic Republic", 0,0,0 }, { IDX_2C('c','f'), "Central African Republic", 0,0,0 }, { IDX_2C('c','g'), "Congo", 0,0,0 }, { IDX_2C('c','h'), "Switzerland", 0,0,0 }, { IDX_2C('c','i'), "Cote D'Ivoire (Ivory Coast)", 0,0,0 }, { IDX_2C('c','k'), "Cook Islands", 0,0,0 }, { IDX_2C('c','l'), "Chile", 0,0,0 }, { IDX_2C('c','m'), "Cameroon", 0,0,0 }, { IDX_2C('c','n'), "China", 0,0,0 }, { IDX_2C('c','o'), "Colombia", 0,0,0 }, { IDX_2C('c','r'), "Costa Rica", 0,0,0 }, { IDX_2C('c','u'), "Cuba", 0,0,0 }, { IDX_2C('c','v'), "Cape Verde", 0,0,0 }, { IDX_2C('c','x'), "Christmas Island", 0,0,0 }, { IDX_2C('c','y'), "Cyprus", 0,0,0 }, { IDX_2C('c','z'), "Czech Republic", 0,0,0 }, { IDX_2C('d','e'), "Germany", 0,0,0 }, { IDX_2C('d','j'), "Djibouti", 0,0,0 }, { IDX_2C('d','k'), "Denmark", 0,0,0 }, { IDX_2C('d','m'), "Dominica", 0,0,0 }, { IDX_2C('d','o'), "Dominican Republic", 0,0,0 }, { IDX_2C('d','z'), "Algeria", 0,0,0 }, { IDX_2C('e','c'), "Ecuador", 0,0,0 }, { IDX_2C('e','e'), "Estonia", 0,0,0 }, { IDX_2C('e','g'), "Egypt", 0,0,0 }, { IDX_2C('e','h'), "Western Sahara", 0,0,0 }, { IDX_2C('e','r'), "Eritrea", 0,0,0 }, { IDX_2C('e','s'), "Spain", 0,0,0 }, { IDX_2C('e','t'), "Ethiopia", 0,0,0 }, { IDX_2C('e','u'), "European Union", 0,0,0 }, { IDX_2C('f','i'), "Finland", 0,0,0 }, { IDX_2C('f','j'), "Fiji", 0,0,0 }, { IDX_2C('f','k'), "Falkland Islands (Malvinas)", 0,0,0 }, { IDX_2C('f','m'), "Micronesia", 0,0,0 }, { IDX_2C('f','o'), "Faroe Islands", 0,0,0 }, { IDX_2C('f','r'), "France", 0,0,0 }, { IDX_2C('g','a'), "Gabon", 0,0,0 }, { IDX_2C('g','b'), "Great Britain (UK)", 0,0,0 }, { IDX_2C('g','d'), "Grenada", 0,0,0 }, { IDX_2C('g','e'), "Georgia", 0,0,0 }, { IDX_2C('g','f'), "French Guiana", 0,0,0 }, { IDX_2C('g','g'), "Guernsey", 0,0,0 }, { IDX_2C('g','h'), "Ghana", 0,0,0 }, { IDX_2C('g','i'), "Gibraltar", 0,0,0 }, { IDX_2C('g','l'), "Greenland", 0,0,0 }, { IDX_2C('g','m'), "Gambia", 0,0,0 }, { IDX_2C('g','n'), "Guinea", 0,0,0 }, { IDX_2C('g','p'), "Guadeloupe", 0,0,0 }, { IDX_2C('g','q'), "Equatorial Guinea", 0,0,0 }, { IDX_2C('g','r'), "Greece", 0,0,0 }, { IDX_2C('g','s'), "S. Georgia and S. Sandwich Isls.", 0,0,0 }, { IDX_2C('g','t'), "Guatemala", 0,0,0 }, { IDX_2C('g','u'), "Guam", 0,0,0 }, { IDX_2C('g','w'), "Guinea-Bissau", 0,0,0 }, { IDX_2C('g','y'), "Guyana", 0,0,0 }, { IDX_2C('h','k'), "Hong Kong", 0,0,0 }, { IDX_2C('h','m'), "Heard and McDonald Islands", 0,0,0 }, { IDX_2C('h','n'), "Honduras", 0,0,0 }, { IDX_2C('h','r'), "Croatia", 0,0,0 }, { IDX_2C('h','t'), "Haiti", 0,0,0 }, { IDX_2C('h','u'), "Hungary", 0,0,0 }, { IDX_2C('i','d'), "Indonesia", 0,0,0 }, { IDX_2C('i','e'), "Ireland", 0,0,0 }, { IDX_2C('i','l'), "Israel", 0,0,0 }, { IDX_2C('i','m'), "Isle of Man", 0,0,0 }, { IDX_2C('i','n'), "India", 0,0,0 }, { IDX_2C('i','o'), "British Indian Ocean Territory", 0,0,0 }, { IDX_2C('i','q'), "Iraq", 0,0,0 }, { IDX_2C('i','r'), "Iran", 0,0,0 }, { IDX_2C('i','s'), "Iceland", 0,0,0 }, { IDX_2C('i','t'), "Italy", 0,0,0 }, { IDX_2C('j','e'), "Jersey", 0,0,0 }, { IDX_2C('j','m'), "Jamaica", 0,0,0 }, { IDX_2C('j','o'), "Jordan", 0,0,0 }, { IDX_2C('j','p'), "Japan", 0,0,0 }, { IDX_2C('k','e'), "Kenya", 0,0,0 }, { IDX_2C('k','g'), "Kyrgyzstan", 0,0,0 }, { IDX_2C('k','h'), "Cambodia", 0,0,0 }, { IDX_2C('k','i'), "Kiribati", 0,0,0 }, { IDX_2C('k','m'), "Comoros", 0,0,0 }, { IDX_2C('k','n'), "Saint Kitts and Nevis", 0,0,0 }, { IDX_2C('k','p'), "Korea, Democratic Republic of", 0,0,0 }, { IDX_2C('k','r'), "Korea, Republic of", 0,0,0 }, { IDX_2C('k','w'), "Kuwait", 0,0,0 }, { IDX_2C('k','y'), "Cayman Islands", 0,0,0 }, { IDX_2C('k','z'), "Kazakhstan", 0,0,0 }, { IDX_2C('l','a'), "Laos", 0,0,0 }, { IDX_2C('l','b'), "Lebanon", 0,0,0 }, { IDX_2C('l','c'), "Saint Lucia", 0,0,0 }, { IDX_2C('l','i'), "Liechtenstein", 0,0,0 }, { IDX_2C('l','k'), "Sri Lanka", 0,0,0 }, { IDX_2C('l','r'), "Liberia", 0,0,0 }, { IDX_2C('l','s'), "Lesotho", 0,0,0 }, { IDX_2C('l','t'), "Lithuania", 0,0,0 }, { IDX_2C('l','u'), "Luxembourg", 0,0,0 }, { IDX_2C('l','v'), "Latvia", 0,0,0 }, { IDX_2C('l','y'), "Libya", 0,0,0 }, { IDX_2C('m','a'), "Morocco", 0,0,0 }, { IDX_2C('m','c'), "Monaco", 0,0,0 }, { IDX_2C('m','d'), "Moldova", 0,0,0 }, { IDX_2C('m','e'), "Montenegro", 0,0,0 }, { IDX_2C('m','f'), "Saint Martin (French part)", 0,0,0 }, { IDX_2C('m','g'), "Madagascar", 0,0,0 }, { IDX_2C('m','h'), "Marshall Islands", 0,0,0 }, { IDX_2C('m','k'), "Macedonia", 0,0,0 }, { IDX_2C('m','l'), "Mali", 0,0,0 }, { IDX_2C('m','m'), "Myanmar", 0,0,0 }, { IDX_2C('m','n'), "Mongolia", 0,0,0 }, { IDX_2C('m','o'), "Macau", 0,0,0 }, { IDX_2C('m','p'), "Northern Mariana Islands", 0,0,0 }, { IDX_2C('m','q'), "Martinique", 0,0,0 }, { IDX_2C('m','r'), "Mauritania", 0,0,0 }, { IDX_2C('m','s'), "Montserrat", 0,0,0 }, { IDX_2C('m','t'), "Malta", 0,0,0 }, { IDX_2C('m','u'), "Mauritius", 0,0,0 }, { IDX_2C('m','v'), "Maldives", 0,0,0 }, { IDX_2C('m','w'), "Malawi", 0,0,0 }, { IDX_2C('m','x'), "Mexico", 0,0,0 }, { IDX_2C('m','y'), "Malaysia", 0,0,0 }, { IDX_2C('m','z'), "Mozambique", 0,0,0 }, { IDX_2C('n','a'), "Namibia", 0,0,0 }, { IDX_2C('n','c'), "New Caledonia", 0,0,0 }, { IDX_2C('n','e'), "Niger", 0,0,0 }, { IDX_2C('n','f'), "Norfolk Island", 0,0,0 }, { IDX_2C('n','g'), "Nigeria", 0,0,0 }, { IDX_2C('n','i'), "Nicaragua", 0,0,0 }, { IDX_2C('n','l'), "Netherlands", 0,0,0 }, { IDX_2C('n','o'), "Norway", 0,0,0 }, { IDX_2C('n','p'), "Nepal", 0,0,0 }, { IDX_2C('n','r'), "Nauru", 0,0,0 }, { IDX_2C('n','u'), "Niue", 0,0,0 }, { IDX_2C('n','z'), "New Zealand", 0,0,0 }, { IDX_2C('o','m'), "Oman", 0,0,0 }, { IDX_2C('p','a'), "Panama", 0,0,0 }, { IDX_2C('p','e'), "Peru", 0,0,0 }, { IDX_2C('p','f'), "French Polynesia", 0,0,0 }, { IDX_2C('p','g'), "Papua New Guinea", 0,0,0 }, { IDX_2C('p','h'), "Philippines", 0,0,0 }, { IDX_2C('p','k'), "Pakistan", 0,0,0 }, { IDX_2C('p','l'), "Poland", 0,0,0 }, { IDX_2C('p','m'), "St. Pierre and Miquelon", 0,0,0 }, { IDX_2C('p','n'), "Pitcairn", 0,0,0 }, { IDX_2C('p','r'), "Puerto Rico", 0,0,0 }, { IDX_2C('p','s'), "Palestinian Territory, Occupied", 0,0,0 }, { IDX_2C('p','t'), "Portugal", 0,0,0 }, { IDX_2C('p','w'), "Palau", 0,0,0 }, { IDX_2C('p','y'), "Paraguay", 0,0,0 }, { IDX_2C('q','a'), "Qatar", 0,0,0 }, { IDX_2C('r','e'), "Reunion", 0,0,0 }, { IDX_2C('r','o'), "Romania", 0,0,0 }, { IDX_2C('r','s'), "Serbia", 0,0,0 }, { IDX_2C('r','u'), "Russian Federation", 0,0,0 }, { IDX_2C('r','w'), "Rwanda", 0,0,0 }, { IDX_2C('s','a'), "Saudi Arabia", 0,0,0 }, { IDX_2C('s','b'), "Solomon Islands", 0,0,0 }, { IDX_2C('s','c'), "Seychelles", 0,0,0 }, { IDX_2C('s','d'), "Sudan", 0,0,0 }, { IDX_2C('s','e'), "Sweden", 0,0,0 }, { IDX_2C('s','g'), "Singapore", 0,0,0 }, { IDX_2C('s','h'), "St. Helena", 0,0,0 }, { IDX_2C('s','i'), "Slovenia", 0,0,0 }, { IDX_2C('s','j'), "Svalbard and Jan Mayen Islands", 0,0,0 }, { IDX_2C('s','k'), "Slovakia", 0,0,0 }, { IDX_2C('s','l'), "Sierra Leone", 0,0,0 }, { IDX_2C('s','m'), "San Marino", 0,0,0 }, { IDX_2C('s','n'), "Senegal", 0,0,0 }, { IDX_2C('s','o'), "Somalia", 0,0,0 }, { IDX_2C('s','r'), "Suriname", 0,0,0 }, { IDX_2C('s','t'), "Sao Tome and Principe", 0,0,0 }, { IDX_2C('s','u'), "Soviet Union", 0,0,0 }, { IDX_2C('s','v'), "El Salvador", 0,0,0 }, { IDX_2C('s','y'), "Syrian Arab Republic", 0,0,0 }, { IDX_2C('s','z'), "Swaziland", 0,0,0 }, { IDX_2C('t','c'), "Turks and Caicos Islands", 0,0,0 }, { IDX_2C('t','d'), "Chad", 0,0,0 }, { IDX_2C('t','f'), "French Southern Territories", 0,0,0 }, { IDX_2C('t','g'), "Togo", 0,0,0 }, { IDX_2C('t','h'), "Thailand", 0,0,0 }, { IDX_2C('t','j'), "Tajikistan", 0,0,0 }, { IDX_2C('t','k'), "Tokelau", 0,0,0 }, { IDX_2C('t','l'), "Timor-Leste", 0,0,0 }, { IDX_2C('t','m'), "Turkmenistan", 0,0,0 }, { IDX_2C('t','n'), "Tunisia", 0,0,0 }, { IDX_2C('t','o'), "Tonga", 0,0,0 }, { IDX_2C('t','p'), "Portuguese Timor", 0,0,0 }, { IDX_2C('t','r'), "Turkey", 0,0,0 }, { IDX_2C('t','t'), "Trinidad and Tobago", 0,0,0 }, { IDX_2C('t','v'), "Tuvalu", 0,0,0 }, { IDX_2C('t','w'), "Taiwan", 0,0,0 }, { IDX_2C('t','z'), "Tanzania", 0,0,0 }, { IDX_2C('u','a'), "Ukraine", 0,0,0 }, { IDX_2C('u','g'), "Uganda", 0,0,0 }, { IDX_2C('u','k'), "United Kingdom", 0,0,0 }, { IDX_2C('u','m'), "US Minor Outlying Islands", 0,0,0 }, { IDX_2C('u','s'), "United States", 0,0,0 }, { IDX_2C('u','y'), "Uruguay", 0,0,0 }, { IDX_2C('u','z'), "Uzbekistan", 0,0,0 }, { IDX_2C('v','a'), "Vatican City State (Holy See)", 0,0,0 }, { IDX_2C('v','c'), "Saint Vincent and the Grenadines", 0,0,0 }, { IDX_2C('v','e'), "Venezuela", 0,0,0 }, { IDX_2C('v','g'), "Virgin Islands (British)", 0,0,0 }, { IDX_2C('v','i'), "Virgin Islands (U.S.)", 0,0,0 }, { IDX_2C('v','n'), "Viet Nam", 0,0,0 }, { IDX_2C('v','u'), "Vanuatu", 0,0,0 }, { IDX_2C('w','f'), "Wallis and Futuna Islands", 0,0,0 }, { IDX_2C('w','s'), "Samoa", 0,0,0 }, { IDX_2C('y','e'), "Yemen", 0,0,0 }, { IDX_2C('y','t'), "Mayotte", 0,0,0 }, { IDX_2C('y','u'), "Yugoslavia", 0,0,0 }, { IDX_2C('z','a'), "South Africa", 0,0,0 }, { IDX_2C('z','m'), "Zambia", 0,0,0 }, { IDX_2C('z','w'), "Zimbabwe", 0,0,0 }, { IDX_2C('a','1'), "Anonymous Proxy", 0,0,0 }, { IDX_2C('a','2'), "Satellite Provider", 0,0,0 }, { IDX_2C('o','1'), "Other", 0,0,0 }, { IDX_2C('a','p'), "Asia/Pacific Region", 0,0,0 }, { IDX_3C('l','a','n'), "Local Network (lan)", 0,0,0 }, { 0 , NULL, 0,0,0 }}; ��������������webalizer-2.23-05/lang/webalizer_lang.catalan�������������������������������������������������������0000644�0001750�0001750�00000111427�11551755704�017523� 0����������������������������������������������������������������������������������������������������ustar �brad����������������������������brad�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* webalizer_lang.catalan Webalizer V2.0x Language Support file for Catalan. 31-May-1998 Modified for level 1.1 support (brad@mrunix.net) 23-Jul-1998 Modified for level 1.2 support (brad@mrunix.net) 19-Aug-1998 Translated by Jordi Bruguera (jordi@t800.grn.es) 21-Sep-1998 Additional corrections by Jordi Bruguera (jordi@t800.grn.es) 08-Mar-1999 Updated HTTP 1.1 response codes by Yves Lafon (ylafon@w3.org) 28-Jun-1999 Modified for level 1.3 support (brad@mrunix.net) 05-Jul-1999 Additional corrections by Jordi Bruguera (jordi@t800.grn.es) 22-Feb-2000 Modified for level 2.0 support (brad@mrunix.net) 18-Oct-2000 Translated new strings for version 2.01-06 (jordi@t800.grn.es) 26-Mar-2008 Updated to current IANA TLDs (brad@mrunix.net) 26-May-2008 Modified for level 2.2 support (brad@mrunix.net) 16-Jan-2011 Adapted to Softcatal style by Jordi Mallach (jordi@debian.org) Language files are named using the following convention: webalizer_lang.LANGUAGE where 'LANGUAGE' is the name of the language the file is translated into (ie: webalizer_lang.russian for russian). Either copy the desired language file to webalizer_lang.h or create a symbolic link, then re-compile. If you translate this file into a different language, please send a copy to brad@mrunix.net. */ /***********************************************************************/ /* DEFINE LANGUAGE NAME here */ /***********************************************************************/ char *language = "Catal"; char *langcode = "ca"; /***********************************************************************/ /* */ /* Informational messages */ /* */ /* These messages are only displayed while The Webalizer is being run, */ /* usually to the screen, and are not part of the HTML output. */ /* */ /***********************************************************************/ /* these are only used in timing totals */ /* Format: XXX records (XXX ignored, XXX bad) in X.XX seconds */ char *msg_records = "registres"; char *msg_addresses="adreces"; char *msg_ignored = "ignorats"; char *msg_bad = "erronis"; char *msg_in = "en"; char *msg_seconds = "segons"; /* progress and setup error messages */ char *msg_log_err = "Error: no s'ha pogut obrir el fitxer de registres"; char *msg_log_use = "S'est emprant el registre"; char *msg_dir_err = "Error: no es pot canviar al directori especificat"; char *msg_dir_use = "S'est creant els resultats a"; char *msg_cur_dir = "el directori actual"; char *msg_hostname= "Informe per al servidor"; char *msg_ign_hist= "S'est ignorant l'historial anterior..."; char *msg_no_hist = "No s'ha trobat el fitxer de l'historial..."; char *msg_get_hist= "S'est llegint el fitxer de l'historial..."; char *msg_put_hist= "S'est desant la informaci de l'historial..."; char *msg_hist_err= "Error: no es pot escriure al fitxer de l'historial"; char *msg_bad_hist= "Error: s'est descartant un registre no vlid"; char *msg_bad_conf= "Error: no es pot obrir el fitxer de configuraci"; char *msg_bad_key = "Avs: la paraula clau no s vlida"; char *msg_bad_date= "Error: s'est ometent el registre (data errnia)"; char *msg_ign_nscp= "S'est ometent el registre de capcalera del Netscape"; char *msg_bad_rec = "S'est ometent un registre erroni"; char *msg_no_vrec = "No s'ha trobat cap registre vlid!"; char *msg_gen_rpt = "S'est generant l'informe per a"; char *msg_gen_sum = "S'est generant l'informe resumit"; char *msg_get_data= "S'estan llegint dades de l'execuci anterior..."; char *msg_put_data= "S'estan desant les dades de l'execuci actual..."; char *msg_no_data = "No s'han trobat les dades de l'execuci anterior..."; char *msg_bad_data= "Error: no es pot recuperar les dades de l'execuci"; char *msg_data_err= "Error: no es poden desar les dades de l'execuci actual"; char *msg_dup_data= "Avs: S'han trobat dades que potser sn duplicades"; /* DNS Stuff */ char *msg_dns_nocf= "No s'ha especificat el fitxer de memria cau, s'est avortant..."; char *msg_dns_nodb= "Error: no es pot obrir el fitxer de memria cau de DNS"; char *msg_dns_nolk= "Error: no es pot blocar el fitxer de memria cau de DNS"; char *msg_dns_usec= "S'est emprant el fitxer de memria cau de DNS"; char *msg_dns_rslv= "Recerca DNS"; char *msg_dns_none= "Cap a processar"; char *msg_dns_abrt= "El suport de DNS no s present, s'est avortant..."; /* Geolocation stuff */ char *msg_geo_open= "S'ha produt un error en obrir el fitxer"; char *msg_geo_use = "S'est emprant"; char *msg_geo_nolu= "consultes inhabilitades"; char *msg_geo_dflt= "predeterminat"; /* memory allocation errors */ char *msg_nomem_ts= "No s'ha pogut assignar prou memria, es desactiva l'opci Llocs principals"; char *msg_nomem_tr= "No s'ha pogut assignar prou memria, es desactiva l'opci Referents principals"; char *msg_nomem_tu= "No s'ha pogut assignar prou memria, es desactiva l'opci URL ms visitades"; char *msg_nomem_tc= "No s'ha pogut assignar prou memria, es desactiva l'opci Pasos d'origen principals"; char *msg_nomem_ta= "No s'ha pogut assignar prou memria, es desactiva l'opci Navegadors principals"; char *msg_nomem_tsr="No s'ha pogut assignar prou memria, es desactiva l'opci Cadenes de recerca principals"; char *msg_nomem_ti= "No s'ha pogut assignar prou memria, es desactiva l'opci Noms d'usuari principals"; char *msg_nomem_dh= "S'ha produt un error en afegir el nom del node (diari), s'est ometent"; char *msg_nomem_mh= "S'ha produt un error en afegir el nom del node (mensual), s'est ometent"; char *msg_nomem_u = "S'ha produt un error en afegir el node de les URL, s'est ometent"; char *msg_nomem_a = "S'ha produt un error en afegir el node dels navegadors, s'est ometent"; char *msg_nomem_r = "S'ha produt un error en afegir el node dels referents, s'est ometent"; char *msg_nomem_sc= "S'ha produt un error en afegir el node de cadenes de recerca, s'est ometent"; char *msg_nomem_i = "S'ha produt un error en afegir el node de noms d'usuari, s'est ometent"; /* registre record errors */ char *msg_big_rec = "Error: S'est ometent una entrada del registre massa gran"; char *msg_big_host= "Avs: S'est truncant el nom del servidor, que s massa gran"; char *msg_big_date= "Avs: S'est truncant el camp de la data, que s massa gran"; char *msg_big_req = "Avs: S'est truncant el camp de la petici, que s massa gran"; char *msg_big_ref = "Avs: S'est truncant el camp de l'enlla d'origen, que s massa gran"; char *msg_big_user= "Avs: S'est truncant un nom d'usuari massa llarg"; char *msg_big_one = "Avs: La cadena supera la mida permesa"; /* misc errors */ char *msg_no_open = "Error: No s'ha pogut obrir el fitxer"; /* Help display... */ char *h_usage1 = "Funcionament"; char *h_usage2 = "[opcions] [fitxer histric (log)]"; char *h_msg[]= { "-h = mostra aquest missatge d'ajuda" , "-V = mostra la versi del programa" , "-v = sigues detallat" , "-d = mostra informaci de depuraci addicional" , "-F tipus = tipus de registre. tipus=(clf | ftp | squid | w3c)", "-f = omet els errors de seqncia" , "-i = descarta el fitxer de l'historial" , "-p = conserva l'estat (incremental)" , "-b = omet l'estat (incremental)" , "-q = suprimeix els missatges informatius" , "-Q = suprimeix TOTS els misatges" , "-Y = suprimeix la grfica de pasos" , "-G = suprimeix la grfica per hores" , "-H = suprimeix les estadstiques per hores" , "-L = suprimeix les llegendes de color dels grfics", "-l num = empra num lnies de fons a la grfica)" , "-m num = valor del temps d'una visita (segons)" , "-T = mostra el temps de la temporitzaci" , "-c fitxer = empra el fitxer de configuraci fitxer" , "-n nom = nom de mquina a emprar" , "-o dir = directori de sortida a emprar" , "-t nom = empra el ttol nom per a l'informe" , "-a nom = amaga la informaci relativa al navegador nom" , "-r nom = amaga la informaci relativa als referents nom", "-s nom = amaga la informaci relativa al lloc nom" , "-u nom = amaga la informaci relativa a les URL visitades nom", "-x nom = empra l'extensi de fitxer nom" , "-O nom = omet la pgina nom" , "-P nom = tipus de l'extensi de la pgina nom" , "-I nom = lias de l'ndex nom" , "-K nm = mostra nm mesos a la taula de resum" , "-k nm = mostra nm mesos a la grfica de resum" , "-A nm = mostra els nm primers navegadors" , "-C nm = mostra els nm primers pasos" , "-R nm = mostra els nm primers referents" , "-S nm = mostra els nm primers servidors" , "-U nm = mostra els nm primers URL" , "-e nm = mostra les nm primeres pgines d'entrada" , "-E nm = mostra les nm primeres pgines de sortida" , "-g nm = agrupa els dominis a nm nivells" , "-X = amaga els llocs individuals" , "-z dir = empra les banderes nacionals de dir" , #ifdef USE_DNS "-D fitxer = empra el fitxer de memria cau de DNS fitxer", "-N num = nombre de processos DNS (0=inhabilita)" , "-j = habilita les cerques GeoDB natives" , "-J nom = empra la base de dades de GeoDB fitxer" , #endif #ifdef USE_GEOIP "-w = habilita les cerques de GeoIP" , "-W nom = empra la base de dades de GeoIP fitxer" , #endif NULL}; #define LAST_HLP_MSG (int)(sizeof(h_msg)/sizeof(char *)) /***********************************************************************/ /* */ /* HTML strings */ /* */ /* These strings are used as part of the HTML output generated by The */ /* Webalizer. */ /* */ /***********************************************************************/ /* header strings */ char *msg_hhdr_sp = "Perode resumit"; char *msg_hhdr_gt = "Generat el"; /* main index strings */ char *msg_main_us = "Resum d'accessos per a"; char *msg_main_per= "Resum per mesos"; char *msg_main_sum= "Resum per mesos"; char *msg_main_da = "Mitjana diria"; char *msg_main_mt = "Totals del mes"; /* month HTML page strings */ char *msg_hmth_du = "s diari per a"; char *msg_hmth_hu = "s horari per a"; /* table header strings */ char *msg_h_by = "Per"; char *msg_h_avg = "Mitjana"; char *msg_h_max = "Mx"; char *msg_h_total = "Total"; char *msg_h_totals= "Totals"; char *msg_h_day = "Dia"; char *msg_h_mth = "Mes"; char *msg_h_hour = "Hora"; char *msg_h_hits = "Accessos"; char *msg_h_pages = "Pgines"; char *msg_h_visits= "Visites"; char *msg_h_files = "Fitxers"; char *msg_h_sites = "Navegadors"; char *msg_h_xfer = "KBytes"; char *msg_h_hname = "Visitant"; char *msg_h_url = "URL"; char *msg_h_agent = "Navegador"; char *msg_h_ref = "Referent"; char *msg_h_ctry = "Pas"; char *msg_h_search= "Cadena de recerca"; char *msg_h_uname = "Nom d'usuari"; /* links along top of page */ char *msg_hlnk_ds = "Estadstiques diries"; char *msg_hlnk_hs = "Estadstiques horries"; char *msg_hlnk_u = "URLs"; char *msg_hlnk_s = "Visitants"; char *msg_hlnk_a = "Navegadors"; char *msg_hlnk_c = "Pasos"; char *msg_hlnk_r = "Referents"; char *msg_hlnk_en = "Entrada"; char *msg_hlnk_ex = "Sortida"; char *msg_hlnk_sr = "Recerca"; char *msg_hlnk_i = "Usuaris"; /* monthly total table */ char *msg_mtot_ms = "Estadstiques mensuals"; char *msg_mtot_th = "Accessos totals"; char *msg_mtot_tf = "Fitxers totals"; char *msg_mtot_tx = "KBytes totals"; char *msg_mtot_us = "Servidors totals"; char *msg_mtot_ur = "Referents totals"; char *msg_mtot_ua = "Navegadors totals"; char *msg_mtot_uu = "URL totals"; char *msg_mtot_ui = "Noms d'usuari totals"; char *msg_mtot_mhd= "Accessos per dia"; char *msg_mtot_mhh= "Accessos per hora"; char *msg_mtot_mfd= "Fitxers per dia"; char *msg_mtot_mpd= "Pgines per dia"; char *msg_mtot_msd= "Servidors per dia"; char *msg_mtot_mvd= "Visites per dia"; char *msg_mtot_mkd= "KBytes per dia"; char *msg_mtot_rc = "Accessos segons codi de resposta"; /* daily total table */ char *msg_dtot_ds = "Estadstiques diries per a"; /* hourly total table */ char *msg_htot_hs = "Estadstiques horries per a"; /* country pie chart */ char *msg_ctry_use= "s per pasos per a"; /* top tables */ /* Formatted as "Top xxx of xxx Total something" */ char *msg_top_top = "Els"; char *msg_top_of = "primers d'un total de"; char *msg_top_s = "visitants"; char *msg_top_u = "URL"; char *msg_top_r = "referents"; char *msg_top_a = "navegadors"; char *msg_top_c = "pasos"; char *msg_top_en = "pgines d'entrada"; char *msg_top_ex = "pgines de sortida"; char *msg_top_sr = "cadenes de recerca"; char *msg_top_i = "noms d'usuari"; char *msg_v_sites = "Mostra tots els llocs visitats"; char *msg_v_urls = "Mostra totes les URL"; char *msg_v_refs = "Mostra tots els referents"; char *msg_v_agents= "Mostra tots els navegadors"; char *msg_v_search= "Mostra totes les cadenes de recerca"; char *msg_v_users = "Mostra tots els noms d'usuari"; /* short month names MUST BE 3 CHARS in size... pad if needed*/ char *s_month[12]={ "gen", "feb", "mar", "abr", "mai", "jun", "jul", "ago", "set", "oct", "nov", "des"}; /* long month names - can be any length */ char *l_month[12]={ "gener", "febrer", "mar", "abril", "maig", "juny", "juliol", "agost", "setembre", "octubre", "novembre", "desembre"}; /* response code descriptions... order IS important! */ struct response_code response[] = { { "Codi de resposta no definit", 0 }, { "Codi 100 - Continua", 0 }, { "Codi 101 - S'est commutant protocols", 0 }, { "Codi 200 - D'acord", 0 }, { "Codi 201 - Creat", 0 }, { "Codi 202 - Acceptada", 0 }, { "Codi 203 - Informaci no autoritativa", 0 }, { "Codi 204 - Sense contingut", 0 }, { "Codi 205 - Recarregueu el contingut", 0 }, { "Codi 206 - Contingut parcial", 0 }, { "Codi 300 - Mltiples opcions", 0 }, { "Codi 301 - Mogut permanentment", 0 }, { "Codi 302 - Trobat", 0 }, { "Codi 303 - Vegeu altres", 0 }, { "Codi 304 - No modificat", 0 }, { "Codi 305 - Empreu un servidor intermediari", 0 }, { "Codi 307 - Mogut temporalment", 0 }, { "Codi 400 - Petici errnia", 0 }, { "Codi 401 - No autoritzat", 0 }, { "Codi 402 - Es requereix pagament", 0 }, { "Codi 403 - Prohibit", 0 }, { "Codi 404 - No trobat", 0 }, { "Codi 405 - Mtode no perms", 0 }, { "Codi 406 - No acceptable", 0 }, { "Codi 407 - Es requereix autenticaci proxy", 0 }, { "Codi 408 - Temps d'espera exhaurit", 0 }, { "Codi 409 - Conflicte", 0 }, { "Codi 410 - Ja no s disponible", 0 }, { "Codi 411 - Mida requerida" , 0 }, { "Codi 412 - Precondici fallida", 0 }, { "Codi 413 - Petici massa gran", 0 }, { "Codi 414 - URI de la petici massa llarga", 0 }, { "Codi 415 - Tipus de medi no implementat", 0 }, { "Codi 416 - Rang sollicitat no disponible", 0 }, { "Codi 417 - Expectativa fallida", 0 }, { "Codi 500 - Error intern del servidor", 0 }, { "Codi 501 - No implementat", 0 }, { "Codi 502 - Passarella errnia", 0 }, { "Codi 503 - Servei no disponible", 0 }, { "Codi 504 - Temps d'espera de la pasarella exhaurit",0 }, { "Codi 505 - Versi d'HTTP no implementada", 0 } }; char *msg_title = "Estadstiques d'accs per a"; char *msg_h_other = "Altre"; /* Country codes (previously in ctry.h header file) */ struct country_code ctry[] = { { 0, "No resolt/Desconegut", 0,0,0 }, { IDX_3C('c','o','m'), "Commercial (com)", 0,0,0 }, { IDX_3C('e','d','u'), "Educatiu (edu)", 0,0,0 }, { IDX_3C('g','o','v'), "Govern dels EUA (gov)", 0,0,0 }, { IDX_3C('i','n','t'), "Internacional (int)", 0,0,0 }, { IDX_3C('m','i','l'), "Exrcit dels EUA (mil)", 0,0,0 }, { IDX_3C('n','e','t'), "Xarxa (net)", 0,0,0 }, { IDX_3C('o','r','g'), "Org. sense nim de lucre (org)", 0,0,0 }, { IDX_3C('b','i','z'), "Negoci genric (biz)", 0,0,0 }, { IDX_3C('c','a','t'), "Comunitat catalana (cat)", 0,0,0 }, { IDX_3C('p','r','o'), "Professional (pro)", 0,0,0 }, { IDX_3C('t','e','l'), "Ind. Contact Data (tel)", 0,0,0 }, { IDX_4C('a','e','r','o'),"Air Transport Industry (aero)", 0,0,0 }, { IDX_4C('a','s','i','a'),"Comunitat sia Pacfic (asia)", 0,0,0 }, { IDX_4C('c','o','o','p'),"Associaci cooperativa (coop)", 0,0,0 }, { IDX_4C('i','n','f','o'),"DPN genric (info)", 0,0,0 }, { IDX_4C('j','o','b','s'),"Recursos humans (jobs)", 0,0,0 }, { IDX_4C('m','o','b','i'),"DPN genric mbil (mobi)", 0,0,0 }, { IDX_4C('n','a','m','e'),"Individu (name)", 0,0,0 }, { IDX_4C('a','r','p','a'),"Address Routing (arpa)", 0,0,0 }, { IDX_4C('n','a','t','o'),"Camp OTAN (nato)", 0,0,0 }, { IDX_6C('m','u','s','e','u','m'), "Museus (museum)", 0,0,0 }, { IDX_6C('t','r','a','v','e','l'), "Ind. viatges(travel)", 0,0,0 }, { IDX_2C('a','c'), "Illa de l'Ascensi", 0,0,0 }, { IDX_2C('a','d'), "Andorra", 0,0,0 }, { IDX_2C('a','e'), "Emirats rabs Units", 0,0,0 }, { IDX_2C('a','f'), "Afganistan", 0,0,0 }, { IDX_2C('a','g'), "Antigua i Barbuda", 0,0,0 }, { IDX_2C('a','i'), "Anguila", 0,0,0 }, { IDX_2C('a','l'), "Albnia", 0,0,0 }, { IDX_2C('a','m'), "Armnia", 0,0,0 }, { IDX_2C('a','n'), "Antilles Holandeses", 0,0,0 }, { IDX_2C('a','o'), "Angola", 0,0,0 }, { IDX_2C('a','q'), "Antrtida", 0,0,0 }, { IDX_2C('a','r'), "Argentina", 0,0,0 }, { IDX_2C('a','s'), "Samoa Americanes", 0,0,0 }, { IDX_2C('a','t'), "ustria", 0,0,0 }, { IDX_2C('a','u'), "Austrlia", 0,0,0 }, { IDX_2C('a','w'), "Aruba", 0,0,0 }, { IDX_2C('a','x'), "Illes land", 0,0,0 }, { IDX_2C('a','z'), "Azerbaitjan", 0,0,0 }, { IDX_2C('b','a'), "Bsnia i Herzegovina", 0,0,0 }, { IDX_2C('b','b'), "Barbados", 0,0,0 }, { IDX_2C('b','d'), "Bangladesh", 0,0,0 }, { IDX_2C('b','e'), "Blgica", 0,0,0 }, { IDX_2C('b','f'), "Burkina Faso", 0,0,0 }, { IDX_2C('b','g'), "Bulgria", 0,0,0 }, { IDX_2C('b','h'), "Bahrain", 0,0,0 }, { IDX_2C('b','i'), "Burundi", 0,0,0 }, { IDX_2C('b','j'), "Benn", 0,0,0 }, { IDX_2C('b','l'), "Saint Barthlemy", 0,0,0 }, { IDX_2C('b','m'), "Bermuda", 0,0,0 }, { IDX_2C('b','n'), "Brunei", 0,0,0 }, { IDX_2C('b','o'), "Bolvia", 0,0,0 }, { IDX_2C('b','r'), "Brasil", 0,0,0 }, { IDX_2C('b','s'), "Bahames", 0,0,0 }, { IDX_2C('b','t'), "Bhutan", 0,0,0 }, { IDX_2C('b','v'), "Bouvet", 0,0,0 }, { IDX_2C('b','w'), "Botsuana", 0,0,0 }, { IDX_2C('b','y'), "Bielorssia", 0,0,0 }, { IDX_2C('b','z'), "Belize", 0,0,0 }, { IDX_2C('c','a'), "Canad", 0,0,0 }, { IDX_2C('c','c'), "Illa de Cocos", 0,0,0 }, { IDX_2C('c','d'), "Repblica Democrtica del Congo", 0,0,0 }, { IDX_2C('c','f'), "Repblica Centrafricana", 0,0,0 }, { IDX_2C('c','g'), "Repblica del Congo", 0,0,0 }, { IDX_2C('c','h'), "Sussa", 0,0,0 }, { IDX_2C('c','i'), "Costa de Vori", 0,0,0 }, { IDX_2C('c','k'), "Arxiplag (Illes) de Cook", 0,0,0 }, { IDX_2C('c','l'), "Xile", 0,0,0 }, { IDX_2C('c','m'), "Camerun", 0,0,0 }, { IDX_2C('c','n'), "Xina", 0,0,0 }, { IDX_2C('c','o'), "Colmbia", 0,0,0 }, { IDX_2C('c','r'), "Costa Rica", 0,0,0 }, { IDX_2C('c','u'), "Cuba", 0,0,0 }, { IDX_2C('c','v'), "Cap Verd", 0,0,0 }, { IDX_2C('c','x'), "Illa de Christmas", 0,0,0 }, { IDX_2C('c','y'), "Xipre", 0,0,0 }, { IDX_2C('c','z'), "Txquia", 0,0,0 }, { IDX_2C('d','e'), "Alemanya", 0,0,0 }, { IDX_2C('d','j'), "Gibuti", 0,0,0 }, { IDX_2C('d','k'), "Dinamarca", 0,0,0 }, { IDX_2C('d','m'), "Dominica", 0,0,0 }, { IDX_2C('d','o'), "Repblica Dominicana", 0,0,0 }, { IDX_2C('d','z'), "Algria", 0,0,0 }, { IDX_2C('e','c'), "Equador", 0,0,0 }, { IDX_2C('e','e'), "Estnia", 0,0,0 }, { IDX_2C('e','g'), "Egipte", 0,0,0 }, { IDX_2C('e','h'), "Shara Occidental", 0,0,0 }, { IDX_2C('e','r'), "Eritrea", 0,0,0 }, { IDX_2C('e','s'), "Espanya", 0,0,0 }, { IDX_2C('e','t'), "Etiopia", 0,0,0 }, { IDX_2C('e','u'), "Uni Europea", 0,0,0 }, { IDX_2C('f','i'), "Finlndia", 0,0,0 }, { IDX_2C('f','j'), "Fiji", 0,0,0 }, { IDX_2C('f','k'), "Illes Malvines (Falkland)", 0,0,0 }, { IDX_2C('f','m'), "Micronsia", 0,0,0 }, { IDX_2C('f','o'), "Illes Fer-er", 0,0,0 }, { IDX_2C('f','r'), "Frana", 0,0,0 }, { IDX_2C('g','a'), "Gabon", 0,0,0 }, { IDX_2C('g','b'), "Gran Bretanya", 0,0,0 }, { IDX_2C('g','d'), "Grenada", 0,0,0 }, { IDX_2C('g','e'), "Gergia", 0,0,0 }, { IDX_2C('g','f'), "Guaiana Francesa", 0,0,0 }, { IDX_2C('g','g'), "Guernsey", 0,0,0 }, { IDX_2C('g','h'), "Ghana", 0,0,0 }, { IDX_2C('g','i'), "Gibraltar", 0,0,0 }, { IDX_2C('g','l'), "Grenlndia", 0,0,0 }, { IDX_2C('g','m'), "Gmbia", 0,0,0 }, { IDX_2C('g','n'), "Guinea", 0,0,0 }, { IDX_2C('g','p'), "Guadalupe", 0,0,0 }, { IDX_2C('g','q'), "Guinea Equatorial", 0,0,0 }, { IDX_2C('g','r'), "Grcia", 0,0,0 }, { IDX_2C('g','s'), "Illes Gergia del Sud i Sandwich del Sud", 0,0,0 }, { IDX_2C('g','t'), "Guatemala", 0,0,0 }, { IDX_2C('g','u'), "Guam", 0,0,0 }, { IDX_2C('g','w'), "Guinea Bissau", 0,0,0 }, { IDX_2C('g','y'), "Guaiana", 0,0,0 }, { IDX_2C('h','k'), "Hong Kong", 0,0,0 }, { IDX_2C('h','m'), "Illa Heard i Il