Compare commits

...
This repository has been archived on 2025-02-12. You can view files and clone it, but cannot push or open issues or pull requests.

67 commits
master ... 3.0

Author SHA1 Message Date
Fish
89188cb5e3 updated logserv to use servicescmode 2008-10-05 02:01:42 +00:00
Fish
5ae0838e62 woops, we went back a version when I autoconf'd this 2008-02-28 01:26:01 +00:00
Fish
288997cfba woops, we went back a version when I autoconf'd this 2008-02-28 01:25:51 +00:00
Fish
87d60aa9c2 add missing files 2008-02-27 02:40:08 +00:00
Fish
e212a15f9e Fix a different error this time around topic changes (How can you get a topic change without a valid cmdparams->source is beyond me. Something funky with the IRCd?) (LS-14) 2008-02-26 05:34:57 +00:00
Fish
3823d846b9 convert LogServ to autoconf so I can debug the crash currently reported on my mac 2008-02-26 05:13:07 +00:00
Fish
c415551433 Should fix LS-13 2008-02-21 13:15:50 +00:00
Fish
bf98e41a9a fix logserv compile error on x86-64 2008-02-21 09:33:22 +00:00
Fish
486bff3194 update pulse file 2007-12-05 09:00:00 +00:00
Fish
8a8e1189ca this is make dist, not distcheck 2007-12-05 08:14:56 +00:00
Fish
b712f370b4 Fix bug LS-11 2007-03-11 06:10:19 +00:00
Fish
04208b087b Forgot this module 2007-01-11 11:50:51 +00:00
Fish
01595da770 update copyright year 2006-01-26 15:33:47 +00:00
Fish
8f93c53c89 add template readme files 2006-01-15 07:47:25 +00:00
Fish
152488c116 bump version on logserv 2005-12-12 13:26:36 +00:00
Mark
caefb433bc update Win32 build to VS2005 2005-11-14 22:36:24 +00:00
Mark
10e9c2c08c scope fixes 2005-10-20 21:39:23 +00:00
Mark
a6835e29e0 scope fixes 2005-10-20 20:52:55 +00:00
Mark
82494c177b version and project stuff 2005-10-20 20:10:08 +00:00
Mark
99049473e1 fix URL help text 2005-10-17 22:11:35 +00:00
Mark
e5967515b3 code tidy and tweaks 2005-10-17 22:04:14 +00:00
Mark
97e41df99f Add logging support to CommandReport function 2005-10-17 19:16:03 +00:00
Mark
5d368d826f rename func 2005-10-15 22:34:33 +00:00
Mark
5639426672 fix filename 2005-10-15 22:02:28 +00:00
Mark
2c1044c074 fix filename 2005-10-15 21:56:46 +00:00
Mark
5edc3e3e5d fix file closing processing 2005-10-15 21:34:59 +00:00
Mark
cf79f8bf2a fix a couple segfaults with eggdrop processing 2005-10-14 22:52:42 +00:00
Mark
3757da876b tidy up logserv code adding const correctness etc 2005-10-14 21:49:36 +00:00
Mark
e895e7c76c mod api updates 2005-10-13 22:37:03 +00:00
Mark
f620449241 fix hash max usage 2005-10-11 22:03:50 +00:00
Mark
0997dbcc8a update to new event table end macro 2005-09-19 20:37:31 +00:00
Mark
89bd829237 New macros NS_CMD_END() and NS_SETTING_END() for terminating command and setting lists 2005-08-17 20:58:41 +00:00
Fish
e36d5ef94f fix logserv addtimer calls 2005-08-09 12:20:07 +00:00
Fish
4b50b1efac add flag to kill compiler warnings 2005-07-01 09:11:20 +00:00
Mark
d45daf1352 introduce some TS defines for easier code reading 2005-05-25 19:04:11 +00:00
Mark
f91baa1b73 help system update 2005-05-25 17:41:51 +00:00
Mark
cc1f98bf38 use new macro for modconfig includes 2005-05-22 22:03:08 +00:00
Mark
0c12927b28 fix DBAFetchRows handler 2005-05-05 22:34:33 +00:00
Mark
72d31ab511 update to a2 2005-03-08 22:03:16 +00:00
Mark
36bc47641e include tidy ups 2005-03-07 22:55:57 +00:00
Mark
4837bbf979 settings API update 2005-03-04 21:35:14 +00:00
Mark
34fcbc8929 final updates 2005-02-22 20:15:56 +00:00
Mark
9c213ab000 add win32 files to dist 2005-02-22 15:57:58 +00:00
Mark
12bb19ba47 prepare for alpha release 2005-02-22 00:38:12 +00:00
Mark
3d3de9296c build tidy ups 2005-02-19 23:45:00 +00:00
Mark
ab93cc7a21 Module init and fini API tidy up 2005-02-18 22:19:15 +00:00
Mark
e0dcb1b2b3 fix CRT calls and remove temp main 2005-02-14 22:04:09 +00:00
Mark
cc85724f98 update copyright year 2005-01-24 22:24:43 +00:00
Mark
cbf1750e30 API tidy ups 2004-10-27 20:24:07 +00:00
Mark
451d8b65c6 bot part api and command report update 2004-10-19 20:26:16 +00:00
Mark
74d026bf39 add win32 project files 2004-09-22 22:28:02 +00:00
Mark
2c37416d66 database API updates 2004-09-22 21:36:35 +00:00
Mark
a878842960 install updates 2004-09-10 15:08:28 +00:00
Mark
77b130e72a versioning updates 2004-09-10 15:06:35 +00:00
Mark
92df02a95c versioning updates 2004-09-10 14:49:36 +00:00
Mark
d3a0a316c1 updates for latest API changes 2004-08-31 22:46:57 +00:00
Mark
e72eeb8629 tidy up open file flag and add set options for logdir and saevdir 2004-08-16 21:21:04 +00:00
Mark
17372582fd additional updates for empty channel and moddata API 2004-08-16 20:59:18 +00:00
Mark
2705cf7416 text tidy ups 2004-08-10 20:12:39 +00:00
Mark
94429f2004 Add support for channel notices and core side CTCP ACTION parsing 2004-08-08 23:06:20 +00:00
Mark
f69851bd70 tidy up command path 2004-08-08 22:49:07 +00:00
Mark
ff255cc621 tidy up command path 2004-08-08 22:46:08 +00:00
Mark
b2fe855adb fix module CRT dependencies for Win32 DLLs via portability functions 2004-08-08 21:13:45 +00:00
Mark
84a6f40efb use portable file functions, logserv now works on Win32 2004-08-05 20:09:15 +00:00
Mark
303deef239 tidy ups and fix ups 2004-08-04 22:23:10 +00:00
Mark
b7e6066596 first pass 3.0 conversion 2004-08-01 21:23:58 +00:00
Mark
ace442ffcf branch for 3.0 dev 2004-07-31 22:17:47 +00:00
33 changed files with 20431 additions and 4313 deletions

23
.gitattributes vendored
View file

@ -3,19 +3,32 @@
/COPYING -text
/ChangeLog -text
/LICENSE -text
/LogServ.README -text
/LogServ.README.html -text
/LogServ.xml -text
/Makefile.am -text
/Makefile.in -text
/NEWS -text
/OnisDoLogs.sh -text
/README.LogServ -text
/README.LogServ.html -text
/README.LogServ.xml -text
/RELNOTES -text
/aclocal.m4 -text
/configure -text
/configure.in -text
/help.c -text
/install-sh -text
/lgs_help.c -text
/log_processing.c -text
/logdefault.c -text
/logdefault.h -text
/logeggdrop.c -text
/logeggdrop.h -text
/logmirc.c -text
/logmirc.h -text
/logprocessing.c -text
/logserv.c -text
/logserv.h -text
/logserv.vcproj -text
/logxchat.c -text
/logxchat.h -text
/modconfig.h.in -text
/modconfigwin32.h -text
/onisconfig -text
/pulse.xml -text

View file

@ -1,5 +1,31 @@
LogServ ChangeLog
=============================================================================
3.0.a4 - Fish (F)
- Fix Bug LS-11 make install failure
- make sure bot uses servicescmode when joining channels
3.0.a3 - Mark (M)
- Bug fixes for segfaults. (M)
3.0.a2 - Mark (M)
- Update settings table to a2 compatible format. (M)
3.0.a1 - Mark (M)
- Add SET options for logdir and savedir. (M)
- Remove indicator flag for open files. We can use the file descriptor for
this job. (M).
- Add support for EVENT_EMPTYCHAN so logserv will auto quit channels when all
users have left. (M)
- Add support for channel notices and core side CTCP ACTION parsing. (M)
- CHANS command is pointless since it requires a sub command so tidy up
command path by promoting the sub commands. (M)
- Replace file functions with core portable replacements. (M)
- Split processing code into seperate files. Easier maintainance and allows
us to create a template file for use in user submissions of alternative
log formats. (M)
- Replace safe_channame/_irclog_safe with core make_safe_filename call. (M)
- Port to 3.0 API (M)
1.2 * Mark * 17/2/2003
- We now try to read nick, user, host and realname so these can be configured more
easily (M)

View file

@ -1,479 +0,0 @@
LogServ Manual
_________________________________________________________________
1. Prerequisites and Installation.
1.1. Compiling and Installation
2. Basic Configuration
2.1. LogType
2.2. LOGSIZE SETTING
2.3. LOGAGE SETTING
3. Configuring LogServ to Log Individual Channels
3.1. Adding a Channel
3.2. Deleting a Channel
3.3. Changing Channel Settings
3.4. Viewing the Channel List
4. Misc Commands
4.1. STATS
4.2. VERSION
4.3. ABOUT
5. LogFile Parsers
Welcome to the LogServ Manual. This document will aid you in setting
up and running LogServServ on your IRC network.
LogServ is a basic Channel Logging Module for the NeoStats Services
that can log channel activity to a log file for processing by 3rd
party programs such as Onis or MircStats. These programs can then
produce HTML pages with interesting statistics on the channel
activities.
LogServ is flexible in the logging of channels, and can produce log
files in the same format as Xchat, Mirc, EggDrop, or our own custom
logging format, meaning you should be able to use just about any IRC
Log Parsing program to produce statistics for you.
Additionally, LogServ can rotate log files based on log file size or
age, and place them in a different directory for processing at any
time.
We recomend that you use the Onis Log file parser, as its what we have
done our testing with, and additionally, has several neat features
that are applicable to logging lots of channels. These are:
* Persistance. You don't need to keep old log files around if you
wish your statistics to have a long history, thus saving you
valuable file system space
* Easily Customizable with stylesheets
* Easily scriptable for processing many channels at once
We have provided a sample shell script and Onis configuration file to
automatically parse your log files in one go, producing the required
output.
LogServ is Copyright, 2003 by Justin Hammond.
1. Prerequisites and Installation.
LogServ is designed to run on Top of NeoStats. The Following
requirements at the time of writing are required for NeoStats:
* A Linux or BSD based Server or Shell.
* A supported IRCd. Currently, Hybrid7, Unreal, Ultimate2.x or
Ultimate3.x or NeoIRCd
* Some basic Unix administration Skill
* Of Course, a IRC network to connect it all together.
* Spare disk space and a webserver to display the output
* A log file parser such as Onis
Please refer to the NeoStats website for more information on the
requirements
1.1. Compiling and Installation
As long as you have successfully setup NeoStats, and installed it
correctly, Compiling LogServ is very simple and straight forward.
First you must extract the files from the download package. This is as
simple as:
bash$ tar -xzf LogServ-<ver>.tar.gz
This should then create a directory called LogServ-<version> where
<version> is the Version of LogServ. Then Proceed to Change into the
LogServ directory, and run Configure as follows:
bash$./configure [--enable-debug | --with-neostats=<dir>]
--enable-debug is only useful for diagnostics purposes when used in
conjunction with debugging tools. There should be no need to use this
option on a day to day basis
--with-neostats=<dir> should be used if your neostats directory is not
in a standard location (~/NeoStats/). Replace <dir> with the full path
to your NeoStats installation directory (NOT SOURCE DIRECTORY)
Configuring LogServ will look something like the following screen:
[Fish@fish-dt]$ ./configure
checking for gcc... gcc
checking for C compiler default output... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking for a BSD-compatible install... /usr/bin/install -c
checking for pcre_compile in -lpcre... yes
checking Location of NeoStats...... /home/fish/NeoStats/
checking for /home/fish/NeoStats//include/dl.h... yes
checking Version of NeoStats...... Compatible Version
checking Whether to Enable Debuging...... no
configure: creating ./config.status
config.status: creating Makefile
(*----------------------------------------------------------*)
(| To compile your module, please type 'make' |)
(| If make completes without errors, then you |)
(| Must 'make install', but please be sure that NeoStats |)
(| Is not currently running with a module of the same name |)
(| Running, otherwise Make install will not work |)
(| !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |)
(| If you are running a BSD, make install may produce a |)
(| Error, if that is the case, then please manually copy |)
(| opsb.so to the NeoStats/dl directory |)
(| !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |)
(*----------------------------------------------------------*)
(| For Support please visit: |)
(| IRC: /server irc.irc-chat.org |)
(| #neostats channel |)
(| WWW: http://www.neostats.net/boards/ |)
(*----------------------------------------------------------*)
(|This Module was written by: |)
(| fish (fish@dynam.ac) |)
(*----------------------------------------------------------*)
If the configuration did not produce a error, you may then move onto
Compiling LogServ. Compiling is simply just issuing the "make" command
(or "gmake" if you are running BSD):
[Fish@fish-dt]$ make
gcc -c -O2 -Wall -g -ggdb -I/home/fish/NeoStats//include/ -I. logserv.c
gcc -c -O2 -Wall -g -ggdb -I/home/fish/NeoStats//include/ -I. log_processing.c
ld -shared -o logserv.so logserv.o log_processing.o
again, check for Error messages. As long as there are not error
messages, "make install" will install LogServ, this README file, and
any auxiliary files needed into your NeoStats directory:
[Fish@fish-dt]$ make install
/usr/bin/install -c -m 644 LogServ.so /home/fish/NeoStats//dl/
/usr/bin/install -c -m 644 README.LogServ /home/fish/NeoStats//dl/../doc/
If you receive *ANY* errors at all during the this process, please
post them on our Support boards, at http//www.neostats.net/boards/
Once Installation is complete, you can either configure NeoStats to
load LogServ when it starts, or load LogServ via IRC.
To Configure NeoStats to automatically load LogServ when it boots, add
the following line to your "neostats.cfg" file in the NeoStats
directory:
LOAD_MODULE logserv
To load LogServ via IRC, you must make sure you have the appropriate
permissions and issue the following command:
/msg neostats load logserv
Thats it. LogServ is now loaded and ready for use
2. Basic Configuration
LogServ is completely configured online via IRC. When you first start
up LogServ, it attempts some "Sane" defaults for you get started with,
but you should always review these settings as soon as you install.
There are a few important settings you may want to review right away.
They are:
* LogType is the format we should be logging as (Xchat, Mirc,
EggDrop, or LogServ)
* Logfile size to rotate at (1Mb by default)
* Logfile age to rotate at (1Hr by default)
These are outlined below:
2.1. LogType
Logtype is the format you wish to perform your logging in. By default,
LogServ logs using its own internal logfile format, but as of
writting, no external logfile parser supports that format, so you are
advised to change it. There are four possible choices:
* 0 - LogServ Format. Our own Logging file format
* 1 - EggDrop Format. The Same logging format as the popular EggDrop
Bot
* 2 - Mirc Format. This is the same format as the mirc 6.0 series
* 3 - Xchat Format. This is the same format as Xchat 2.0.5 IRC
client
Warning
Changing the LogType is imediate, and all new entries into a
logfile will start with the new format imediatly. You should stop
NeoStats, and remove the files in NeoStats/logs/chanlogs/
directory after changing this setting, so when you next process
your log files, it will not be confused by the changing formats.
Changing the LogFile Format
Before starting to log any channels, you should select which format
you wish to log in. We recomend Xchat format. To change the LogType,
issue the following command:
/msg LogServ set logtype <type>
Where:
<type> = The Logging format time, indicated by a number from 0 to 3,
representing the differnt formats available as outlined above.
The output is as follows:
>logserv< set logtype 3
-LogServ- LOGTYPE set to 3
Viewing the current Logtype setting
To view the current logtype selected, simple type:
/msg LogServ set list
And all the current settings (the rest will be explained later in this
document) are displayed. The output is as follows:
>LogServ< set list
-LogServ- Current LogServ settings:
-LogServ- LOGTYPE: 3 Log Type
-LogServ- LOGSIZE: 2000 Bytes
-LogServ- LOGAGE: 3600 Seconds
2.2. LOGSIZE SETTING
LogServ stores logs in two places on your Shell. Live logs, or logs
that are currently being written are stored in the
~/NeoStats/logs/chanlogs/ directory, and these the logs that are
currently being updated. When the log reaches a certian size, or age,
it is closed, and moved to a the ~/NeoStats/ChanLogs/ directory where
you can process the log files. The LogFile size settings specifies how
big a "live log" is allowed to reach before it is moved to the final
directory. By default, LogServ will rotate all files larger than 1Mb,
and this should be satisfactory for most users.
Changing the LogSize to switch at.
To change the size at which a logfile will switch at, use the
following format:
/msg SecureServ set logsize <bytes>
Where:
<bytes> = if the file is larger than this size, it is "swapped"
The output is as follows:
>logserv< set logsize 20000
<LogServ> LOGSIZE set to 20000 by Fish
-LogServ- LOGSIZE set to 20000
Viewing the current setting
Please refer to the previous section.
2.3. LOGAGE SETTING
In addition to the logsize setting above, LogServ will rotate a
logfile after it has been opened for a period of time. This is so
channels that might not have much activity still get a chance to be
updated often.
The logage setting can be changed via:
/msg LogServ set logage <seconds>
Where:
<seconds> = The number of seconds the log file must be opened for
before rotating. Minium value is 5 minutes, but its recomended not to
go under 1 Hour (3600 seconds)
The output is as follows:
>LogServ< set logage 7200
<LogServ> LOGAGE set to 7200 by Fish
-LogServ- LOGAGE set to 7200
3. Configuring LogServ to Log Individual Channels
Obviously, we dont want to log every single IRC channel on the
network, so you have to tell LogServ what channels you wish to Log.
This is fairly basic. You have 4 options:
* Add A channel
* Delete A channel
* Change a Channels settings
* View the Channel list.
Each Setting is described in the following section.
3.1. Adding a Channel
Adding a Channel to be logged is instantanous, and the channel will
begin logging straight after this command has complete. LogServ will
join the channel, but not give itself any channel modes, so the
channel owner can decide if it should be OP'd or not.
The Syntax is:
/msg LogServ chans add <name> <public> <url>
Where:
<name> = The name of the channel you wish to Log. Must exist on the
IRC network.
<public> = Indicates weather to show the channel to non-privledged
users in the channel logging list or not. Either the words "public" or
"private". If a invalid entry is specified, defaults to Public.
Currently doesn't do anything.
<url> = For informational purposes only. Displays the Web Address that
users can visit to view the channel statistics.
The output is as follows:
>logserv< chans add #ircop public http://www.neostats.net
<LogServ> Fish used CHANS
-LogServ- Stats URL is set to http://www.neostats.net
-LogServ- Now Logging #ircop
<LogServ> Fish Activated Logging on #ircop
And the channel members of #ircop shall see:
--> LogServ (LogBot@stats.dynam.ac) has joined #ircop
-LogServ/#ircop- Fish Actived Channel Logging on #ircop
-LogServ/#ircop- Stats will be avaiable at http://www.neostats.net when Logs ar
e processed next
3.2. Deleting a Channel
Deleting a channel from LogServ means it will no longer log any
activity in that channel. If the channel is currently active, LogServ
shall part the channel, Close the "live log" and move it to its
processing directory.
The Syntax is:
/msg LogServ chans del <name>
Where:
<name> = The name of a channel we are currently logging.
The output is as follows:
>LogServ< chans del #ircop
<LogServ> Fish used CHANS
-LogServ- Deleted Channel #ircop
<LogServ> Fish deleted #ircop from Channel Logging
3.3. Changing Channel Settings
You can change the URL location displayed when viewing the channel
list using the chans set command.
The Syntax is:
/msg logserv chans set URL <name> <newurl>
Where:
<name> = The channel name you wish to alter
<newurl> = The new URL you wish to set.
The output is as follows:
<LogServ> Fish used CHANS
-LogServ- Changed URL for #blah to: http://nowhere.com
<LogServ> Fish changed the URL for #blah to: http://nowhere.com
3.4. Viewing the Channel List
The channel list can be viewed by issuing the following command:
/msg logserv chans list
The output is as follows:
-LogServ- Monitored Channel List:
-LogServ- #blah (-) URL: http://nowhere.com
-LogServ- #bl (-) URL: None
-LogServ- #ircop (*) URL: http://www.neostats.net
-LogServ- End Of List.
The (-) or (*) indicate if the channel is currently active.
4. Misc Commands
There are several other commands available. These are documented
below:
4.1. STATS
The stats command shows some basic stats about the Logging Activities.
With future versions its expected the amount of information will
increase with this command.
The Syntax is:
/msg LogServ stats
And the output is
<LogServ> Fish used STATS
-LogServ- LogServ Stats:
-LogServ- Monitoring 3 channels
4.2. VERSION
This displays LogServ's Version number
The Syntax is:
/msg LogServ version
And the Output is:
<LogServ> Fish used VERSION
-LogServ- LogServ Version Information
-LogServ- LogServ Version: $Rev: 19 $ Compiled Jan 13 2004 at 20:08:11
4.3. ABOUT
This displays a brief message to users describing the function of
LogServ:
The Syntax is:
/msg LogServ About
And the output is:
<LogServ> Fish used ABOUT
-LogServ- LogServ logs channel activities to produce HTML pages describing some
interesting Statistics
-LogServ- about that channel. If you wish to have your channel logged,
-LogServ- please contact the Network Adminstration
5. LogFile Parsers
As mentioned in the introduction, LogServ only generates Log files,
you still need to get some program to create the HTML pages from the
logfiles.
We currently recomend Onis for parsing the logfiles. You can obtain a
copy of Onis from http://verplant.org/onis/
We have provided a Sample Onis Configuration based on Onis 0.4.9, and
a shell script that can be executed by Crontab to process all your
Logfiles. This sample configuration and Shell script are installed
into the ~/NeoStats/ChanLogs/ directory by default.
This shell script will automatically go through each of the channels
logs running Onis to update the HTML pages. At the top of the script
are some variables that should be setup to configure where you wish to
place the resultant HTML files, and where Onis is installed. You
should read the begining of the file OnisDoLogs.sh to figure out what
needs to be configured.
This shell script assumes that you have a webserver on the same shell
as NeoStats. If not, its upto the reader to implement some sort of
FTP/SCP script to transfer either the logfiles, or the output from
Onis to his webserver.
Additionally, if you are using a different LogFile parser, other than
Onis, you will have to develop your own script or method for updating
the HTML pages. If you do develop a script for another Logfile
Processor, please send us a copy, so we may include it in future
versions.
The logs for each channel are placed into their own directory within
the ChanLogs directory, so if you are logging #neostats, The logfiles
would be placed in ChanLogs/#neostats.
Warning
# is a special charactor on most shells and needs to be escaped. So if
you wish to change directory to #neostats, you would actually type cd
\#neostats. Keep this in mind when developing any scripts.
Each Logfile is timestamped with the time it was rotated out of the
logs/chanlogs/ directory, with the format <name>-YYMMDDHHMMSS.log

File diff suppressed because one or more lines are too long

View file

@ -1,562 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
<article>
<title>LogServ Manual</title>
<para>Welcome to the LogServ Manual. This document will aid you in setting
up and running LogServServ on your IRC network.</para>
<para>LogServ is a basic Channel Logging Module for the NeoStats Services
that can log channel activity to a log file for processing by 3rd party
programs such as Onis or MircStats. These programs can then produce HTML
pages with interesting statistics on the channel activities. </para>
<para>LogServ is flexible in the logging of channels, and can produce log
files in the same format as Xchat, Mirc, EggDrop, or our own custom logging
format, meaning you should be able to use just about any IRC Log Parsing
program to produce statistics for you.</para>
<para>Additionally, LogServ can rotate log files based on log file size or
age, and place them in a different directory for processing at any time.</para>
<para>We recomend that you use the Onis Log file parser, as its what we have
done our testing with, and additionally, has several neat features that are
applicable to logging lots of channels. These are:<itemizedlist><listitem><para>Persistance.
You don&#39;t need to keep old log files around if you wish your statistics
to have a long history, thus saving you valuable file system space</para></listitem><listitem><para>Easily
Customizable with stylesheets</para></listitem><listitem><para>Easily
scriptable for processing many channels at once</para></listitem></itemizedlist></para>
<para>We have provided a sample shell script and Onis configuration file to
automatically parse your log files in one go, producing the required output.
</para>
<para>LogServ is Copyright, 2003 by Justin Hammond.</para>
<sect1>
<title>Prerequisites and Installation.</title>
<para>LogServ is designed to run on Top of NeoStats. The Following
requirements at the time of writing are required for NeoStats:<itemizedlist><listitem><para>A
Linux or BSD based Server or Shell.</para></listitem><listitem><para>A
supported IRCd. Currently, Hybrid7, Unreal, Ultimate2.x or Ultimate3.x or
NeoIRCd</para></listitem><listitem><para>Some basic Unix administration
Skill</para></listitem><listitem><para>Of Course, a IRC network to connect
it all together.</para></listitem><listitem><para>Spare disk space and a
webserver to display the output</para></listitem><listitem><para>A log
file parser such as Onis</para></listitem></itemizedlist></para>
<para>Please refer to the NeoStats website for more information on the
requirements</para>
<sect2>
<title>Compiling and Installation</title>
<para>As long as you have successfully setup NeoStats, and installed it
correctly, Compiling LogServ is very simple and straight forward. First
you must extract the files from the download package. This is as simple
as:</para>
<screen>bash$<command> tar -xzf LogServ-&#60;ver&#62;.tar.gz</command></screen>
<para>This should then create a directory called
LogServ-&#60;version&#62; where &#60;version&#62; is the Version of
LogServ. Then Proceed to Change into the LogServ directory, and run
Configure as follows:<screen>bash$<command>./configure [--enable-debug | --with-neostats=&#60;dir&#62;]</command></screen></para>
<para>--enable-debug is only useful for diagnostics purposes when used
in conjunction with debugging tools. There should be no need to use this
option on a day to day basis</para>
<para>--with-neostats=&#60;dir&#62; should be used if your neostats
directory is not in a standard location (~/NeoStats/). Replace
&#60;dir&#62; with the full path to your NeoStats installation directory
(NOT SOURCE DIRECTORY)</para>
<para>Configuring LogServ will look something like the following screen:</para>
<screen>[Fish@fish-dt]$ ./configure
checking for gcc... gcc
checking for C compiler default output... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking for a BSD-compatible install... /usr/bin/install -c
checking for pcre_compile in -lpcre... yes
checking Location of NeoStats...... /home/fish/NeoStats/
checking for /home/fish/NeoStats//include/dl.h... yes
checking Version of NeoStats...... Compatible Version
checking Whether to Enable Debuging...... no
configure: creating ./config.status
config.status: creating Makefile
(*----------------------------------------------------------*)
(| To compile your module, please type &#39;make&#39; |)
(| If make completes without errors, then you |)
(| Must &#39;make install&#39;, but please be sure that NeoStats |)
(| Is not currently running with a module of the same name |)
(| Running, otherwise Make install will not work |)
(| !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |)
(| If you are running a BSD, make install may produce a |)
(| Error, if that is the case, then please manually copy |)
(| opsb.so to the NeoStats/dl directory |)
(| !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |)
(*----------------------------------------------------------*)
(| For Support please visit: |)
(| IRC: /server irc.irc-chat.org |)
(| #neostats channel |)
(| WWW: http://www.neostats.net/boards/ |)
(*----------------------------------------------------------*)
(|This Module was written by: |)
(| fish (fish@dynam.ac) |)
(*----------------------------------------------------------*)
</screen>
<para>If the configuration did not produce a error, you may then move
onto Compiling LogServ. Compiling is simply just issuing the
&#34;make&#34; command (or &#34;gmake&#34; if you are running BSD):</para>
<screen>[Fish@fish-dt]$ make
gcc -c -O2 -Wall -g -ggdb -I/home/fish/NeoStats//include/ -I. logserv.c
gcc -c -O2 -Wall -g -ggdb -I/home/fish/NeoStats//include/ -I. log_processing.c
ld -shared -o logserv.so logserv.o log_processing.o
</screen>
<para>again, check for Error messages. As long as there are not error
messages, &#34;make install&#34; will install LogServ, this README file,
and any auxiliary files needed into your NeoStats directory:</para>
<screen>[Fish@fish-dt]$ make install
/usr/bin/install -c -m 644 LogServ.so /home/fish/NeoStats//dl/
/usr/bin/install -c -m 644 README.LogServ /home/fish/NeoStats//dl/../doc/
</screen>
<para>If you receive *ANY* errors at all during the this process, please
post them on our Support boards, at http//www.neostats.net/boards/</para>
<para>Once Installation is complete, you can either configure NeoStats
to load LogServ when it starts, or load LogServ via IRC.</para>
<para>To Configure NeoStats to automatically load LogServ when it boots,
add the following line to your &#34;neostats.cfg&#34; file in the
NeoStats directory:</para>
<para><command>LOAD_MODULE logserv</command></para>
<para>To load LogServ via IRC, you must make sure you have the
appropriate permissions and issue the following command:</para>
<para><command>/msg neostats load logserv</command></para>
<para>Thats it. LogServ is now loaded and ready for use </para>
</sect2>
</sect1>
<sect1>
<title>Basic Configuration</title>
<para>LogServ is completely configured online via IRC. When you first
start up LogServ, it attempts some &#34;Sane&#34; defaults for you get
started with, but you should always review these settings as soon as you
install. There are a few important settings you may want to review right
away. They are:</para>
<itemizedlist>
<listitem>
<para>LogType is the format we should be logging as (Xchat, Mirc,
EggDrop, or LogServ)</para>
</listitem>
<listitem>
<para>Logfile size to rotate at (1Mb by default)</para>
</listitem>
<listitem>
<para>Logfile age to rotate at (1Hr by default)</para>
</listitem>
</itemizedlist>
<para>These are outlined below:</para>
<sect2>
<title>LogType</title>
<para>Logtype is the format you wish to perform your logging in. By
default, LogServ logs using its own internal logfile format, but as of
writting, no external logfile parser supports that format, so you are
advised to change it. There are four possible choices:</para>
<itemizedlist>
<listitem>
<para>0 - LogServ Format. Our own Logging file format</para>
</listitem>
<listitem>
<para>1 - EggDrop Format. The Same logging format as the popular
EggDrop Bot</para>
</listitem>
<listitem>
<para>2 - Mirc Format. This is the same format as the mirc 6.0
series</para>
</listitem>
<listitem>
<para>3 - Xchat Format. This is the same format as Xchat 2.0.5 IRC
client</para>
<warning>
<para>Changing the LogType is imediate, and all new entries into a
logfile will start with the new format imediatly. You should stop
NeoStats, and remove the files in NeoStats/logs/chanlogs/
directory after changing this setting, so when you next process
your log files, it will not be confused by the changing formats.
</para>
</warning>
</listitem>
</itemizedlist>
<para><emphasis role="bold">Changing the LogFile Format</emphasis></para>
<para>Before starting to log any channels, you should select which
format you wish to log in. We recomend Xchat format. To change the
LogType, issue the following command:</para>
<screen>/msg LogServ set logtype &#60;type&#62;</screen>
<para>Where:</para>
<para>&#60;type&#62; = The Logging format time, indicated by a number
from 0 to 3, representing the differnt formats available as outlined
above. </para>
<para>The output is as follows:</para>
<screen>&#62;logserv&#60; set logtype 3
-LogServ- LOGTYPE set to 3</screen>
<para><emphasis role="bold">Viewing the current Logtype setting</emphasis></para>
<para>To view the current logtype selected, simple type:</para>
<screen>/msg LogServ set list</screen>
<para>And all the current settings (the rest will be explained later in
this document) are displayed. The output is as follows:</para>
<screen>&#62;LogServ&#60; set list
-LogServ- Current LogServ settings:
-LogServ- LOGTYPE: 3 Log Type
-LogServ- LOGSIZE: 2000 Bytes
-LogServ- LOGAGE: 3600 Seconds</screen>
</sect2>
<sect2>
<title>LOGSIZE SETTING</title>
<para>LogServ stores logs in two places on your Shell. Live logs, or
logs that are currently being written are stored in the
~/NeoStats/logs/chanlogs/ directory, and these the logs that are
currently being updated. When the log reaches a certian size, or age, it
is closed, and moved to a the ~/NeoStats/ChanLogs/ directory where you
can process the log files. The LogFile size settings specifies how big a
&#34;live log&#34; is allowed to reach before it is moved to the final
directory. By default, LogServ will rotate all files larger than 1Mb,
and this should be satisfactory for most users. </para>
<para><emphasis role="bold">Changing the LogSize to switch at.
</emphasis></para>
<para>To change the size at which a logfile will switch at, use the
following format:</para>
<screen>/msg SecureServ set logsize &#60;bytes&#62;</screen>
<para>Where:</para>
<para>&#60;bytes&#62; = if the file is larger than this size, it is
&#34;swapped&#34;</para>
<para>The output is as follows:</para>
<screen>&#62;logserv&#60; set logsize 20000
&#60;LogServ&#62; LOGSIZE set to 20000 by Fish
-LogServ- LOGSIZE set to 20000</screen>
<para><emphasis role="bold">Viewing the current setting</emphasis></para>
<para>Please refer to the previous section.</para>
</sect2>
<sect2>
<title>LOGAGE SETTING</title>
<para>In addition to the logsize setting above, LogServ will rotate a
logfile after it has been opened for a period of time. This is so
channels that might not have much activity still get a chance to be
updated often.</para>
<para>The logage setting can be changed via:</para>
<screen>/msg LogServ set logage &#60;seconds&#62;</screen>
<para>Where:</para>
<para>&#60;seconds&#62; = The number of seconds the log file must be
opened for before rotating. Minium value is 5 minutes, but its
recomended not to go under 1 Hour (3600 seconds)</para>
<para>The output is as follows:</para>
<screen>&#62;LogServ&#60; set logage 7200
&#60;LogServ&#62; LOGAGE set to 7200 by Fish
-LogServ- LOGAGE set to 7200</screen>
</sect2>
</sect1>
<sect1>
<title>Configuring LogServ to Log Individual Channels</title>
<para>Obviously, we dont want to log every single IRC channel on the
network, so you have to tell LogServ what channels you wish to Log. This
is fairly basic. You have 4 options:</para>
<itemizedlist>
<listitem>
<para>Add A channel</para>
</listitem>
<listitem>
<para>Delete A channel</para>
</listitem>
<listitem>
<para>Change a Channels settings</para>
</listitem>
<listitem>
<para>View the Channel list. </para>
</listitem>
</itemizedlist>
<para>Each Setting is described in the following section.</para>
<sect2>
<title>Adding a Channel</title>
<para>Adding a Channel to be logged is instantanous, and the channel
will begin logging straight after this command has complete. LogServ
will join the channel, but not give itself any channel modes, so the
channel owner can decide if it should be OP&#39;d or not. </para>
<para>The Syntax is:</para>
<screen>/msg LogServ chans add &#60;name&#62; &#60;public&#62; &#60;url&#62;</screen>
<para>Where:</para>
<para>&#60;name&#62; = The name of the channel you wish to Log. Must
exist on the IRC network.</para>
<para>&#60;public&#62; = Indicates weather to show the channel to
non-privledged users in the channel logging list or not. Either the
words &#34;public&#34; or &#34;private&#34;. If a invalid entry is
specified, defaults to Public. Currently doesn&#39;t do anything.
</para>
<para>&#60;url&#62; = For informational purposes only. Displays the Web
Address that users can visit to view the channel statistics. </para>
<para>The output is as follows:</para>
<screen>&#62;logserv&#60; chans add #ircop public http://www.neostats.net
&#60;LogServ&#62; Fish used CHANS
-LogServ- Stats URL is set to http://www.neostats.net
-LogServ- Now Logging #ircop
&#60;LogServ&#62; Fish Activated Logging on #ircop</screen>
<para>And the channel members of #ircop shall see:</para>
<screen>--&#62; LogServ (LogBot@stats.dynam.ac) has joined #ircop
-LogServ/#ircop- Fish Actived Channel Logging on #ircop
-LogServ/#ircop- Stats will be avaiable at http://www.neostats.net when Logs are processed next</screen>
</sect2>
<sect2>
<title>Deleting a Channel</title>
<para>Deleting a channel from LogServ means it will no longer log any
activity in that channel. If the channel is currently active, LogServ
shall part the channel, Close the &#34;live log&#34; and move it to its
processing directory. </para>
<para>The Syntax is:</para>
<screen>/msg LogServ chans del &#60;name&#62;</screen>
<para>Where:</para>
<para>&#60;name&#62; = The name of a channel we are currently logging.
</para>
<para>The output is as follows:</para>
<screen>&#62;LogServ&#60; chans del #ircop
&#60;LogServ&#62; Fish used CHANS
-LogServ- Deleted Channel #ircop
&#60;LogServ&#62; Fish deleted #ircop from Channel Logging</screen>
</sect2>
<sect2>
<title>Changing Channel Settings</title>
<para>You can change the URL location displayed when viewing the channel
list using the chans set command. </para>
<para>The Syntax is:</para>
<screen>/msg logserv chans set URL &#60;name&#62; &#60;newurl&#62;</screen>
<para>Where:</para>
<para>&#60;name&#62; = The channel name you wish to alter</para>
<para>&#60;newurl&#62; = The new URL you wish to set. </para>
<para>The output is as follows:</para>
<screen>&#60;LogServ&#62; Fish used CHANS
-LogServ- Changed URL for #blah to: http://nowhere.com
&#60;LogServ&#62; Fish changed the URL for #blah to: http://nowhere.com</screen>
</sect2>
<sect2>
<title>Viewing the Channel List</title>
<para>The channel list can be viewed by issuing the following command:</para>
<screen>/msg logserv chans list</screen>
<para>The output is as follows:</para>
<screen>-LogServ- Monitored Channel List:
-LogServ- #blah (-) URL: http://nowhere.com
-LogServ- #bl (-) URL: None
-LogServ- #ircop (*) URL: http://www.neostats.net
-LogServ- End Of List.</screen>
<para>The (-) or (*) indicate if the channel is currently active.
</para>
</sect2>
</sect1>
<sect1>
<title>Misc Commands</title>
<para>There are several other commands available. These are documented
below:</para>
<sect2>
<title>STATS</title>
<para>The stats command shows some basic stats about the Logging
Activities. With future versions its expected the amount of information
will increase with this command. </para>
<para>The Syntax is:</para>
<screen>/msg LogServ stats</screen>
<para>And the output is</para>
<screen>&#60;LogServ&#62; Fish used STATS
-LogServ- LogServ Stats:
-LogServ- Monitoring 3 channels</screen>
</sect2>
<sect2>
<title>VERSION</title>
<para>This displays LogServ&#39;s Version number</para>
<para>The Syntax is:</para>
<screen>/msg LogServ version</screen>
<para>And the Output is:</para>
<screen>&#60;LogServ&#62; Fish used VERSION
-LogServ- LogServ Version Information
-LogServ- LogServ Version: $Rev: 19 $ Compiled Jan 13 2004 at 20:08:11</screen>
</sect2>
<sect2>
<title>ABOUT</title>
<para>This displays a brief message to users describing the function of
LogServ:</para>
<para>The Syntax is:</para>
<screen>/msg LogServ About</screen>
<para>And the output is:</para>
<screen>&#60;LogServ&#62; Fish used ABOUT
-LogServ- LogServ logs channel activities to produce HTML pages describing some interesting Statistics
-LogServ- about that channel. If you wish to have your channel logged,
-LogServ- please contact the Network Adminstration</screen>
</sect2>
</sect1>
<sect1>
<title>LogFile Parsers</title>
<para>As mentioned in the introduction, LogServ only generates Log files,
you still need to get some program to create the HTML pages from the
logfiles. </para>
<para>We currently recomend Onis for parsing the logfiles. You can obtain
a copy of Onis from http://verplant.org/onis/</para>
<para>We have provided a Sample Onis Configuration based on Onis 0.4.9,
and a shell script that can be executed by Crontab to process all your
Logfiles. This sample configuration and Shell script are installed into
the ~/NeoStats/ChanLogs/ directory by default.</para>
<para>This shell script will automatically go through each of the channels
logs running Onis to update the HTML pages. At the top of the script are
some variables that should be setup to configure where you wish to place
the resultant HTML files, and where Onis is installed. You should read the
begining of the file OnisDoLogs.sh to figure out what needs to be
configured.</para>
<para>This shell script assumes that you have a webserver on the same
shell as NeoStats. If not, its upto the reader to implement some sort of
FTP/SCP script to transfer either the logfiles, or the output from Onis to
his webserver. </para>
<para>Additionally, if you are using a different LogFile parser, other
than Onis, you will have to develop your own script or method for updating
the HTML pages. If you do develop a script for another Logfile Processor,
please send us a copy, so we may include it in future versions. </para>
<para>The logs for each channel are placed into their own directory within
the ChanLogs directory, so if you are logging #neostats, The logfiles
would be placed in ChanLogs/#neostats. </para>
<warning>
<para># is a special charactor on most shells and needs to be escaped.
So if you wish to change directory to #neostats, you would actually type
cd \#neostats. Keep this in mind when developing any scripts. </para>
</warning>
<para>Each Logfile is timestamped with the time it was rotated out of the
logs/chanlogs/ directory, with the format &#60;name&#62;-YYMMDDHHMMSS.log</para>
</sect1>
</article>

16
Makefile.am Normal file
View file

@ -0,0 +1,16 @@
AUTOMAKE_OPTIONS = foreign
ACLOCAL_AMFLAGS = -I autotools
AM_MAKEFLAGS = -s
pkglib_LTLIBRARIES = logserv.la
logserv_la_SOURCES = logserv.c logprocessing.c help.c logdefault.c logeggdrop.c logmirc.c logxchat.c
noinst_HEADERS = logdefault.h logmirc.h logxchat.h logeggdrop.h logserv.h
logserv_la_LDFLAGS = -module -avoid-version
EXTRA_DIST = autotools/ccdv.c autotools/shtool RELNOTES
dist_doc_DATA = README.LogServ OnisDoLogs.sh onisconfig
include $(top_srcdir)/autotools/rules.mk

View file

@ -1,56 +1,722 @@
#Neostats Module Makefile!
# Makefile.in generated by automake 1.9.6 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = .
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
DIST_COMMON = $(am__configure_deps) $(dist_doc_DATA) $(noinst_HEADERS) \
$(srcdir)/Makefile.am $(srcdir)/Makefile.in \
$(srcdir)/modconfig.h.in $(top_srcdir)/autotools/rules.mk \
$(top_srcdir)/configure AUTHORS COPYING ChangeLog NEWS \
autotools/compile autotools/config.guess autotools/config.sub \
autotools/depcomp autotools/install-sh autotools/ltmain.sh \
autotools/missing autotools/mkinstalldirs install-sh
subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/autotools/acinclude.m4 \
$(top_srcdir)/autotools/ax_distversion.m4 \
$(top_srcdir)/autotools/ax_maintainer_mode_auto_silent.m4 \
$(top_srcdir)/autotools/ccdv.m4 $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno configure.status.lineno
mkinstalldirs = $(SHELL) $(top_srcdir)/autotools/mkinstalldirs
CONFIG_HEADER = modconfig.h
CONFIG_CLEAN_FILES =
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
am__installdirs = "$(DESTDIR)$(pkglibdir)" "$(DESTDIR)$(docdir)"
pkglibLTLIBRARIES_INSTALL = $(INSTALL)
LTLIBRARIES = $(pkglib_LTLIBRARIES)
logserv_la_LIBADD =
am_logserv_la_OBJECTS = logserv.lo logprocessing.lo help.lo \
logdefault.lo logeggdrop.lo logmirc.lo logxchat.lo
logserv_la_OBJECTS = $(am_logserv_la_OBJECTS)
DEFAULT_INCLUDES = -I. -I$(srcdir) -I.
depcomp = $(SHELL) $(top_srcdir)/autotools/depcomp
am__depfiles_maybe = depfiles
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
$(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
SOURCES = $(logserv_la_SOURCES)
DIST_SOURCES = $(logserv_la_SOURCES)
dist_docDATA_INSTALL = $(INSTALL_DATA)
DATA = $(dist_doc_DATA)
HEADERS = $(noinst_HEADERS)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
top_distdir = $(distdir)
am__remove_distdir = \
{ test ! -d $(distdir) \
|| { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
&& rm -fr $(distdir); }; }
DIST_ARCHIVES = $(distdir).tar.gz
GZIP_ENV = --best
distuninstallcheck_listfiles = find . -type f -print
distcleancheck_listfiles = find . -type f -print
pkglibdir = $(prefix)/modules
ACLOCAL = @ACLOCAL@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CFLAGS = @CFLAGS@ -g
LDFLAGS = @LIBS@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
CCDEPMODE = @CCDEPMODE@
CCDV = @CCDV@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DIRINST = @DIRINST@
DISTDIRVERSION = @DISTDIRVERSION@
ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
GREP = @GREP@
INSTALL_DATA = @INSTALL_DATA@
DIRECTORY = @DIRINST@/dl/
INCLUDES = -I@DIRINST@/include/ -I.
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIBTOOL_DEPS = @LIBTOOL_DEPS@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
USECCDV = @USECCDV@
VERSION = @VERSION@
ac_ct_CC = @ac_ct_CC@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
datadir = $(prefix)/data
datarootdir = @datarootdir@
docdir = $(prefix)/doc
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
wi_PWD = @wi_PWD@
AUTOMAKE_OPTIONS = foreign
ACLOCAL_AMFLAGS = -I autotools
AM_MAKEFLAGS = -s
pkglib_LTLIBRARIES = logserv.la
logserv_la_SOURCES = logserv.c logprocessing.c help.c logdefault.c logeggdrop.c logmirc.c logxchat.c
noinst_HEADERS = logdefault.h logmirc.h logxchat.h logeggdrop.h logserv.h
logserv_la_LDFLAGS = -module -avoid-version
EXTRA_DIST = autotools/ccdv.c autotools/shtool RELNOTES
dist_doc_DATA = README.LogServ OnisDoLogs.sh onisconfig
LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
SRCS= logserv.c log_processing.c lgs_help.c
OBJS= ${SRCS:.c=.o}
TARGET= logserv.so
DOCS=LogServ.README LogServ.README.html
SCRIPTS=OnisDoLogs.sh onisconfig
DATA=
DISTFILES=$(SRCS) $(DOCS) $(SCRIPTS) *.in configure install-sh ChangeLog *.h LICENSE
DISTDIR= @PACKAGE@-@VERSION@
distdir = @DISTDIRVERSION@
all: modconfig.h
$(MAKE) $(AM_MAKEFLAGS) all-am
all: module
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
am--refresh:
@:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/autotools/rules.mk $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \
cd $(srcdir) && $(AUTOMAKE) --foreign \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --foreign Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
echo ' $(SHELL) ./config.status'; \
$(SHELL) ./config.status;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
esac;
.c.o:
$(CC) -c $(CFLAGS) $(INCLUDES) $<
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck
module: $(OBJS)
$(LD) -shared -o $(TARGET) $(LDFLAGS) $(OBJS)
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(srcdir) && $(AUTOCONF)
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
clean:
/bin/rm -rf $(TARGET) *.o Makefile *.log modconfig.h
modconfig.h: stamp-h1
@if test ! -f $@; then \
rm -f stamp-h1; \
$(MAKE) stamp-h1; \
else :; fi
install: module
$(INSTALL) -m 644 $(TARGET) $(DIRECTORY)
$(INSTALL) -m 644 $(DOCS) $(DIRECTORY)../doc/
@if ! test -d $(DIRECTORY)../ChanLogs/ ; then mkdir $(DIRECTORY)../ChanLogs/ ; fi
$(INSTALL) -m 755 $(SCRIPTS) $(DIRECTORY)../ChanLogs/
stamp-h1: $(srcdir)/modconfig.h.in $(top_builddir)/config.status
@rm -f stamp-h1
cd $(top_builddir) && $(SHELL) ./config.status modconfig.h
$(srcdir)/modconfig.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_srcdir) && $(AUTOHEADER)
rm -f stamp-h1
touch $@
dist:
@echo -n "Creating Directories"
@-rm -rf $(DISTDIR)
@mkdir $(DISTDIR)
@echo "Done"
@echo -n "Copying Core Distribution Files"
@for file in $(DISTFILES); do \
echo -n "."; \
cp -pr $$file $(DISTDIR)/$$file; \
distclean-hdr:
-rm -f modconfig.h stamp-h1
uninstall-pkglibLTLIBRARIES:
@$(NORMAL_UNINSTALL)
@set -x; list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
p=$(am__strip_dir) \
echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$p'"; \
$(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$p"; \
done
@echo "Done"
@tar -czf $(DISTDIR).tar.gz $(DISTDIR)/*
@echo "Tar file $(DISTDIR).tar.gz created, Freshmeat Time"
clean-pkglibLTLIBRARIES:
-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
test "$$dir" != "$$p" || dir=.; \
echo "rm -f \"$${dir}/so_locations\""; \
rm -f "$${dir}/so_locations"; \
done
logserv.la: $(logserv_la_OBJECTS) $(logserv_la_DEPENDENCIES)
$(LINK) -rpath $(pkglibdir) $(logserv_la_LDFLAGS) $(logserv_la_OBJECTS) $(logserv_la_LIBADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/help.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/logdefault.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/logeggdrop.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/logmirc.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/logprocessing.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/logserv.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/logxchat.Plo@am__quote@
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool
uninstall-info-am:
uninstall-dist_docDATA:
@$(NORMAL_UNINSTALL)
@list='$(dist_doc_DATA)'; for p in $$list; do \
f=$(am__strip_dir) \
echo " rm -f '$(DESTDIR)$(docdir)/$$f'"; \
rm -f "$(DESTDIR)$(docdir)/$$f"; \
done
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: $(HEADERS) $(SOURCES) modconfig.h.in $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) modconfig.h.in $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique; \
fi
ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) modconfig.h.in $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) modconfig.h.in $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
$(am__remove_distdir)
mkdir $(distdir)
$(mkdir_p) $(distdir)/autotools
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkdir_p) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
-find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
|| chmod -R a+r $(distdir)
dist-gzip: distdir
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
$(am__remove_distdir)
dist-bzip2: distdir
tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
$(am__remove_distdir)
dist-tarZ: distdir
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
$(am__remove_distdir)
dist-shar: distdir
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
$(am__remove_distdir)
dist-zip: distdir
-rm -f $(distdir).zip
zip -rq $(distdir).zip $(distdir)
$(am__remove_distdir)
dist dist-all: distdir
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
$(am__remove_distdir)
# This target untars the dist file and tries a VPATH configuration. Then
# it guarantees that the distribution is self-contained by making another
# tarfile.
distcheck: dist
case '$(DIST_ARCHIVES)' in \
*.tar.gz*) \
GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \
GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
*.zip*) \
unzip $(distdir).zip ;;\
esac
chmod -R a-w $(distdir); chmod a+w $(distdir)
mkdir $(distdir)/_build
mkdir $(distdir)/_inst
chmod a-w $(distdir)
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
&& cd $(distdir)/_build \
&& ../configure --srcdir=.. --prefix="$$dc_install_base" \
$(DISTCHECK_CONFIGURE_FLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
&& $(MAKE) $(AM_MAKEFLAGS) check \
&& $(MAKE) $(AM_MAKEFLAGS) install \
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
&& $(MAKE) $(AM_MAKEFLAGS) uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
distuninstallcheck \
&& chmod -R a-w "$$dc_install_base" \
&& ({ \
(cd ../.. && umask 077 && mkdir "$$dc_destdir") \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
} || { rm -rf "$$dc_destdir"; exit 1; }) \
&& rm -rf "$$dc_destdir" \
&& $(MAKE) $(AM_MAKEFLAGS) dist \
&& rm -rf $(DIST_ARCHIVES) \
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck
$(am__remove_distdir)
@(echo "$(distdir) archives ready for distribution: "; \
list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}'
check-am: all-am
check: check-am
all-am: Makefile $(LTLIBRARIES) $(DATA) $(HEADERS) modconfig.h
installdirs:
for dir in "$(DESTDIR)$(pkglibdir)" "$(DESTDIR)$(docdir)"; do \
test -z "$$dir" || $(mkdir_p) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
mostlyclean-am
distclean: distclean-am
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-hdr distclean-libtool distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
info: info-am
info-am:
install-data-am: install-dist_docDATA
install-exec-am: install-pkglibLTLIBRARIES
install-info: install-info-am
install-man:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf $(top_srcdir)/autom4te.cache
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-dist_docDATA uninstall-info-am \
uninstall-pkglibLTLIBRARIES
.PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \
clean-generic clean-libtool clean-pkglibLTLIBRARIES ctags dist \
dist-all dist-bzip2 dist-gzip dist-shar dist-tarZ dist-zip \
distcheck distclean distclean-compile distclean-generic \
distclean-hdr distclean-libtool distclean-tags distcleancheck \
distdir distuninstallcheck dvi dvi-am html html-am info \
info-am install install-am install-data install-data-am \
install-dist_docDATA install-exec install-exec-am install-info \
install-info-am install-man install-pkglibLTLIBRARIES \
install-strip installcheck installcheck-am installdirs \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
pdf pdf-am ps ps-am tags uninstall uninstall-am \
uninstall-dist_docDATA uninstall-info-am \
uninstall-pkglibLTLIBRARIES
.c.o:
@USECCDV@ @echo "Building $@"
@am__fastdepCC_TRUE@ @if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
@am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
@am__fastdepCC_TRUE@ fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ @source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$<
$(OBJS): Makefile
.c.obj:
@USECCDV@ @echo "Building $@"
@am__fastdepCC_TRUE@ @if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
@am__fastdepCC_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
@am__fastdepCC_TRUE@ fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ @source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LTCOMPILE) -c `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`
logserv.o: logserv.c lgs_help.c logserv.h
log_procssing.o: logserv.h
.c.lo:
@USECCDV@ @echo "Building $@"
@am__fastdepCC_TRUE@ @if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
@am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; \
@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
@am__fastdepCC_TRUE@ fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ @source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<
install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
@$(NORMAL_INSTALL)
$(mkinstalldirs) $(DESTDIR)$(pkglibdir)
@list='ls .libs/*.so'; for p in $$list; do \
if test -f $$p; then \
f="`echo $$p | sed -e 's|^.*/||'`"; \
$(CCDV) $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(pkglibdir)/$$f; \
if test "x#" != "x@USECCDV@"; then echo "Installing $$f"; fi; \
else :; fi; \
done
install-binSCRIPTS: $(bin_SCRIPTS)
@$(NORMAL_INSTALL)
test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
@list='$(bin_SCRIPTS)'; for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
if test -f $$d$$p; then \
f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
$(CCDV) $(binSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(bindir)/$$f"; \
if test "x#" != "x@USECCDV@"; then echo "Installing $$f"; fi; \
else :; fi; \
done
install-dist_binSCRIPTS: $(dist_bin_SCRIPTS)
@$(NORMAL_INSTALL)
test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
@list='$(dist_bin_SCRIPTS)'; for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
if test -f $$d$$p; then \
f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
$(CCDV) $(dist_binSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(bindir)/$$f"; \
if test "x#" != "x@USECCDV@"; then echo "Installing $$f"; fi; \
else :; fi; \
done
install-dist_dataDATA: $(dist_data_DATA)
@$(NORMAL_INSTALL)
test -z "$(datadir)" || $(mkdir_p) "$(DESTDIR)$(datadir)"
@list='$(dist_data_DATA)'; for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
f=$(am__strip_dir) \
$(CCDV) $(dist_dataDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(datadir)/$$f"; \
if test "x#" != "x@USECCDV@"; then echo "Installing $$f"; fi; \
done
install-dist_docDATA: $(dist_doc_DATA)
@$(NORMAL_INSTALL)
test -z "$(docdir)" || $(mkdir_p) "$(DESTDIR)$(docdir)"
@list='$(dist_doc_DATA)'; for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
f=$(am__strip_dir) \
$(CCDV) $(dist_docDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(docdir)/$$f"; \
if test "x#" != "x@USECCDV@"; then echo "Installing $$f"; fi; \
done
install-includeHEADERS: $(include_HEADERS)
@$(NORMAL_INSTALL)
test -z "$(includedir)" || $(mkdir_p) "$(DESTDIR)$(includedir)"
@list='$(include_HEADERS)'; for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
f=$(am__strip_dir) \
$(CCDV) $(includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(includedir)/$$f"; \
if test "x#" != "x@USECCDV@"; then echo "Installing $$f"; fi; \
done
install-binPROGRAMS: $(bin_PROGRAMS)
@$(NORMAL_INSTALL)
test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
@list='$(bin_PROGRAMS)'; for p in $$list; do \
p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
if test -f $$p \
|| test -f $$p1 \
; then \
f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
$(CCDV) $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
if test "x#" != "x@USECCDV@"; then echo "Installing $$f"; fi; \
else :; fi; \
done
install-libLTLIBRARIES: $(lib_LTLIBRARIES)
@$(NORMAL_INSTALL)
test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)"
@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
if test -f $$p; then \
f=$(am__strip_dir) \
$(CCDV) $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \
if test "x#" != "x@USECCDV@"; then echo "Installing $$f"; fi; \
else :; fi; \
done
install-neoSCRIPTS: $(neo_SCRIPTS)
@$(NORMAL_INSTALL)
test -z "$(neodir)" || $(mkdir_p) "$(DESTDIR)$(neodir)"
@list='$(neo_SCRIPTS)'; for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
if test -f $$d$$p; then \
f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
$(CCDV) $(neoSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(neodir)/$$f"; \
else :; fi; \
done
distcleancheck:
@:
distuninstallcheck:
@:
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

View file

@ -2,7 +2,7 @@
LANG=C
# Channel log Directory. Where Logfiles are stored. Only need to change this
#if you installed neostats into a different prefix other than NeoStats
chanlogs="$HOME/NeoStats/ChanLogs/"
chanlogs="$HOME/NeoStats3.0/ChanLogs/"
# Onis Installation Path
onisinstall="$HOME/onis-0.4.9/"

View file

@ -1,2 +1,98 @@
LogServ 1.0
=====================================================================
FloodServ Manual
1. Installing and configuring FloodServ
---------------------------------------
This section explains how to install and configure FloodServ. We
recommend that you read this section in full before trying to install
FloodServ.
If you have any problems NOT addressed in this or other documents,
please see the Support section for how to contact us for help.
1.1 General notes
-----------------
All commands and filenames are case sensitive. This means that
NeoStats, floodserv, and FLOODSERV are all different things. When
typing commands you should use the same case as provided in this
file or things will not work correctly.
1.2 Getting Started
-------------------
First, you need to uncompress FloodServ. To do this type the following:
tar xvfz FloodServ3.0.x.tar.gz
This will vary depending on the version you run of FloodServ. Change the
x in FloodServ3.0.x.tar.gz to match your filename e.g.
FloodServ3.0.0.tar.gz
For systems that don't run a new version of tar you need to do this:
gzip -d FloodServ3.0.x.tar.gz
tar xvf FloodServ3.0.x.tar
1.3 Running configure
---------------------
You must first run the configure script so that FloodServ can determine
your build environment.
To run configure, you must first change to the directory where you
uncompressed FloodServ. e.g.
cd ~/FloodServ3.0.0
Your prompt should look something like:
[user@host FloodServ3.0.0]
Now type:
./configure
The configure script will then check to see if all necessary programs to
run FloodServ are installed on your system.
Optional settings:
------------------
There are some options you can pass to configure if you wish.
Debugging:
Most users will never look at this option. It compiles FloodServ
with debugging turned on. I would only suggest using this if you
have problems and are about to fill out a bug form.
--enable-debug Enables Debugging
1.4 Compiling FloodServ
-----------------------
Ok, you should now be back at a shell prompt, type:
make
it will go through the source and compile it into an executable
binary file.
1.5 Installing FloodServ
------------------------
To install FloodServ type:
make install
This will create the necessary files, and copy them to the
installation directory.

49
README.LogServ.html Normal file

File diff suppressed because one or more lines are too long

629
README.LogServ.xml Normal file
View file

@ -0,0 +1,629 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
<article>
<title>ModuleName 3.0 Manual</title>
<para>Welcome to the ModuleName Manual. This document will aid you in
setting up and running ModuleName on your IRC network.</para>
<para>&lt;add module introduction&gt;</para>
<para>ModuleName is Copyright, 2006 by Justin Hammond.</para>
<sect1>
<title>Prerequisites and Installation.</title>
<para>ModuleName is designed to run on Top of NeoStats. The Following
requirements at the time of writing are required for
NeoStats:<itemizedlist>
<listitem>
<para>A Linux or BSD based Server or Shell.</para>
</listitem>
<listitem>
<para>A IRCd supported by NeoStats. See the <link
linkend="???">NeoStats</link> website.</para>
</listitem>
<listitem>
<para>Some basic Unix administration Skill</para>
</listitem>
<listitem>
<para>Of Course, a IRC network to connect it all together.</para>
</listitem>
</itemizedlist></para>
<para>Please refer to the NeoStats website for more information on the
requirements</para>
<para>ModuleName itself requires the following:<itemizedlist>
<listitem>
<para>NeoStats 3.0 or Higher correctly installed and Running</para>
</listitem>
<listitem>
<para>The time to read this entire document. </para>
</listitem>
</itemizedlist></para>
<sect2>
<title>Compiling and Installation</title>
<para>As long as you have successfully setup NeoStats, and installed it
correctly, Compiling ModuleName is very simple and straight forward.
First you must extract the files from the download package. This is as
simple as:</para>
<screen>bash$<command> tar -xzf ModuleName-&lt;ver&gt;.tar.gz</command></screen>
<para>This should then create a directory called
ModuleName-&lt;version&gt; where &lt;version&gt; is the Version of
ModuleName. Then Proceed to Change into the ModuleName directory, and
run Configure as follows:<screen>bash$<command>./configure [--enable-debug | --with-neostats=&lt;dir&gt;]</command></screen></para>
<para>--enable-debug is only useful for diagnostics purposes when used
in conjunction with debugging tools. There should be no need to use this
option on a day to day basis</para>
<para>--with-neostats=&lt;dir&gt; should be used if your neostats
directory is not in a standard location (~/NeoStats/). Replace
&lt;dir&gt; with the full path to your NeoStats installation directory
(NOT SOURCE DIRECTORY)</para>
<para>Configuring ModuleName will look something like the following
screen:</para>
<screen>Fishs-Mac:~/Documents/Dev/ModuleName justin$ ./configure
checking whether to enable maintainer-specific portions of Makefiles... no
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... no
checking for mawk... no
checking for nawk... no
&lt;snip&gt;
checking To Enable AutoTools Debug Mode?... no
checking silent building of source files... Enabled
configure: creating ./config.status
config.status: creating Makefile
config.status: creating modconfig.h
config.status: modconfig.h is unchanged
config.status: executing depfiles commands
Configuration complete.
Press Enter key to read the release notes</screen>
<para>The Configure process will then prompt you to read the release
notes. You are encouraged to read this document throughly as it might
contain important information about the current version of ModuleName
that isn't covered in the manual.</para>
<para>If the configuration did not produce a error, you may then move
onto Compiling ModuleName. Compiling is simply just issuing the "make"
command (or "gmake" if you are running BSD):</para>
<screen>Fishs-Mac:~/Documents/Dev/ModuleName justin$ make
make -s all-am
Compiling Helpers.c: [OK]
Compiling ModuleName.c: [OK]
Compiling scan.c: [OK]
Compiling OnJoinBot.c: [OK]
Compiling ModuleName_help.c: [OK]
Compiling update.c: [OK] </screen>
<para>Again, check for Error messages. As long as there are not error
messages, "make install" will install ModuleName, this README file, and
any auxiliary files needed into your NeoStats directory:</para>
<screen>Fishs-Mac:~/Documents/Dev/ModuleName justin$ make install
Installing ModuleName.so: [OK]
Installing viri.dat: [OK]
Installing README.ModuleName: [OK]
Installing README.ModuleName.html: [OK] </screen>
<para>If you receive *ANY* errors at all during the this process, please
post them on our Support boards, at
http//www.neostats.net/boards/</para>
<para>Once Installation is complete, you can either configure NeoStats
to load ModuleName when it starts, or load ModuleName via IRC.</para>
<para>To Configure NeoStats to automatically load ModuleName when it
boots, modify the neostats.conf file and add ModuleName to the list of
modules to load:</para>
<screen>MODULENAME = {
"statserv",
"hostserv",
"ModuleName",
} </screen>
<para>To load ModuleName via IRC, you must make sure you have the
appropriate permissions and issue the following command:</para>
<para><command>/msg neostats load ModuleName</command></para>
<para>Thats it. ModuleName is now loaded and ready for use (in fact, it
will already be running now, but read on for further
information.)</para>
</sect2>
</sect1>
<sect1>
<title>Basic Configuration</title>
<para>ModuleName is completely configured online via IRC. When you first
start up ModuleName, it attempts some "Sane" defaults for you get started
with, but you should always review these settings as soon as you install.
There are a few important settings you may want to review right away. They
are:</para>
<itemizedlist>
<listitem>
<para>blah blah</para>
</listitem>
<listitem>
<para>blah blah</para>
</listitem>
<listitem>
<para>blah blah</para>
</listitem>
</itemizedlist>
<para>These are outlined below:</para>
<sect2>
<title>Blah Blah</title>
<para>Blah Blah</para>
</sect2>
<sect2>
<title>Blah Blah</title>
<para>BLAH BLAH</para>
</sect2>
</sect1>
<sect1>
<title>Detailed Configuration</title>
<para>ModuleName attempts to be as configurable as possible in order to
cater for each individual networks requirements. This in turn though makes
the configuration very complex. There are many many settings with
ModuleName that affect how it operates, how it responds and even, how
affects the performance of NeoStats Overall. Out of the box, ModuleName
provides sensible defaults for these settings, but you may wish to read
this section for details on exactly what each option does, and its affect
on how ModuleName operates.</para>
<para>The following list summaries the available options you can set in
ModuleName</para>
<itemizedlist>
<listitem>
<para>NICK</para>
</listitem>
<listitem>
<para>ALTNICK</para>
</listitem>
<listitem>
<para>USER</para>
</listitem>
<listitem>
<para>HOST</para>
</listitem>
<listitem>
<para>REALNAME</para>
</listitem>
<listitem>
<para>EXCLUSIONS</para>
</listitem>
<listitem>
<para>BLAHBLAH</para>
</listitem>
</itemizedlist>
<para>To change any of these settings, you use the Set Interface in
ModuleName. Eg:</para>
<screen>/msg ModuleName set &lt;option&gt; &lt;params&gt;</screen>
<para>To view the current settings, issue the following command:</para>
<screen>/msg ModuleName set list</screen>
<para>The following Sections describes the different options, their
params, and the effect on ModuleName in detail.</para>
<sect2>
<title>NICK Setting</title>
<para>This setting allows you to change the Nickname that ModuleName
uses when it connects to your network. If you change this setting make
sure you update your NeoNet account, otherwise you might loose access to
the Secure IRC-Chat site if we perform a check on your network and can't
find "ModuleName" running.</para>
<warning>
<para>This option requires you to reload ModuleName or restart
NeoStats to take effect.</para>
</warning>
<screen>/msg ModuleName set NICK &lt;nickname&gt;</screen>
</sect2>
<sect2>
<title>ALTNICK Setting</title>
<para>This setting allows you to set a "Backup" nickname used for
ModuleName. If the primary Nickname in the NICK Setting is not
available, ModuleName will use this nickname, and if that is not
available, it will use a automatically generated nickname</para>
<warning>
<para>This option requires you to reload ModuleName or restart
NeoStats to take effect</para>
</warning>
<screen>/msg ModuleName set ALTNICK &lt;nickname&gt;</screen>
</sect2>
<sect2>
<title>USER Setting</title>
<para>This option allows you to customize the "user" or ident portion of
the ModuleName Bot. </para>
<warning>
<para>This option requires you to reload ModuleName or restart
NeoStats to take effect</para>
</warning>
<screen>/msg ModuleName set USER &lt;user&gt;</screen>
</sect2>
<sect2>
<title>HOST Setting</title>
<para>This option allows you to customize the Hostname that ModuleName
uses when it signs onto your Network. It defaults to the Standard
Hostname specified in your NeoStats configuration.</para>
<warning>
<para>This option requires you to reload ModuleName or restart
NeoStats to take effect</para>
</warning>
<screen>/msg ModuleName set HOST &lt;host&gt;</screen>
</sect2>
<sect2>
<title>REALNAME Setting</title>
<para>This option allows you to customize the realname (or Gecos) that
ModuleName uses when it signs onto your Network. </para>
<warning>
<para>This option requires you to reload ModuleName or restart
NeoStats to take effect</para>
</warning>
<screen>/msg ModuleName set REALNAME &lt;realname&gt;</screen>
</sect2>
<sect2>
<title>EXCLUSIONS Setting</title>
<para>This option enables ModuleName to use the Global Exclusions list
that is control by the main NeoStats bot. This allows you to maintain a
"global" exclusion list that is applicable to all modules in NeoStats,
and then only apply individual exclusions to ModuleName. </para>
<warning>
<para>This option only becomes effective on new users joining your
Network. Existing users that are already connected when you enable
this option will not be rescanned for exclusions, as the Global
Exclusions are only effected when a new user signs onto the Network.
In order to make the global exclusions list effective straight away,
you should restart NeoStats.</para>
</warning>
<para>If you wish to enable or disable the Global Exclusions lists,
issue the following command</para>
<screen>/msg ModuleName set EXCLUSIONS &lt;ON/OFF&gt;</screen>
</sect2>
<sect2>
<title>BLAH Blah Setting</title>
<para>blah blah description</para>
<para>To Change the setting, issue the following Command:</para>
<screen>/msg ModuleName set blahblah &lt;blah&gt; </screen>
</sect2>
</sect1>
<sect1>
<title>Operational Commands</title>
<para>ModuleName has a number of commands that you can issue it in order
to perform checks or operations on your IRC network. These commands aid
Administrators in keeping their network secure, and keeping ModuleName
upto date.</para>
<para>The following list summarizes these commands:</para>
<itemizedlist>
<listitem>
<para>HELP</para>
</listitem>
<listitem>
<para>VERSION</para>
</listitem>
<listitem>
<para>ABOUT</para>
</listitem>
<listitem>
<para>CREDITS</para>
</listitem>
<listitem>
<para>LEVELS</para>
</listitem>
<listitem>
<para>SET</para>
</listitem>
<listitem>
<para>EXCLUDE</para>
</listitem>
<listitem>
<para>BLAHBLAH</para>
</listitem>
</itemizedlist>
<para>The following Sections Describe these commands in detail</para>
<sect2>
<title>HELP Command</title>
<para>The help command allows the users to access the online help for
the different commands available. You can get general help about the
available commands, or can access more specific information about a
command.</para>
<para>To see the help pages, use the following format:</para>
<screen>/msg ModuleName help [command]
</screen>
<para>command is optional and only required if you want more specific
information about a particular command</para>
</sect2>
<sect2>
<title>VERSION Command</title>
<para>This command displays the Version of ModuleName, and the dat
files. </para>
<para>The format of the command is as follows:</para>
<screen>/msg ModuleName version
</screen>
</sect2>
<sect2>
<title>ABOUT Command</title>
<para>The about command shows a brief description of the Bot and its
purpose.</para>
<para>The format of the command is as follows:</para>
<screen>/msg ModuleName about
</screen>
</sect2>
<sect2>
<title>CREDITS Command</title>
<para>The credits command shows details about the authors or
contributors of to the Module</para>
<para>The format of the command is as follows:</para>
<screen>/msg ModuleName credits
</screen>
</sect2>
<sect2>
<title>LEVELS Command</title>
<para>The levels command allows you to adjust the security of each
command available in this module. You can make certian commands only
available to higher "level" users in NeoStats. </para>
<para>For more information about NeoStats Levels and Security, please
consult the NeoStats Manual</para>
<para>To list the currently configured levels, issue the following
command:</para>
<screen>/msg ModuleName levels list
</screen>
<para>To change the minimum level required to execute a command, issue
the following command:</para>
<screen>/msg ModuleName levels &lt;command&gt; &lt;level&gt;</screen>
<para>Where:</para>
<para>command = is the actual command name you wish to modify</para>
<para>level = a number between 0 and 200 that specifies the new
level.</para>
</sect2>
<sect2>
<title>SET Command</title>
<para>The set command allows you to modify settings applicable to this
module. For a complete description of the available set options, please
consult the Detailed Configuration Section of this manual.</para>
</sect2>
<sect2>
<title>EXCLUDE Command</title>
<para>Exclusion lists allow you to specify certain Hostmasks, Servers,
or Channels that should be excluded from monitoring by ModuleName. This
exclusion list would allow a administrator to say, allow users on that
are matched against Trojans, when the administrator has verified that
the Trojan does not in fact exist on the users host.</para>
<caution>
<para>Exclusions should be setup for your Services Server, so that
ModuleName does not try to scan ChanServ, or NickServ, or any of the
bots relating to Nickname protection.</para>
</caution>
<para>With NeoStats 3.0, you should also be aware that there are two
types of Exclusion Lists. There are "Global" exclusion lists that all
modules may optionally use, and there is module specific exclusion
lists. ModuleName defaults to not using the Global Exclusion lists. You
can enable it by the following command:<screen>/msg ModuleName set exclusions on</screen></para>
<para><emphasis role="bold">Adding a Entry</emphasis></para>
<para>To add a entry to the Exclusion list, use the following
format:</para>
<screen>/msg ModuleName exclude add &lt;host/Server/Channel/UserHost&gt; &lt;pattern&gt; &lt;reason&gt;</screen>
<para>Where:</para>
<para>&lt;Host/Server/Channel/UserHost&gt; = The type of exclusion you
are adding. The different types are:<itemizedlist>
<listitem>
<para>Host - The Users real (Internet) Hostname</para>
</listitem>
<listitem>
<para>Server - The Users server they are connecting to. You should
ensure you add a exclusion for your Services Server</para>
</listitem>
<listitem>
<para>Channel - A specific channel on your IRC Network</para>
</listitem>
<listitem>
<para>UserHost - The users Virtual Hostname (IRC)</para>
</listitem>
</itemizedlist></para>
<para>&lt;pattern&gt; = The pattern you wish to match on. May include
wildcard charactors such as * and ?</para>
<para>&lt;reason&gt; = a short description of the exclusion, for
operator reference only.</para>
<para>The output is as follows:</para>
<screen>[13:20] -ModuleName- Added *.blah.com (userhost) to exclusion list
[13:20] ModuleName Fish added *.blah.com (userhost) to the exclusion list</screen>
<para><emphasis role="bold">Listing an Entry</emphasis></para>
<para>To list the Exclusions simple type:</para>
<screen>/msg ModuleName exclude list</screen>
<para>And all the current exclusions are listed. Additionally, a
Position number is provided for use with the delete command. The output
is as follows:</para>
<screen>[13:21] -ModuleName- Exclusion list:
[13:21] -ModuleName- #bothouse (Channel) Added by Fish on Sat Aug 13 2005 01:20 AM SGT for Requested
[13:21] -ModuleName- #ircop (Channel) Added by Fish on Sat Aug 13 2005 07:40 PM SGT for IRCop channel
[13:21] -ModuleName- *irc-chat.net (Host) Added by Fish on Tue Aug 09 2005 10:13 PM SGT for Services Exclusion
[13:21] -ModuleName- chieftess!*@* (Userhost) Added by Fish on Tue Aug 09 2005 10:14 PM SGT for buggy client
[13:21] -ModuleName- *.blah.com (Userhost) Added by Fish on Sun Jan 15 2006 01:20 PM SGT for Cause Blah.com is cool
[13:21] -ModuleName- End of list.</screen>
<para><emphasis role="bold">Deleting an Entry</emphasis></para>
<para>To delete a entry, you should first lookup the Position of the
entry that you wish to delete. The format of the command is as
follows:</para>
<screen>/msg ModuleName exclude del &lt;pattern&gt;</screen>
<para>Where:</para>
<para>&lt;pattern&gt; is the pattern of the entry you wish to delete in
the list</para>
<para>The output of the command is as follows:</para>
<screen>[13:22] ModuleName Fish used EXCLUDE
[13:22] -ModuleName- *.blah.com delete from exclusion list</screen>
</sect2>
<sect2>
<title>BLAHBLAH Command</title>
<para>That command forces ModuleName to check the Dat File version at
<link linkend="???">http://secure.irc-chat.net/</link> and download the
latest version if required.</para>
<warning>
<para>Repeated use of this command in a short period of time will
result in your account at secure.irc-chat.net being suspended for
abuse. Use with CARE</para>
</warning>
<para>The format of the command is as follows:</para>
<screen>/msg ModuleName update</screen>
</sect2>
</sect1>
<sect1>
<title>Optional Chapter</title>
<para>use this to write any optional information etc etc etc</para>
<sect2>
<title>Optional Sub Heading</title>
<para>Subheading</para>
<sect3>
<title>Minor heading</title>
<para>minor heading</para>
</sect3>
</sect2>
</sect1>
</article>

28
RELNOTES Executable file
View file

@ -0,0 +1,28 @@
* LogServ * Version 3.0.a3
==============================================================================
Important information you should know: (READ THIS!)
==============================================================================
This is an alpha release. Not all features will work and there may be major
bugs in the software. This release is purely for us to get feedback on the new
version of NeoStats and should not be run on production networks. This release
is ideal for users with test networks or those that want an opportunity to
help us develop the new version with feedback and suggestions.
No support is provided for this release so if you have problems and are unable
to resolve them using the provided documentation, you should use the supported
stable 2.5 series instead until NeoStats 3.0 is further along.
Bugs, requests and suggestions should be reported using the bug tracking
system. You must provide all information required as listed in the README
section on support or your entry will be removed.
Settings and data files from 2.5.x will not work with 3.0.
Settings and data files for previous 3.0 alpha versions may not be compatible
with this version. You should delete all files with "gdbm" in the filename
from the directory ~/NeoStats 3.0/data before using this version.
Known issues that we are aware of and should not be reported:
* None at present

7272
aclocal.m4 vendored Normal file

File diff suppressed because it is too large Load diff

11253
configure vendored

File diff suppressed because it is too large Load diff

View file

@ -1,20 +1,29 @@
dnl Process this file with autoconf to produce a configure script.
AC_INIT(logserv.c)
AC_CONFIG_HEADER(modconfig.h)
PACKAGE=LogServ
MODULE_MAJOR=1
MODULE_MINOR=2
VERSION=$MODULE_MAJOR.$MODULE_MINOR
AC_DEFINE_UNQUOTED(MODULE_VERSION, "$VERSION")
AC_DEFINE_UNQUOTED(MODULE_MAJOR, "$MODULE_MAJOR")
AC_DEFINE_UNQUOTED(MODULE_MINOR, "$MODULE_MINOR")
DIRINST=~/NeoStats/
AC_PREFIX_DEFAULT(~/NeoStats/)
CFLAGS="$CFLAGS -O2"
AC_CONFIG_AUX_DIR(autotools)
AM_CONFIG_HEADER(modconfig.h)
AM_MAINTAINER_MODE
MODPACKAGE=LogServ
MODULE_MAJOR=3
MODULE_MINOR=0
MODULE_REV=a4
VERSION=$MODULE_MAJOR.$MODULE_MINOR.$MODULE_REV
AC_DEFINE_UNQUOTED(MODULE_VERSION, "$VERSION", "Complete Module Version")
AC_DEFINE_UNQUOTED(MODULE_MAJOR, $MODULE_MAJOR, "Major Module Version")
AC_DEFINE_UNQUOTED(MODULE_MINOR, $MODULE_MINOR, "Minor Module Version")
AC_DEFINE_UNQUOTED(MODULE_REV, $MODULE_REV, "Module Revision")
DIRINST=~/NeoStats3.0/
AC_PREFIX_DEFAULT(~/NeoStats3.0/)
AM_INIT_AUTOMAKE($MODPACKAGE, $VERSION)
#AM_INIT_AUTOMAKE("","")
CFLAGS="$CFLAGS -g -O2 -fno-strict-aliasing"
dnl Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL
AC_DISABLE_STATIC
CARES_CLEAR_LIBTOOL_TAGS
AC_PROG_LIBTOOL
AC_MSG_CHECKING(Location of NeoStats...)
AC_ARG_WITH(neostats,
@ -22,8 +31,7 @@ AC_ARG_WITH(neostats,
[DIRINST=$withval])
AC_MSG_RESULT($DIRINST)
AC_CHECK_FILE($DIRINST/include/dl.h,
AC_CHECK_FILE($DIRINST/include/neostats.h,
[INCLUDEDIR="$DIRINST/include/"],
[AC_MSG_ERROR(Can't find existing NeoStats Installation please supply with --with-neostats option)])
@ -35,11 +43,9 @@ AC_TRY_RUN(
#include <config.h>
#include <stdlib.h>
int main(void) {
if (MAJOR >= 2) {
if (MINOR >= 5) {
if (REV >= 13) {
exit(0);
}
if (MAJOR >= 3) {
if (MINOR >= 0) {
exit(0);
}
}
exit(1);
@ -48,21 +54,21 @@ int main(void) {
ns_version_ok='no',
ns_version_ok='no')
if test "$ns_version_ok" = "yes"; then
AC_MSG_RESULT(Compatible Version);
AC_MSG_RESULT(Compatible version);
prefix=$DIRINST
else
AC_MSG_ERROR(This Module requires NeoStats 2.5.13 or Higher)
AC_MSG_ERROR(This module requires NeoStats 3.0.a3-dev or higher)
fi
dnl check if we are running with Debug....
AC_MSG_CHECKING(Whether to Enable Debuging...)
dnl check if we are running with debug....
AC_MSG_CHECKING(Whether to enable debug...)
AC_ARG_ENABLE(debug,
[ --enable-debug - Enable Debuging],
[ --enable-debug - enable debug],
[ case "$enableval" in
yes)
CFLAGS="$CFLAGS -Wall -ggdb"
AC_DEFINE(DEBUG,1)
AC_MSG_RESULT(yes - Watch your Log Files)
AC_DEFINE(DEBUG, "1", "Enable Debugging")
AC_MSG_RESULT(yes)
;;
*)
AC_MSG_RESULT(no)
@ -71,24 +77,40 @@ AC_ARG_ENABLE(debug,
AC_MSG_RESULT(no)
)
wi_ARG_DISABLE_CCDV
wi_PROG_CCDV
AC_MSG_CHECKING(To Enable AutoTools Debug Mode?)
AC_ARG_ENABLE(autodebug, [ --enable-autodebug - Enable AutoTools Debug],
[ case "$enableval" in
yes)
AC_MSG_RESULT(yes)
;;
*)
AC_MSG_RESULT(no)
AX_MAINTAINER_MODE_AUTO_SILENT
;;
esac],
AC_MSG_RESULT(no)
AX_MAINTAINER_MODE_AUTO_SILENT
)
CFLAGS="$CFLAGS -DBUILDINGMOD"
AX_DISTVERSION
AC_SUBST(DIRINST)
AC_SUBST(CFLAGS)
AC_SUBST(LDFLAGS)
AC_SUBST(PACKAGE)
AC_SUBST(VERSION)
AC_SUBST(LIBTOOL_DEPS)
AC_SUBST(CCDV)
AC_OUTPUT(Makefile)
echo "(*----------------------------------------------------------*)"
echo "(| Important Instructions |)"
echo "(*----------------------------------------------------------*)"
echo "(| Now that configure is complete, type 'make' to compile |)"
echo "(| the module. When the compile has completed, type |)"
echo "(| 'make install' to install the module. |)"
echo "(| For BSD you might need to use 'gmake' and 'gmake install'|)"
echo "(*----------------------------------------------------------*)"
echo "(| For Support please visit: |)"
echo "(| IRC: /server irc.irc-chat.org |)"
echo "(| #neostats channel |)"
echo "(| WWW: http://www.neostats.net/boards/ |)"
echo "(*----------------------------------------------------------*)"
echo "(|This Module was written by: |)"
echo "(| fish (fish@dynam.ac) |)"
echo "(*----------------------------------------------------------*)"
echo "Configuration complete."
read -p "Press Enter key to read the release notes"
clear
more RELNOTES
echo "Run 'make' (or 'gmake' on some systems) to compile NeoStats."
echo "If you require support, see the README file."

110
help.c Normal file
View file

@ -0,0 +1,110 @@
/* NeoStats - IRC Statistical Services
** Copyright (c) 1999-2006 Adam Rutter, Justin Hammond, Mark Hetherington
** http://www.neostats.net/
**
** 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
**
** NeoStats CVS Identification
** $Id: ss_help.c 1086 2004-12-12 20:15:54Z Mark $
*/
#include "neostats.h"
const char *ls_about[] = {
"\2LogServ\2 provides a channel logging service that",
"can be used to generate statistical information.",
NULL
};
const char *ls_help_add[] = {
"Add channel to log",
"Syntax: \2ADD \37<#channel name> <PUBLIC|PRIVATE> [url]\37\2",
"",
"Adds a channel to LogServ for Monitoring. ",
"Use PUBLIC to announce to the channel that logging has started",
"or PRIVATE to avoid this announcement.",
"You can provide an optional URL to display to users when they join",
"the channel showing where users can view channel statistics",
NULL
};
const char *ls_help_del[] = {
"Stop logging channel",
"Syntax: \2DEL \37<#channel name>\37\2",
"",
"Deletes a logged channel from LogServ",
"Requires the channel name",
NULL
};
const char *ls_help_list[] = {
"List current channel log list",
"Syntax: \2LIST\2",
"",
"Lists the channels that LogServ is currently logging",
NULL
};
const char *ls_help_url[] = {
"Change channel URL",
"Syntax: \2URL \37<#channel name> <url>\37\2",
"",
"Modifies the URL for the stats on that channel",
NULL
};
const char *ls_help_status[] = {
"Simple LogServ Stats",
"Syntax: \2STATUS\2",
"",
"Displays some simple status about LogServ",
NULL
};
const char *ls_help_set_logtype[] = {
"\2LOGTYPE\2 <type>",
"",
"Modifies the logfile format that LogServ uses.",
"The options are:",
"\2 1\2 - EggDrop Format",
"\2 2\2 - Mirc Format",
"\2 3\2 - Xchat Format",
"",
"You should restart NeoStats, or reload the LogServ module after changing",
"the log file format so new log files will be created",
NULL
};
const char *ls_help_set_logsize[] = {
"\2LOGSIZE\2 <bytes>",
"File size in bytes at which a logfile is automatically rotated",
NULL
};
const char *ls_help_set_logtime[] = {
"\2LOGAGE\2 <seconds> - Specify the age in seconds that we rotate the log file, regardless of log file size",
NULL
};
const char *ls_help_set_logdir[] = {
"\2LOGDIR\2 <path> - path for log files",
NULL
};
const char *ls_help_set_savedir[] = {
"\2SAVEDIR\2 <path> - path for save log files",
NULL
};

View file

@ -1,97 +0,0 @@
/* NeoStats - IRC Statistical Services
** Copyright (c) 1999-2004 Adam Rutter, Justin Hammond
** http://www.neostats.net/
**
** Portions Copyright (c) 2000-2001 ^Enigma^
**
** Portions Copyright (c) 1999 Johnathan George net@lite.net
**
** 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
**
** NeoStats CVS Identification
** $Id: ss_help.c 1086 2004-12-12 20:15:54Z Mark $
*/
#include "neostats.h"
const char lgs_help_about_oneline[]="About LogServ";
const char lgs_help_version_oneline[]="Shows you the current LogServ Version";
const char lgs_help_chan_oneline[]="Manipulate Channel Logging List";
const char lgs_help_stats_oneline[]="Simple LogServ Stats";
const char *lgs_help_about[] = {
"\2LogServ\2 provides a Logging Service for Channels on IRC",
"That can be used to generate statistical information about the channel",
NULL
};
const char *lgs_help_chan[] = {
"Syntax: \2CHANS \37ADD <Channame> <\"public\"/\"private\"> <url>\37\2",
" \2CHANS \37DEL <Channame>\37\2",
" \2CHANS \37LIST\37\2",
" \2CHANS \37SET URL <url>\37\2",
"",
"Provides Logging Services for Channels on the network",
"\2ADD\2 Adds a channel to LogServ for Monitoring. You must specify:",
" The Channel Name",
" Public/Private to indicate if the logging for this channel should be",
" made known to users",
" a URL to display when joining the channel showing where users can view",
" Statistics about the channel",
"\2DEL\2 Deletes a logged channel from LogServ",
" Requires the channel name",
"\2LIST\2 Lists the channels that LogServ is currently logging",
"\2SET\2 Modifies certain features of LogServ on that channel",
" Those options include:",
" \2URL\2 - Modifies the URL for the stats on that channel",
NULL
};
const char *lgs_help_stats[] = {
"Syntax: \2STATS\2",
" \2STATS\2 displays some simple stats about LogServ",
NULL
};
const char *lgs_help_version[] = {
"Displays LogServ's Version Number",
NULL
};
const char *lgs_help_set_logtype[] = {
"\2LOGTYPE\2 <type>",
"Modifies the logfile format that LogServ uses.",
"The options are:",
"\2 1\2 - EggDrop Format",
"\2 2\2 - Mirc Format",
"\2 3\2 - Xchat Format",
"",
"You should restart NeoStats, or reload the LogServ module after changing",
"the log file format so new log files will be created",
NULL
};
const char *lgs_help_set_logsize[] = {
"\2LOGSIZE\2 <bytes> - Specify the size in bytes at which a logfile is automatically",
"rotated",
NULL
};
const char *lgs_help_set_logtime[] = {
"\2LOGAGE\2 <seconds> - Specify the age in seconds that we rotate the log file, regardless of log file size",
NULL
};

View file

@ -1,711 +0,0 @@
/* NeoStats - IRC Statistical Services
** Copyright (c) 1999-2004 Justin Hammond
** http://www.neostats.net/
**
** 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
**
** NeoStats CVS Identification
** $Id$
*/
/** template.c
* You can copy this file as a template for writing your own modules
*/
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include "logserv.h" /* LogServ Definitions */
/* only check logfile size every X calls */
#ifdef DEBUG
#define DOSIZE 1
#else
#define DOSIZE 50
#endif
char timebuf[TIMEBUFSIZE];
char startlog[BUFSIZE];
static void lgs_write_log(ChannelLog *cl, char *fmt, ...) __attribute__((format(printf,2,3)));
static int lgs_open_log(ChannelLog *cl);
static void lgs_stat_file(ChannelLog *cl);
static char *logserv_startlog(ChannelLog *cl);
static char *mirc_startlog(ChannelLog *cl);
static char *egg_startlog(ChannelLog *cl);
static char *xchat_startlog(ChannelLog *cl);
/* This was taken from DircProxy
* but is actually a pretty handy function.
* maybe it should go in the core?
*/
#ifndef safe_channame
/* @brief Make the name of a logfile safe for a filename
*
* given a name, make sure its a safe name for a filename
*
* @params name the name to check. Warning, the name is modified
*
* @returns a modified version of the name, that is safe to use as a filename
*/
static char *_irclog_safe(char *name) {
char *ptr;
/* Channel names are allowed to contain . and / according to the IRC
protocol. These are nasty as it means someone could theoretically
create a channel called #/../../etc/passwd and the program would try
to unlink "/tmp/#/../../etc/passwd" = "/etc/passwd". If running as root
this could be bad. So to compensate we replace '/' with ':' as thats not
valid in channel names. */
ptr = name;
while (*ptr) {
switch (*ptr) {
case '/':
*ptr = ':';
break;
}
ptr++;
}
return name;
}
#define safe_channame(x) _irclog_safe(x)
#endif
/* @brief write a formatted log to the log files, and check if we should switch th logfile
*
* writes a message to a log file. If the logfile hasn't been opened yet, we
* open it, and write out any headers required.
*
* @params cl The ChannelLog structreu for the channel we are loggin
* @params fmt the printf style format of the log message
*/
static void lgs_write_log(ChannelLog *cl, char *fmt, ...) {
va_list ap;
char log_buf[BUFSIZE];
/* format the string to write */
va_start (ap, fmt);
ircvsnprintf (log_buf, BUFSIZE, fmt, ap);
va_end (ap);
/* if the FD isn't opened yet, lets open a log file */
if (!(cl->flags & LGSFDOPENED)) {
if (!lgs_open_log(cl)) {
return;
}
/* ok, we just opened the file, write the start out */
switch (LogServ.logtype) {
case 0:
fprintf(cl->logfile, "%s", logserv_startlog(cl));
break;
case 1:
fprintf(cl->logfile, "%s", egg_startlog(cl));
break;
case 2:
fprintf(cl->logfile, "%s", mirc_startlog(cl));
break;
case 3:
fprintf(cl->logfile, "%s", xchat_startlog(cl));
break;
default:
nlog(LOG_WARNING, LOG_MOD, "Unknown LogType");
}
}
/* ok, file is opened. write the string to it */
#ifdef DEBUG
printf("%s\n", log_buf);
#endif
fprintf(cl->logfile, "%s", log_buf);
cl->dostat++;
#ifdef DEBUG
/* only flush the logfile in debug mode */
fflush(cl->logfile);
#endif
/* ok, now stat the file to check size */
if (cl->dostat >= DOSIZE) {
fflush(cl->logfile);
lgs_stat_file(cl);
}
}
/* @brief Opens the log file, creating directories where necessary
*
* @param cl the channel log function
*
* @returns a boolen indicating success/failure
*/
static int lgs_open_log(ChannelLog *cl) {
struct stat st;
int res;
char fname[MAXPATH];
/* first, make sure the logdir dir exists */
res = stat(LogServ.logdir, &st);
if (res != 0) {
/* hrm, error */
if (errno == ENOENT) {
/* ok, it doesn't exist, create it */
res = mkdir(LogServ.logdir, 0700);
if (res != 0) {
/* error */
nlog(LOG_CRITICAL, LOG_MOD, "Couldn't create LogDir Directory: %s", strerror(errno));
return NS_FAILURE;
}
nlog(LOG_NOTICE, LOG_MOD, "Created Channel Logging Dir %s", LogServ.logdir);
} else {
nlog(LOG_CRITICAL, LOG_MOD, "Stat Returned A error: %s", strerror(errno));
return NS_FAILURE;
}
} else if (!S_ISDIR(st.st_mode)) {
nlog(LOG_CRITICAL, LOG_MOD, "%s is not a Directory", LogServ.logdir);
return NS_FAILURE;
}
/* copy name to the filename holder (in case of invalid paths) */
strlcpy(cl->filename, cl->channame, MAXPATH);
ircsnprintf(fname, MAXPATH, "%s/%s.log", LogServ.logdir, safe_channame(cl->filename));
/* open the file */
cl->logfile = fopen(fname, "a");
if (!cl->logfile) {
nlog(LOG_CRITICAL, LOG_MOD, "Could not open %s for Appending: %s", cl->filename, strerror(errno));
return NS_FAILURE;
}
nlog(LOG_DEBUG1, LOG_MOD, "Opened %s for Appending", cl->filename);
/* set hte flag */
cl->flags |= LGSFDOPENED;
cl->fdopened = me.now;
return NS_SUCCESS;
}
/* @brief check the logfile size, and rotate if necessary
*
* @param cl the ChannelLog struct for the channel we are checking
*/
static void lgs_stat_file(ChannelLog *cl) {
struct stat st;
int res;
char fname[MAXPATH];
/* reset this counter */
cl->dostat = 0;
/* construct the filename to stat */
ircsnprintf(fname, MAXPATH, "%s/%s.log", LogServ.logdir, cl->filename);
res = stat(fname, &st);
if (res != 0) {
if (errno == ENOENT) {
/* wtf, this is bad */
nlog(LOG_CRITICAL, LOG_MOD, "LogFile went away: %s", fname);
return;
} else {
nlog(LOG_CRITICAL, LOG_MOD, "Logfile Error: %s", strerror(errno));
return;
}
}
nlog(LOG_DEBUG1, LOG_MOD, "Logfile Size of %s is %d", fname, (int)st.st_size);
if (st.st_size > LogServ.maxlogsize) {
nlog(LOG_DEBUG1, LOG_MOD, "Switching Logfile %s", fname);
/* ok, the file exceeds out limits, lets switch it */
lgs_switch_file(cl);
}
}
/* @brief actually switch the logfile, saving the old log in a different directory
*
* @param cl the ChannelLog struct
*/
void lgs_switch_file(ChannelLog *cl) {
struct stat st;
char tmbuf[MAXPATH];
char newfname[MAXPATH];
char oldfname[MAXPATH];
char savedir[MAXPATH];
int res;
if (!(cl->flags & LGSFDOPENED)) {
/* no need to switch, its not opened */
return;
}
/* close the logfile */
fclose(cl->logfile);
cl->fdopened = 0;
cl->flags &= ~ LGSFDOPENED;
/* check if the target directory exists */
ircsnprintf(savedir, MAXPATH, "%s/\%s", LogServ.savedir, cl->filename);
res = stat(savedir, &st);
if (res != 0) {
/* hrm, error */
if (errno == ENOENT) {
/* ok, it doesn't exist, create it */
res = mkdir(savedir, 0700);
if (res != 0) {
/* error */
nlog(LOG_CRITICAL, LOG_MOD, "Couldn't create LogDir Directory: %s", strerror(errno));
return;
}
nlog(LOG_NOTICE, LOG_MOD, "Created Channel Logging Dir %s", savedir);
} else {
nlog(LOG_CRITICAL, LOG_MOD, "Stat Returned A error: %s", strerror(errno));
return;
}
} else if (!S_ISDIR(st.st_mode)) {
nlog(LOG_CRITICAL, LOG_MOD, "%s is not a Directory", savedir);
return;
}
strftime(tmbuf, MAXPATH, "%d%m%Y%H%M%S", localtime(&me.now));
ircsnprintf(newfname, MAXPATH, "%s/%s-%s.log", savedir, cl->filename, tmbuf);
ircsnprintf(oldfname, MAXPATH, "%s/%s.log", LogServ.logdir, cl->filename);
res = rename(oldfname, newfname);
if (res != 0) {
nlog(LOG_CRITICAL, LOG_MOD, "Couldn't Rename file %s: %s", oldfname, strerror(errno));
}
nlog(LOG_NORMAL, LOG_MOD, "Switched Logfile for %s from %s to %s", cl->channame, oldfname, newfname);
}
/* @brief Close all logfiles and delete the struct assocated with them
*
* Called from ModFini when we are unloaded, to cleanup
*/
void lgs_close_logs() {
hscan_t hs;
hnode_t *hn;
ChannelLog *cl;
Chans *c;
/* scan through the log files */
hash_scan_begin(&hs, lgschans);
while (( hn = hash_scan_next(&hs)) != NULL) {
cl = hnode_get(hn);
/* if the log is opened then close it */
if (cl->flags & LGSFDOPENED) {
fclose(cl->logfile);
}
/* delete them from the hash */
c = cl->c;
if (c) {
c->moddata[LogServ.modnum] = NULL;
cl->c = NULL;
}
hash_delete(lgschans, hn);
hnode_destroy(hn);
free(cl);
}
}
/* @brief Rotate the log files if they have been opened longer than the pre-defined time
*
* Runs through all active opened logfiles only
*/
void lgs_RotateLogs() {
hscan_t hs;
hnode_t *hn;
ChannelLog *cl;
/* if Logage is 0, just bail out */
if (LogServ.maxopentime <= 0) {
return;
}
/* scan through the log files */
hash_scan_begin(&hs, lgschans);
while (( hn = hash_scan_next(&hs)) != NULL) {
cl = hnode_get(hn);
/* if the log has been opened more than X, then rotate */
if ((cl->flags & LGSFDOPENED) && ((me.now - cl->fdopened) > LogServ.maxopentime)) {
lgs_switch_file(cl);
}
}
}
char *logserv_startlog(ChannelLog *chandata) {
return startlog;
}
int logserv_joinproc(ChannelLog *chandata, char **av, int ac) {
return NS_SUCCESS;
}
int logserv_partproc(ChannelLog *chandata, char **av, int ac) {
return NS_SUCCESS;
}
int logserv_msgproc(ChannelLog *chandata, char **av, int ac) {
printf("doing msgproc\n");
return NS_SUCCESS;
}
int logserv_quitproc(ChannelLog *chandata, char **av, int ac) {
return NS_SUCCESS;
}
int logserv_topicproc(ChannelLog *chandata, char **av, int ac) {
return NS_SUCCESS;
}
int logserv_kickproc(ChannelLog *chandata, char **av, int ac) {
return NS_SUCCESS;
}
int logserv_nickproc(ChannelLog *chandata, char **av, int ac) {
return NS_SUCCESS;
}
int logserv_modeproc(ChannelLog *chandata, char **av, int ac) {
return NS_SUCCESS;
}
/* [00:00] --- Fri Jan 2 2004 */
/* this usually goes at the end of a logfile. Hrm */
char *egg_startlog(ChannelLog *cl) {
strftime(startlog, BUFSIZE, "[%H:%M] --- %a %b %d %Y\n", localtime(&me.now));
return startlog;
}
#define EGGTIME "[%H:%M]"
char *egg_time() {
strftime(timebuf, TIMEBUFSIZE, EGGTIME, localtime(&me.now));
return timebuf;
}
/* [22:02] Fish (~Fish@Server-Admin.irc-chat.net) joined #neostats. */
#define EJOINPROC "%s %s (%s@%s) joined %s.\n"
int egg_joinproc(ChannelLog *chandata, char **av, int ac) {
User *u;
u = finduser(av[1]);
if (u)
lgs_write_log(chandata, EJOINPROC, egg_time(), u->nick, u->username, u->vhost, av[0]);
return NS_SUCCESS;
}
/* [22:02] Fish (~Fish@Server-Admin.irc-chat.net) left #neostats (ha). */
#define EPARTPROC "%s %s (%s@%s) left %s (%s).\n"
int egg_partproc(ChannelLog *chandata, char **av, int ac) {
User *u;
u = finduser(av[1]);
if (u)
lgs_write_log(chandata, EPARTPROC, egg_time(), u->nick, u->username, u->vhost, av[0], ac == 3 ? av[2] : "");
return NS_SUCCESS;
}
/* [22:04] <Fish> I think that is it
* [22:04] Action: Fish waits for the eggdrop to flush its logs now
*/
#define EMSGPROC "%s <%s> %s\n"
#define EACTPROC "%s Action: %s %s\n"
int egg_msgproc(ChannelLog *chandata, char **av, int ac) {
if (ac == 3)
lgs_write_log(chandata, EACTPROC, egg_time(), av[0], av[2]);
else
lgs_write_log(chandata, EMSGPROC, egg_time(), av[0], av[1]);
return NS_SUCCESS;
}
/* [22:03] Fishwaldo (~Fish@3cbc6b2b.22d996b6.singnet.com.sg) left irc: Client closed */
#define EQUITPROC "%s %s (%s@%s) left irc: %s\n"
int egg_quitproc(ChannelLog *chandata, char **av, int ac) {
User *u;
u = finduser(av[0]);
if (u)
lgs_write_log(chandata, EQUITPROC, egg_time(), u->nick, u->username, u->vhost, ac == 2 ? av[1] : "");
return NS_SUCCESS;
}
/* [22:02] Topic changed on #neostats by Fish!~Fish@Server-Admin.irc-chat.net: <LuShes> I'mmmm back!!!! [NeoStats Support] http://www.neostats.net */
#define ETOPICPROC "%s Topic changed on %s by %s!%s@%s: %s\n"
#define ENOUSERTOPICPROC "%s Topic changed on %s by %s: %s\n"
int egg_topicproc(ChannelLog *chandata, char **av, int ac) {
User *u;
u = finduser(av[1]);
if (u)
lgs_write_log(chandata, ETOPICPROC, egg_time(), av[0], u->nick, u->username, u->vhost, ac == 3 ? av[2] : "");
else
lgs_write_log(chandata, ENOUSERTOPICPROC, egg_time(), av[0], av[1], ac == 3 ? av[2] : "");
return NS_SUCCESS;
}
/* [22:02] Fish kicked from #neostats by Fish: Fish */
#define EKICKPROC "%s %s kicked from %s by %s: %s\n"
int egg_kickproc(ChannelLog *chandata, char **av, int ac) {
lgs_write_log(chandata, EKICKPROC, egg_time(), av[1], av[0], av[2], ac == 4 ? av[3] : "");
return NS_SUCCESS;
}
/* [22:02] #NeoStats: mode change '+oa Fish Fish' by SuperSexSquirrel!super@supersexsquirrel.org */
#define EMODEPROC "%s %s: mode change '%s' by %s!%s@%s\n"
#define ENOUSERMODEPROC "%s %s: mode change '%s' by %s\n"
int egg_modeproc(ChannelLog *chandata, char **av, int ac) {
User *u;
char *modebuf;
modebuf = joinbuf(av, ac, 2);
u = finduser(av[0]);
if (u) {
lgs_write_log(chandata, EMODEPROC, egg_time(), av[1], modebuf, u->nick, u->username, u->vhost);
} else {
lgs_write_log(chandata, ENOUSERMODEPROC, egg_time(), av[1], modebuf, av[0]);
}
return NS_SUCCESS;
}
/* [22:02] Nick change: Fish -> haha */
#define ENICKPROC "%s Nick change: %s -> %s\n"
int egg_nickproc(ChannelLog *chandata, char **av, int ac) {
lgs_write_log(chandata, ENICKPROC, egg_time(), av[0], av[1]);
return NS_SUCCESS;
}
/* Session Start: Fri Jan 02 21:46:22 2004
* Session Ident: #neostats
* [21:46] * Now talking in #neostats
* [21:46] * Topic is '<LuShes> I'mmmm back!!!! [NeoStats Support] http://www.neostats.net :: NeoStats-2.5.11 :: OPSB 2.0 Beta1 Released :: StupidServ 1.2 Released :: SecureServ 1.0 :: Happy Holidays from the entire NeoStats Team, including the trained monkey'
* [21:46] * Set by LuShes on Fri Jan 02 11:11:57
*/
#define MSTARTLOG "Session Start: %s\nSession Ident: %s\n%s * Now talking in %s\n%s * Topic is '%s'\n%s * Set by %s on %s\n"
char *mirc_startlog(ChannelLog *cl) {
char timebuf2[TIMEBUFSIZE];
char timebuf3[TIMEBUFSIZE];
strftime(timebuf, TIMEBUFSIZE, "%a %b %d %H:%M:%S %Y", localtime(&me.now));
strftime(timebuf2, TIMEBUFSIZE, "[%H:%M]", localtime(&me.now));
strftime(timebuf3, TIMEBUFSIZE, "%a %b %d %H:%M:%S", localtime(&cl->c->topictime));
ircsnprintf(startlog, BUFSIZE, MSTARTLOG, timebuf, cl->channame, timebuf2, cl->channame, timebuf2, cl->c->topic[0] != '0' ? cl->c->topic : "", timebuf2, cl->c->topicowner[0] != '0' ? cl->c->topicowner: "", timebuf3);
return startlog;
}
#define MIRCTIME "[%H:%M]"
char *mirc_time() {
strftime(timebuf, TIMEBUFSIZE, MIRCTIME, localtime(&me.now));
return timebuf;
}
/* [21:47] * Dirk-Digler has joined #neostats */
#define MJOINPROC "%s * %s (%s@%s) has joined %s\n"
int mirc_joinproc(ChannelLog *chandata, char **av, int ac) {
User *u;
u = finduser(av[1]);
lgs_write_log(chandata, MJOINPROC, mirc_time(), u->nick, u->username, u->vhost, av[0]);
return NS_SUCCESS;
}
/* [22:07] * DigiGuy has left #neostats */
#define MPARTPROC "%s * %s (%s@%s) has left %s (%s)\n"
int mirc_partproc(ChannelLog *chandata, char **av, int ac) {
User *u;
u = finduser(av[1]);
lgs_write_log(chandata, MPARTPROC, mirc_time(), u->nick, u->username, u->vhost, av[0], ac == 3 ? av[2] : "");
return NS_SUCCESS;
}
/* [21:47] <Digi|Away> yes we are feeling nice today */
/* [21:47] * Fish does a action for Digi|Away's log */
#define MMSGPROC "%s <%s> %s\n"
#define MACTPROC "%s * %s %s\n"
int mirc_msgproc(ChannelLog *chandata, char **av, int ac) {
if (ac == 3) {
lgs_write_log(chandata, MACTPROC, mirc_time(), av[0], av[2]);
} else {
lgs_write_log(chandata, MMSGPROC, mirc_time(), av[0], av[1]);
}
return NS_SUCCESS;
}
/* [21:49] * DigiGuy has quit IRC (Quit: ha) */
#define MQUITPROC "%s * %s has quit IRC (%s)\n"
int mirc_quitproc(ChannelLog *chandata, char **av, int ac) {
lgs_write_log(chandata, MQUITPROC, mirc_time(), av[0], ac == 2 ? av[1] : "");
return NS_SUCCESS;
}
/* [21:48] * Digi|Away changes topic to 'FREE PORN - DETAILS ' */
#define MTOPICPROC "%s * %s changes topic to '%s'\n"
int mirc_topicproc(ChannelLog *chandata, char **av, int ac) {
lgs_write_log(chandata, MTOPICPROC, mirc_time(), av[1], ac == 3 ? av[2] : "");
return NS_SUCCESS;
}
/* [21:47] * Dirk-Digler was kicked by Fish (Fish) */
#define MKICKPROC "%s * %s was kicked by %s (%s)\n"
int mirc_kickproc(ChannelLog *chandata, char **av, int ac) {
lgs_write_log(chandata, MKICKPROC, mirc_time(), av[1], av[2], ac == 4 ? av[3] : "");
return NS_SUCCESS;
}
/* [21:48] * Fish is now known as Fishy */
#define MNICKPROC "%s * %s is now known as %s\n"
int mirc_nickproc(ChannelLog *chandata, char **av, int ac) {
lgs_write_log(chandata, MNICKPROC, mirc_time(), av[0], av[1]);
return NS_SUCCESS;
}
/* [21:47] * Fish sets mode: +o Dirk-Digler */
#define MMODEPROC "%s * %s sets mode: %s\n"
int mirc_modeproc(ChannelLog *chandata, char **av, int ac) {
char *modebuf;
modebuf = joinbuf(av, ac, 2);
lgs_write_log(chandata, MMODEPROC, mirc_time(), av[0], modebuf);
free(modebuf);
return NS_SUCCESS;
}
/* XCHAT FORMAT LOGGING BELOW */
#define XCHATTIME "%b %d %H:%M:%S"
char *xchat_time() {
strftime(timebuf, TIMEBUFSIZE, XCHATTIME, localtime(&me.now));
return timebuf;
}
/* **** BEGIN LOGGING AT Fri Jan 2 17:25:15 2004
* \n
*/
#define XSTARTLOG "**** BEGIN LOGGING AT %s\n\n"
char *xchat_startlog(ChannelLog *cl) {
char tmbuf[TIMEBUFSIZE];
strftime(tmbuf, TIMEBUFSIZE, "%a %b %d %H:%M:%S %Y", localtime(&me.now));
ircsnprintf(startlog, BUFSIZE, XSTARTLOG, tmbuf);
return startlog;
}
/* Jan 02 17:27:10 --> Dirk-Digler (fish@Dirk-Digler.Users.irc-chat.net) has joined #neostats */
#define XJOINFMT "%s -->\t%s (%s@%s) has joined %s\n"
int xchat_joinproc(ChannelLog *chandata, char **av, int ac) {
User *u;
u = finduser(av[1]);
if (u)
lgs_write_log(chandata, XJOINFMT, xchat_time(), u->nick, u->username, u->vhost, av[0]); return NS_SUCCESS;
}
/* Jan 02 17:56:52 <-- DigiGuy (~b.dole@Oper.irc-chat.net) has left #neostats (part)*/
#define XPARTPROC "%s <--\t%s (%s@%s) has left %s (%s)\n"
int xchat_partproc(ChannelLog *chandata, char **av, int ac) {
User *u;
u = finduser(av[1]);
if (u)
lgs_write_log(chandata, XPARTPROC, xchat_time(), u->nick, u->username, u->vhost, av[0], ac == 3 ? av[2] : "");
return NS_SUCCESS;
}
/* Jan 02 17:25:43 <SecureServ> Akilling jojo!~jojo@pD9E60152.dip.t-dialin.net for Virus IRCORK */
#define XMSGFMT "%s <%s>\t%s\n"
/* Action:
* Jan 02 17:28:52 * Fish-Away sighs */
#define XACTFMT "%s *\t%s %s\n"
int xchat_msgproc(ChannelLog *chandata, char **av, int ac) {
if (ac == 3) {
lgs_write_log(chandata, XACTFMT, xchat_time(), av[0], av[2]);
} else {
lgs_write_log(chandata, XMSGFMT, xchat_time(), av[0], av[1]);
}
return NS_SUCCESS;
}
/* Jan 02 17:47:26 <-- Dirk-Digler has quit (Killed (Fish (get lost))) */
#define XQUITFMT "%s <--\t%s has quit (%s)\n"
int xchat_quitproc(ChannelLog *chandata, char **av, int ac) {
lgs_write_log(chandata, XQUITFMT, xchat_time(), av[0], ac == 2 ? av[1] : "");
return NS_SUCCESS;
}
/* Jan 02 17:48:12 --- Digi|Away has changed the topic to: FREE PORN - DETAILS INSIDE */
#define XTOPICPROC "%s ---\t%s has changed the topic to: %s\n"
int xchat_topicproc(ChannelLog *chandata, char **av, int ac) {
lgs_write_log(chandata, XTOPICPROC, xchat_time(), av[1], ac == 3 ? av[2] : "");
return NS_SUCCESS;
}
/* Jan 02 17:27:10 <-- Fish-Away has kicked Dirk-Digler from #neostats (ha) */
#define XKICKPROC "%s <--\t%s has kicked %s from %s (%s)\n"
int xchat_kickproc(ChannelLog *chandata, char **av, int ac) {
lgs_write_log(chandata, XKICKPROC, xchat_time(), av[2], av[1], av[0], ac == 4 ? av[3] : "");
return NS_SUCCESS;
}
/* Jan 02 17:50:32 --- DigiGuy is now known as Bob */
#define XNICKPROC "%s ---\t%s is now known as %s\n"
int xchat_nickproc(ChannelLog *chandata, char **av, int ac) {
lgs_write_log(chandata, XNICKPROC, xchat_time(), av[0], av[1]);
return NS_SUCCESS;
}
/* Jan 02 17:27:10 --- SuperSexSquirrel sets modes [#NeoStats +v Dirk-Digler] */
#define XMODEPROC "%s ---\t%s sets modes[%s %s]\n"
int xchat_modeproc(ChannelLog *chandata, char **av, int ac) {
char *modebuf;
modebuf = joinbuf(av, ac, 2);
lgs_write_log(chandata, XMODEPROC, xchat_time(), av[0], chandata->channame, modebuf);
free(modebuf);
return NS_SUCCESS;
}

70
logdefault.c Executable file
View file

@ -0,0 +1,70 @@
/* NeoStats - IRC Statistical Services
** Copyright (c) 1999-2006 Adam Rutter, Justin Hammond, Mark Hetherington
** http://www.neostats.net/
**
** 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
**
** NeoStats CVS Identification
** $Id$
*/
#include "neostats.h"
#include "logserv.h"
#include "logdefault.h"
void logserv_startlog( ChannelLog *chandata, const CmdParams *cmdparams )
{
}
void logserv_joinproc( ChannelLog *chandata, const CmdParams *cmdparams )
{
}
void logserv_partproc( ChannelLog *chandata, const CmdParams *cmdparams )
{
}
void logserv_msgproc( ChannelLog *chandata, const CmdParams *cmdparams )
{
}
void logserv_noticeproc( ChannelLog *chandata, const CmdParams *cmdparams )
{
}
void logserv_ctcpaction( ChannelLog *chandata, const CmdParams *cmdparams )
{
}
void logserv_quitproc( ChannelLog *chandata, const CmdParams *cmdparams )
{
}
void logserv_topicproc( ChannelLog *chandata, const CmdParams *cmdparams )
{
}
void logserv_kickproc( ChannelLog *chandata, const CmdParams *cmdparams )
{
}
void logserv_nickproc( ChannelLog *chandata, const CmdParams *cmdparams )
{
}
void logserv_modeproc( ChannelLog *chandata, const CmdParams *cmdparams )
{
}

39
logdefault.h Executable file
View file

@ -0,0 +1,39 @@
/* NeoStats - IRC Statistical Services
** Copyright (c) 1999-2006 Adam Rutter, Justin Hammond, Mark Hetherington
** http://www.neostats.net/
**
** 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
**
** NeoStats CVS Identification
** $Id$
*/
#ifndef LOGDEFAULT_H
#define LOGDEFAULT_H
void logserv_startlog( ChannelLog *chandata, const CmdParams *cmdparams );
void logserv_joinproc( ChannelLog *chandata, const CmdParams *cmdparams );
void logserv_partproc( ChannelLog *chandata, const CmdParams *cmdparams );
void logserv_msgproc( ChannelLog *chandata, const CmdParams *cmdparams );
void logserv_noticeproc( ChannelLog *chandata, const CmdParams *cmdparams );
void logserv_ctcpaction( ChannelLog *chandata, const CmdParams *cmdparams );
void logserv_quitproc( ChannelLog *chandata, const CmdParams *cmdparams );
void logserv_topicproc( ChannelLog *chandata, const CmdParams *cmdparams );
void logserv_kickproc( ChannelLog *chandata, const CmdParams *cmdparams );
void logserv_nickproc( ChannelLog *chandata, const CmdParams *cmdparams );
void logserv_modeproc( ChannelLog *chandata, const CmdParams *cmdparams );
#endif

138
logeggdrop.c Executable file
View file

@ -0,0 +1,138 @@
/* NeoStats - IRC Statistical Services
** Copyright (c) 1999-2006 Adam Rutter, Justin Hammond, Mark Hetherington
** http://www.neostats.net/
**
** 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
**
** NeoStats CVS Identification
** $Id$
*/
#include "neostats.h"
#include "logserv.h"
#include "logeggdrop.h"
static char timebuf[TIMEBUFSIZE];
#define EGGTIME "[%H:%M]"
static char *egg_time( void )
{
os_strftime( timebuf, TIMEBUFSIZE, EGGTIME, os_localtime( &me.now ) );
return timebuf;
}
/* [00:00] --- Fri Jan 2 2004 */
/* this usually goes at the end of a logfile. Hrm */
void egg_startlog( ChannelLog *chandata, const CmdParams *cmdparams )
{
static char startlog[BUFSIZE];
os_strftime( startlog, BUFSIZE, "[%H:%M] --- %a %b %d %Y\n", os_localtime( &me.now ) );
os_fprintf( chandata->logfile, "%s", startlog );
}
/* [22:02] Fish( ~Fish@Server-Admin.irc-chat.net ) joined #neostats. */
#define EJOINPROC "%s %s( %s@%s ) joined %s.\n"
void egg_joinproc( ChannelLog *chandata, const CmdParams *cmdparams )
{
ls_write_log( chandata, EJOINPROC, egg_time(), cmdparams->source->name, cmdparams->source->user->username, cmdparams->source->user->vhost, cmdparams->channel->name );
}
/* [22:02] Fish( ~Fish@Server-Admin.irc-chat.net ) left #neostats( ha ). */
#define EPARTPROC "%s %s( %s@%s ) left %s( %s ).\n"
void egg_partproc( ChannelLog *chandata, const CmdParams *cmdparams )
{
ls_write_log( chandata, EPARTPROC, egg_time(), cmdparams->source->name, cmdparams->source->user->username, cmdparams->source->user->vhost, cmdparams->channel->name, cmdparams->param );
}
/* [22:04] <Fish> I think that is it */
#define EMSGPROC "%s <%s> %s\n"
void egg_msgproc( ChannelLog *chandata, const CmdParams *cmdparams )
{
ls_write_log( chandata, EMSGPROC, egg_time(), cmdparams->source->name, cmdparams->param );
}
void egg_noticeproc( ChannelLog *chandata, const CmdParams *cmdparams )
{
ls_write_log( chandata, EMSGPROC, egg_time(), cmdparams->source->name, cmdparams->param );
}
/* [22:04] Action: Fish waits for the eggdrop to flush its logs now */
#define EACTPROC "%s Action: %s %s\n"
void egg_ctcpaction( ChannelLog *chandata, const CmdParams *cmdparams )
{
ls_write_log( chandata, EACTPROC, egg_time(), cmdparams->source->name, cmdparams->param );
}
/* [22:03] Fishwaldo( ~Fish@3cbc6b2b.22d996b6.singnet.com.sg ) left irc: Client closed */
#define EQUITPROC "%s %s( %s@%s ) left irc: %s\n"
void egg_quitproc( ChannelLog *chandata, const CmdParams *cmdparams )
{
ls_write_log( chandata, EQUITPROC, egg_time(), cmdparams->source->name, cmdparams->source->user->username, cmdparams->source->user->vhost, cmdparams->param );
}
/* [22:02] Topic changed on #neostats by Fish!~Fish@Server-Admin.irc-chat.net: <LuShes> I'mmmm back!!!! [NeoStats Support] http://www.neostats.net */
#define ETOPICPROC "%s Topic changed on %s by %s!%s@%s: %s\n"
#define ENOUSERTOPICPROC "%s Topic changed on %s by %s: %s\n"
void egg_topicproc( ChannelLog *chandata, const CmdParams *cmdparams )
{
if( cmdparams->source)
ls_write_log( chandata, ETOPICPROC, egg_time(), cmdparams->channel->name, cmdparams->source->name, cmdparams->source->user->username, cmdparams->source->user->vhost, cmdparams->param );
else
ls_write_log( chandata, ENOUSERTOPICPROC, egg_time(), cmdparams->channel->name, cmdparams->channel->topicowner, cmdparams->param );
}
/* [22:02] Fish kicked from #neostats by Fish: Fish */
#define EKICKPROC "%s %s kicked from %s by %s: %s\n"
void egg_kickproc( ChannelLog *chandata, const CmdParams *cmdparams )
{
ls_write_log( chandata, EKICKPROC, egg_time(), cmdparams->target->name, cmdparams->channel->name, cmdparams->source->name, cmdparams->param );
}
/* [22:02] #NeoStats: mode change '+oa Fish Fish' by SuperSexSquirrel!super@supersexsquirrel.org */
#define EMODEPROC "%s %s: mode change '%s' by %s!%s@%s\n"
#define ENOUSERMODEPROC "%s %s: mode change '%s' by %s\n"
void egg_modeproc( ChannelLog *chandata, const CmdParams *cmdparams )
{
char *modebuf;
modebuf = joinbuf( cmdparams->av, cmdparams->ac, 0 );
if( cmdparams->source->user )
{
ls_write_log( chandata, EMODEPROC, egg_time(), cmdparams->channel->name, modebuf, cmdparams->source->name, cmdparams->source->user->username, cmdparams->source->user->vhost );
}
else
{
ls_write_log( chandata, ENOUSERMODEPROC, egg_time(), cmdparams->channel->name, modebuf, cmdparams->source->name );
}
}
/* [22:02] Nick change: Fish -> haha */
#define ENICKPROC "%s Nick change: %s -> %s\n"
void egg_nickproc( ChannelLog *chandata, const CmdParams *cmdparams )
{
ls_write_log( chandata, ENICKPROC, egg_time(), cmdparams->param, cmdparams->source->name );
}

39
logeggdrop.h Executable file
View file

@ -0,0 +1,39 @@
/* NeoStats - IRC Statistical Services
** Copyright (c) 1999-2006 Adam Rutter, Justin Hammond, Mark Hetherington
** http://www.neostats.net/
**
** 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
**
** NeoStats CVS Identification
** $Id$
*/
#ifndef LOGEGGDROP_H
#define LOGEGGDROP_H
void egg_startlog( ChannelLog *chandata, const CmdParams *cmdparams );
void egg_joinproc( ChannelLog *chandata, const CmdParams *cmdparams );
void egg_partproc( ChannelLog *chandata, const CmdParams *cmdparams );
void egg_msgproc( ChannelLog *chandata, const CmdParams *cmdparams );
void egg_noticeproc( ChannelLog *chandata, const CmdParams *cmdparams );
void egg_ctcpaction( ChannelLog *chandata, const CmdParams *cmdparams );
void egg_quitproc( ChannelLog *chandata, const CmdParams *cmdparams );
void egg_topicproc( ChannelLog *chandata, const CmdParams *cmdparams );
void egg_kickproc( ChannelLog *chandata, const CmdParams *cmdparams );
void egg_nickproc( ChannelLog *chandata, const CmdParams *cmdparams );
void egg_modeproc( ChannelLog *chandata, const CmdParams *cmdparams );
#endif

143
logmirc.c Executable file
View file

@ -0,0 +1,143 @@
/* NeoStats - IRC Statistical Services
** Copyright (c) 1999-2006 Adam Rutter, Justin Hammond, Mark Hetherington
** http://www.neostats.net/
**
** 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
**
** NeoStats CVS Identification
** $Id$
*/
#include "neostats.h"
#include "logserv.h"
#include "logmirc.h"
static char timebuf[TIMEBUFSIZE];
#define MIRCTIME "[%H:%M]"
static char *mirc_time( void )
{
os_strftime( timebuf, TIMEBUFSIZE, MIRCTIME, os_localtime( &me.now ) );
return timebuf;
}
/* Session Start: Fri Jan 02 21:46:22 2004
* Session Ident: #neostats
* [21:46] * Now talking in #neostats
* [21:46] * Topic is '<LuShes> I'mmmm back!!!! [NeoStats Support] http://www.neostats.net :: NeoStats-2.5.11 :: OPSB 2.0 Beta1 Released :: StupidServ 1.2 Released :: SecureServ 1.0 :: Happy Holidays from the entire NeoStats Team, including the trained monkey'
* [21:46] * Set by LuShes on Fri Jan 02 11:11:57
*/
#define MSTARTLOG "Session Start: %s\nSession Ident: %s\n%s * Now talking in %s\n%s * Topic is '%s'\n%s * Set by %s on %s\n"
void mirc_startlog( ChannelLog *chandata, const CmdParams *cmdparams )
{
static char startlog[BUFSIZE];
static char timebuf2[TIMEBUFSIZE];
static char timebuf3[TIMEBUFSIZE];
os_strftime( timebuf, TIMEBUFSIZE, "%a %b %d %H:%M:%S %Y", os_localtime( &me.now ) );
os_strftime( timebuf2, TIMEBUFSIZE, "[%H:%M]", os_localtime( &me.now ) );
os_strftime( timebuf3, TIMEBUFSIZE, "%a %b %d %H:%M:%S", os_localtime( &chandata->c->topictime ) );
ircsnprintf( startlog, BUFSIZE, MSTARTLOG, timebuf, chandata->channame, timebuf2, chandata->channame, timebuf2, chandata->c->topic[0] != '0' ? chandata->c->topic : "", timebuf2, chandata->c->topicowner[0] != '0' ? chandata->c->topicowner: "", timebuf3 );
os_fprintf( chandata->logfile, "%s", startlog );
}
/* [21:47] * Dirk-Digler has joined #neostats */
#define MJOINPROC "%s * %s( %s@%s ) has joined %s\n"
void mirc_joinproc( ChannelLog *chandata, const CmdParams *cmdparams )
{
ls_write_log( chandata, MJOINPROC, mirc_time(), cmdparams->source->name, cmdparams->source->user->username, cmdparams->source->user->vhost, cmdparams->channel->name );
}
/* [22:07] * DigiGuy has left #neostats */
#define MPARTPROC "%s * %s( %s@%s ) has left %s( %s )\n"
void mirc_partproc( ChannelLog *chandata, const CmdParams *cmdparams )
{
ls_write_log( chandata, MPARTPROC, mirc_time(), cmdparams->source->name, cmdparams->source->user->username, cmdparams->source->user->vhost, cmdparams->channel->name, cmdparams->param );
}
/* [21:47] <Digi|Away> yes we are feeling nice today */
#define MMSGPROC "%s <%s> %s\n"
void mirc_msgproc( ChannelLog *chandata, const CmdParams *cmdparams )
{
ls_write_log( chandata, MMSGPROC, mirc_time(), cmdparams->source->name, cmdparams->param );
}
void mirc_noticeproc( ChannelLog *chandata, const CmdParams *cmdparams )
{
ls_write_log( chandata, MMSGPROC, mirc_time(), cmdparams->source->name, cmdparams->param );
}
/* [21:47] * Fish does a action for Digi|Away's log */
#define MACTPROC "%s * %s %s\n"
void mirc_ctcpaction( ChannelLog *chandata, const CmdParams *cmdparams )
{
ls_write_log( chandata, MACTPROC, mirc_time(), cmdparams->source->name, cmdparams->param );
}
/* [21:49] * DigiGuy has quit IRC( Quit: ha ) */
#define MQUITPROC "%s * %s has quit IRC( %s )\n"
void mirc_quitproc( ChannelLog *chandata, const CmdParams *cmdparams )
{
ls_write_log( chandata, MQUITPROC, mirc_time(), cmdparams->source->name, cmdparams->param );
}
/* [21:48] * Digi|Away changes topic to 'FREE PORN - DETAILS ' */
#define MTOPICPROC "%s * %s changes topic to '%s'\n"
void mirc_topicproc( ChannelLog *chandata, const CmdParams *cmdparams )
{
if (cmdparams->source) {
ls_write_log( chandata, MTOPICPROC, mirc_time(), cmdparams->source->name, cmdparams->param );
} else {
ls_write_log( chandata, MTOPICPROC, mirc_time(), cmdparams->channel->topicowner, cmdparams->param );
}
}
/* [21:47] * Dirk-Digler was kicked by Fish( Fish ) */
#define MKICKPROC "%s * %s was kicked by %s( %s )\n"
void mirc_kickproc( ChannelLog *chandata, const CmdParams *cmdparams )
{
ls_write_log( chandata, MKICKPROC, mirc_time(), cmdparams->target->name, cmdparams->source->name, cmdparams->param );
}
/* [21:48] * Fish is now known as Fishy */
#define MNICKPROC "%s * %s is now known as %s\n"
void mirc_nickproc( ChannelLog *chandata, const CmdParams *cmdparams )
{
ls_write_log( chandata, MNICKPROC, mirc_time(), cmdparams->param, cmdparams->source->name );
}
/* [21:47] * Fish sets mode: +o Dirk-Digler */
#define MMODEPROC "%s * %s sets mode: %s\n"
void mirc_modeproc( ChannelLog *chandata, const CmdParams *cmdparams )
{
char *modebuf;
modebuf = joinbuf( cmdparams->av, cmdparams->ac, 0 );
ls_write_log( chandata, MMODEPROC, mirc_time(), cmdparams->source->name, modebuf );
ns_free( modebuf );
}

39
logmirc.h Executable file
View file

@ -0,0 +1,39 @@
/* NeoStats - IRC Statistical Services
** Copyright (c) 1999-2006 Adam Rutter, Justin Hammond, Mark Hetherington
** http://www.neostats.net/
**
** 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
**
** NeoStats CVS Identification
** $Id$
*/
#ifndef LOGMIRC_H
#define LOGMIRC_H
void mirc_startlog( ChannelLog *chandata, const CmdParams *cmdparams );
void mirc_joinproc( ChannelLog *chandata, const CmdParams *cmdparams );
void mirc_partproc( ChannelLog *chandata, const CmdParams *cmdparams );
void mirc_msgproc( ChannelLog *chandata, const CmdParams *cmdparams );
void mirc_noticeproc( ChannelLog *chandata, const CmdParams *cmdparams );
void mirc_ctcpaction( ChannelLog *chandata, const CmdParams *cmdparams );
void mirc_quitproc( ChannelLog *chandata, const CmdParams *cmdparams );
void mirc_topicproc( ChannelLog *chandata, const CmdParams *cmdparams );
void mirc_kickproc( ChannelLog *chandata, const CmdParams *cmdparams );
void mirc_nickproc( ChannelLog *chandata, const CmdParams *cmdparams );
void mirc_modeproc( ChannelLog *chandata, const CmdParams *cmdparams );
#endif

266
logprocessing.c Executable file
View file

@ -0,0 +1,266 @@
/* NeoStats - IRC Statistical Services
** Copyright (c) 1999-2006 Adam Rutter, Justin Hammond, Mark Hetherington
** http://www.neostats.net/
**
** 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
**
** NeoStats CVS Identification
** $Id$
*/
#include "neostats.h"
#include "logserv.h"
#include "logdefault.h"
#include "logmirc.h"
#include "logxchat.h"
#include "logeggdrop.h"
/* only check logfile size every X calls */
#ifdef DEBUG
#define DOSIZE 1
#else
#define DOSIZE 50
#endif
static log_proc logging_funcs[][LGSMSG_NUMTYPES] =
{
{logserv_startlog, logserv_joinproc, logserv_partproc, logserv_msgproc, logserv_noticeproc, logserv_ctcpaction, logserv_quitproc, logserv_topicproc, logserv_kickproc, logserv_nickproc, logserv_modeproc},
{egg_startlog, egg_joinproc, egg_partproc, egg_msgproc, egg_noticeproc, egg_ctcpaction, egg_quitproc, egg_topicproc, egg_kickproc, egg_nickproc, egg_modeproc},
{mirc_startlog, mirc_joinproc, mirc_partproc, mirc_msgproc, mirc_noticeproc, mirc_ctcpaction, mirc_quitproc, mirc_topicproc, mirc_kickproc, mirc_nickproc, mirc_modeproc},
{xchat_startlog, xchat_joinproc, xchat_partproc, xchat_msgproc, xchat_noticeproc, xchat_ctcpaction, xchat_quitproc, xchat_topicproc, xchat_kickproc, xchat_nickproc, xchat_modeproc},
};
/* @brief Opens the log file, creating directories where necessary
*
* @param cl the channel log function
*
* @returns a boolen indicating success/failure
*/
static int ls_open_log( ChannelLog *cl )
{
static char fname[MAXPATH];
/* first, make sure the logdir dir exists */
if( os_create_dir( LogServ.logdir ) != NS_SUCCESS )
{
return NS_FAILURE;
}
/* copy name to the filename holder( in case of invalid paths ) */
strlcpy( cl->filename, cl->channame, MAXPATH );
ircsnprintf( fname, MAXPATH, "%s/%s.log", LogServ.logdir, make_safe_filename( cl->filename ) );
/* open the file */
cl->logfile = os_fopen( fname, "a" );
if( cl->logfile == NULL )
{
nlog( LOG_CRITICAL, "Could not open %s for appending: %s", cl->filename, os_strerror() );
return NS_FAILURE;
}
dlog( DEBUG1, "Opened %s for appending", cl->filename );
cl->ts_open = me.now;
logging_funcs[LogServ.logtype][LGSMSG_START]( cl, NULL );
return NS_SUCCESS;
}
/* @brief Close the log file
*
* @param cl the channel log function
*
* @return none
*/
static void ls_close_log( ChannelLog *cl )
{
if( cl->logfile )
os_fclose( cl->logfile );
cl->logfile = NULL;
cl->ts_open = 0;
}
/* @brief check the logfile size, and rotate if necessary
*
* @param cl the ChannelLog struct for the channel we are checking
*/
static void ls_stat_file( ChannelLog *cl )
{
static char fname[MAXPATH];
int filesize = 0;
/* reset this counter */
cl->writecount = 0;
/* construct the filename to stat */
ircsnprintf( fname, MAXPATH, "%s/%s.log", LogServ.logdir, cl->filename );
filesize = os_file_get_size( fname );
if( filesize <= 0 ) {
return;
}
dlog( DEBUG1, "Logfile Size of %s is %d", fname, filesize );
if( filesize > LogServ.maxlogsize ) {
dlog( DEBUG1, "Switching Logfile %s", fname );
/* ok, the file exceeds out limits, lets switch it */
ls_switch_file( cl );
}
}
/* @brief write a formatted log to the log files, and check if we should switch th logfile
*
* writes a message to a log file. If the logfile hasn't been opened yet, we
* open it, and write out any headers required.
*
* @params cl The ChannelLog structreu for the channel we are loggin
* @params fmt the printf style format of the log message
*/
void ls_write_log( ChannelLog *cl, const char *fmt, ... )
{
static char log_buf[BUFSIZE];
va_list ap;
/* format the string to write */
va_start( ap, fmt );
ircvsnprintf( log_buf, BUFSIZE, fmt, ap );
va_end( ap );
/* if the FD isn't opened yet, lets open a log file */
if( cl->logfile == NULL ) {
if( ls_open_log( cl ) != NS_SUCCESS ) {
return;
}
}
/* ok, file is opened. write the string to it */
#ifdef DEBUG
dlog( DEBUG1, "%s\n", log_buf );
#endif
os_fprintf( cl->logfile, "%s", log_buf );
cl->writecount++;
#ifdef DEBUG
/* only flush the logfile in debug mode */
os_fflush( cl->logfile );
#endif
/* ok, now stat the file to check size */
if( cl->writecount >= DOSIZE ) {
os_fflush( cl->logfile );
ls_stat_file( cl );
}
}
/* @brief actually switch the logfile, saving the old log in a different directory
*
* @param cl the ChannelLog struct
*/
void ls_switch_file( ChannelLog *cl )
{
static char tmbuf[MAXPATH];
static char newfname[MAXPATH];
static char oldfname[MAXPATH];
int res;
/* no need to switch, its not opened */
if( cl->logfile == NULL ) return;
ls_close_log( cl );
/* check if the target directory exists */
if( os_create_dir( LogServ.savedir ) != NS_SUCCESS )
{
return;
}
os_strftime( tmbuf, MAXPATH, "%d%m%Y%H%M%S", os_localtime( &me.now ) );
ircsnprintf( newfname, MAXPATH, "%s/%s-%s.log", LogServ.savedir, cl->filename, tmbuf );
ircsnprintf( oldfname, MAXPATH, "%s/%s.log", LogServ.logdir, cl->filename );
res = os_rename( oldfname, newfname );
if( res != 0 ) {
nlog( LOG_CRITICAL, "Couldn't rename file %s: %s", oldfname, os_strerror() );
return;
}
nlog( LOG_NORMAL, "Switched Logfile for %s from %s to %s", cl->channame, oldfname, newfname );
}
/* @brief Close all logfiles and delete the struct assocated with them
*
* Called from ModFini when we are unloaded, to cleanup
*/
void ls_close_logs( void )
{
hscan_t hs;
hnode_t *hn;
ChannelLog *cl;
/* scan through the log files */
hash_scan_begin( &hs, lschannelhash );
while( ( hn = hash_scan_next( &hs ) ) != NULL )
{
cl = hnode_get( hn );
ls_close_log( cl );
if( cl->c )
{
ClearChannelModValue( cl->c );
cl->c = NULL;
}
/* delete from the hash */
hash_scan_delete_destroy_node( lschannelhash, hn );
ns_free( cl );
}
}
/* @brief Rotate the log files if they have been opened longer than the pre-defined time
*
* Runs through all active opened logfiles only
*/
int ls_rotate_logs( void *userptr )
{
hscan_t hs;
hnode_t *hn;
ChannelLog *cl;
/* if Logage is 0, just bail out */
if( LogServ.maxopentime <= 0 ) {
return NS_SUCCESS;
}
/* scan through the log files */
hash_scan_begin( &hs, lschannelhash );
while( ( hn = hash_scan_next( &hs ) ) != NULL ) {
cl = hnode_get( hn );
/* if the log has been opened more than X, then rotate */
if( ( cl->logfile ) &&( ( me.now - cl->ts_open ) > LogServ.maxopentime ) ) {
ls_switch_file( cl );
}
}
return NS_SUCCESS;
}
/* @brief Send the Log Message to the relevent Log Processor
*
* @param msgtype the type of message( join, part etc )
* @param av contents of the message
* @param ac message size
* @returns NS_SUCCESS or NS_FAILURE
*/
void ls_send_to_logproc( LGSMSG_TYPE msgtype, const Channel *c, const CmdParams *cmdparams )
{
ChannelLog *cl;
if( c )
{
cl =( ChannelLog * )GetChannelModValue( c );
if( cl )
{
logging_funcs[LogServ.logtype][msgtype]( cl, cmdparams );
}
}
}

1043
logserv.c

File diff suppressed because it is too large Load diff

141
logserv.h
View file

@ -1,9 +1,7 @@
/* NeoStats - IRC Statistical Services
** Copyright (c) 1999-2004 Adam Rutter, Justin Hammond
** Copyright (c) 1999-2006 Adam Rutter, Justin Hammond, Mark Hetherington
** http://www.neostats.net/
**
** Portions Copyright (c) 2000-2001 ^Enigma^
**
** 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
@ -26,138 +24,73 @@
#ifndef LOGSERV_H
#define LOGSERV_H
#include "neostats.h"
#ifndef NS_ULEVEL_LOCOPER
#define NS_ULEVEL_LOCOPER 40
#endif
/**
* A string to hold the name of our bot
*/
char s_LogServ[MAXNICK];
/**
* out ModUser struct
*/
ModUser *lgs_bot;
/* Channel Logging Struct. */
typedef struct CL_ {
char channame[CHANLEN];
Chans *c;
typedef struct ChannelLog {
char channame[MAXCHANLEN];
Channel *c;
FILE *logfile;
char filename[MAXPATH];
unsigned long flags;
char statsurl[MAXPATH];
time_t fdopened;
int dostat;
time_t ts_open;
int writecount;
} ChannelLog;
/* settings for LogServ */
struct LogServ {
char user[MAXUSER];
char host[MAXHOST];
char realname[MAXREALNAME];
typedef struct LogServcfg {
int logtype;
int modnum;
char logdir[MAXPATH];
char savedir[MAXPATH];
long maxlogsize;
long maxopentime;
} LogServ;
} LogServcfg;
extern LogServcfg LogServ;
/* Definitions for flags */
#define LGSFDOPENED 0x1
#define LGSFDNEEDFLUSH 0x2
#define LGSPUBSTATS 0x4
#define LGSACTIVE 0x8
#define LGSPUBSTATS 0x1
#define LGSACTIVE 0x2
/* the hash that stores the monitored channels */
hash_t *lgschans;
extern hash_t *lschannelhash;
typedef enum {
LGSMSG_JOIN=0,
LGSMSG_START = 0,
LGSMSG_JOIN,
LGSMSG_PART,
LGSMSG_MSG,
LGSMSG_NOTICE,
LGSMSG_CTCPACTION,
LGSMSG_QUIT,
LGSMSG_TOPIC,
LGSMSG_KICK,
LGSMSG_NICK,
LGSMSG_CHANMODE
} logmsgtype;
LGSMSG_CHANMODE,
LGSMSG_NUMTYPES
} LGSMSG_TYPE;
/* logging function prototype */
typedef int (log_proc) (ChannelLog *, char **, int);
/* LogType Proc table */
typedef struct logtype_proc {
log_proc *joinproc;
log_proc *partproc;
log_proc *msgproc;
log_proc *quitproc;
log_proc *topicproc;
log_proc *kickproc;
log_proc *nickproc;
log_proc *modeproc;
} logtype_proc;
typedef void (*log_proc) ( ChannelLog *chandata, const CmdParams *cmdparams );
/* log_procssing.c decl */
void ls_send_to_logproc ( LGSMSG_TYPE msgtype, const Channel *c, const CmdParams *cmdparams );
int ls_rotate_logs( void * );
void ls_close_logs( void );
void ls_switch_file( ChannelLog *cl );
void ls_write_log( ChannelLog *cl, const char *fmt, ...) __attribute__( ( format( printf,2,3 ) ) );
int logserv_joinproc(ChannelLog *, char **, int);
int logserv_partproc(ChannelLog *, char **, int);
int logserv_msgproc(ChannelLog *, char **, int);
int logserv_quitproc(ChannelLog *, char **, int);
int logserv_topicproc(ChannelLog *, char **, int);
int logserv_kickproc(ChannelLog *, char **, int);
int logserv_nickproc(ChannelLog *, char **, int);
int logserv_modeproc(ChannelLog *, char **, int);
int egg_joinproc(ChannelLog *, char **, int);
int egg_partproc(ChannelLog *, char **, int);
int egg_msgproc(ChannelLog *, char **, int);
int egg_quitproc(ChannelLog *, char **, int);
int egg_topicproc(ChannelLog *, char **, int);
int egg_kickproc(ChannelLog *, char **, int);
int egg_nickproc(ChannelLog *, char **, int);
int egg_modeproc(ChannelLog *, char **, int);
int mirc_joinproc(ChannelLog *, char **, int);
int mirc_partproc(ChannelLog *, char **, int);
int mirc_msgproc(ChannelLog *, char **, int);
int mirc_quitproc(ChannelLog *, char **, int);
int mirc_topicproc(ChannelLog *, char **, int);
int mirc_kickproc(ChannelLog *, char **, int);
int mirc_nickproc(ChannelLog *, char **, int);
int mirc_modeproc(ChannelLog *, char **, int);
int xchat_joinproc(ChannelLog *, char **, int);
int xchat_partproc(ChannelLog *, char **, int);
int xchat_msgproc(ChannelLog *, char **, int);
int xchat_quitproc(ChannelLog *, char **, int);
int xchat_topicproc(ChannelLog *, char **, int);
int xchat_kickproc(ChannelLog *, char **, int);
int xchat_nickproc(ChannelLog *, char **, int);
int xchat_modeproc(ChannelLog *, char **, int);
void lgs_RotateLogs();
void lgs_close_logs();
void lgs_switch_file(ChannelLog *cl);
extern const char lgs_help_about_oneline[];
extern const char lgs_help_version_oneline[];
extern const char lgs_help_chan_oneline[];
extern const char lgs_help_stats_oneline[];
extern const char *lgs_help_about[];
extern const char *lgs_help_chan[];
extern const char *lgs_help_stats[];
extern const char *lgs_help_version[];
extern const char *lgs_help_set_logtype[];
extern const char *lgs_help_set_logsize[];
extern const char *lgs_help_set_logtime[];
extern const char *ls_about[];
extern const char *ls_help_add[];
extern const char *ls_help_del[];
extern const char *ls_help_list[];
extern const char *ls_help_url[];
extern const char *ls_help_status[];
extern const char *ls_help_set_logtype[];
extern const char *ls_help_set_logsize[];
extern const char *ls_help_set_logtime[];
extern const char *ls_help_set_logdir[];
extern const char *ls_help_set_savedir[];
#endif

275
logserv.vcproj Executable file
View file

@ -0,0 +1,275 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="logserv"
ProjectGUID="{E033ECCE-E55E-43BC-89E7-ABE8AA46CE1F}"
RootNamespace="logserv"
Keyword="Win32Proj"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="Debug"
IntermediateDirectory="Debug"
ConfigurationType="2"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\dev\include;..\dev\lib\adns;..\dev\lib\curl;..\dev\lib\pcre"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;logserv_EXPORTS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="0"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="neostats.lib"
OutputFile="../dev/modules/logservd.dll"
LinkIncremental="2"
AdditionalLibraryDirectories="..\dev\src\Debug"
IgnoreDefaultLibraryNames=""
GenerateDebugInformation="true"
ProgramDatabaseFile="$(OutDir)/logserv.pdb"
SubSystem="2"
ResourceOnlyDLL="false"
ImportLibrary="$(OutDir)/logserv.lib"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="Release"
IntermediateDirectory="Release"
ConfigurationType="2"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="..\dev\include;..\dev\lib\adnswin32;..\dev\lib\keeper;..\dev\lib\curl;..\dev\lib\pcre"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;logserv_EXPORTS"
RuntimeLibrary="0"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="neostats.lib"
OutputFile="../logserv.dll"
LinkIncremental="1"
AdditionalLibraryDirectories="..\dev\src\Release"
GenerateDebugInformation="true"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
ImportLibrary="$(OutDir)/logserv.lib"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath=".\help.c"
>
</File>
<File
RelativePath=".\logdefault.c"
>
</File>
<File
RelativePath=".\logeggdrop.c"
>
</File>
<File
RelativePath=".\logmirc.c"
>
</File>
<File
RelativePath=".\logprocessing.c"
>
</File>
<File
RelativePath=".\logserv.c"
>
</File>
<File
RelativePath=".\logxchat.c"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath=".\logdefault.h"
>
</File>
<File
RelativePath=".\logeggdrop.h"
>
</File>
<File
RelativePath=".\logmirc.h"
>
</File>
<File
RelativePath=".\logserv.h"
>
</File>
<File
RelativePath=".\logxchat.h"
>
</File>
<File
RelativePath=".\modconfigwin32.h"
>
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
</Filter>
<File
RelativePath=".\ChangeLog"
>
</File>
<File
RelativePath=".\License"
>
</File>
<File
RelativePath=".\README.LogServ"
>
</File>
<File
RelativePath=".\Relnotes"
>
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

139
logxchat.c Executable file
View file

@ -0,0 +1,139 @@
/* NeoStats - IRC Statistical Services
** Copyright (c) 1999-2006 Adam Rutter, Justin Hammond, Mark Hetherington
** http://www.neostats.net/
**
** 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
**
** NeoStats CVS Identification
** $Id$
*/
#include "neostats.h"
#include "logserv.h"
#include "logxchat.h"
/* XCHAT FORMAT LOGGING BELOW */
static char timebuf[TIMEBUFSIZE];
#define XCHATTIME "%b %d %H:%M:%S"
static char *xchat_time( void )
{
os_strftime( timebuf, TIMEBUFSIZE, XCHATTIME, os_localtime( &me.now ) );
return timebuf;
}
/* **** BEGIN LOGGING AT Fri Jan 2 17:25:15 2004
* \n
*/
#define XSTARTLOG "**** BEGIN LOGGING AT %s\n\n"
void xchat_startlog( ChannelLog *chandata, const CmdParams *cmdparams )
{
static char startlog[BUFSIZE];
static char tmbuf[TIMEBUFSIZE];
os_strftime( tmbuf, TIMEBUFSIZE, "%a %b %d %H:%M:%S %Y", os_localtime( &me.now ) );
ircsnprintf( startlog, BUFSIZE, XSTARTLOG, tmbuf );
os_fprintf( chandata->logfile, "%s", startlog );
}
/* Jan 02 17:27:10 --> Dirk-Digler( fish@Dirk-Digler.Users.irc-chat.net ) has joined #neostats */
#define XJOINFMT "%s -->\t%s( %s@%s ) has joined %s\n"
void xchat_joinproc( ChannelLog *chandata, const CmdParams *cmdparams )
{
ls_write_log( chandata, XJOINFMT, xchat_time(), cmdparams->source->name, cmdparams->source->user->username, cmdparams->source->user->vhost, cmdparams->channel->name );
}
/* Jan 02 17:56:52 <-- DigiGuy( ~b.dole@Oper.irc-chat.net ) has left #neostats( part )*/
#define XPARTPROC "%s <--\t%s( %s@%s ) has left %s( %s )\n"
void xchat_partproc( ChannelLog *chandata, const CmdParams *cmdparams )
{
ls_write_log( chandata, XPARTPROC, xchat_time(), cmdparams->source->name, cmdparams->source->user->username, cmdparams->source->user->vhost, cmdparams->channel->name, cmdparams->param );
}
/* Jan 02 17:25:43 <SecureServ> Akilling jojo!~jojo@pD9E60152.dip.t-dialin.net for Virus IRCORK */
#define XMSGFMT "%s <%s>\t%s\n"
void xchat_msgproc( ChannelLog *chandata, const CmdParams *cmdparams )
{
ls_write_log( chandata, XMSGFMT, xchat_time(), cmdparams->source->name, cmdparams->param );
}
void xchat_noticeproc( ChannelLog *chandata, const CmdParams *cmdparams )
{
ls_write_log( chandata, XMSGFMT, xchat_time(), cmdparams->source->name, cmdparams->param );
}
/* Action:
* Jan 02 17:28:52 * Fish-Away sighs */
#define XACTFMT "%s *\t%s %s\n"
void xchat_ctcpaction( ChannelLog *chandata, const CmdParams *cmdparams )
{
ls_write_log( chandata, XACTFMT, xchat_time(), cmdparams->source->name, cmdparams->param );
}
/* Jan 02 17:47:26 <-- Dirk-Digler has quit( Killed( Fish( get lost ) ) ) */
#define XQUITFMT "%s <--\t%s has quit( %s )\n"
void xchat_quitproc( ChannelLog *chandata, const CmdParams *cmdparams )
{
ls_write_log( chandata, XQUITFMT, xchat_time(), cmdparams->source->name, cmdparams->param );
}
/* Jan 02 17:48:12 --- Digi|Away has changed the topic to: FREE PORN - DETAILS INSIDE */
#define XTOPICPROC "%s ---\t%s has changed the topic to: %s\n"
void xchat_topicproc( ChannelLog *chandata, const CmdParams *cmdparams )
{
if (cmdparams->source) {
ls_write_log( chandata, XTOPICPROC, xchat_time(), cmdparams->source->name, cmdparams->param );
} else {
ls_write_log( chandata, XTOPICPROC, xchat_time(), cmdparams->channel->topicowner, cmdparams->param );
}
}
/* Jan 02 17:27:10 <-- Fish-Away has kicked Dirk-Digler from #neostats( ha ) */
#define XKICKPROC "%s <--\t%s has kicked %s from %s( %s )\n"
void xchat_kickproc( ChannelLog *chandata, const CmdParams *cmdparams )
{
ls_write_log( chandata, XKICKPROC, xchat_time(), cmdparams->source->name, cmdparams->target->name, cmdparams->channel->name, cmdparams->param );
}
/* Jan 02 17:50:32 --- DigiGuy is now known as Bob */
#define XNICKPROC "%s ---\t%s is now known as %s\n"
void xchat_nickproc( ChannelLog *chandata, const CmdParams *cmdparams )
{
ls_write_log( chandata, XNICKPROC, xchat_time(), cmdparams->param, cmdparams->source->name );
}
/* Jan 02 17:27:10 --- SuperSexSquirrel sets modes [#NeoStats +v Dirk-Digler] */
#define XMODEPROC "%s ---\t%s sets modes[%s %s]\n"
void xchat_modeproc( ChannelLog *chandata, const CmdParams *cmdparams )
{
char *modebuf;
modebuf = joinbuf( cmdparams->av, cmdparams->ac, 0 );
ls_write_log( chandata, XMODEPROC, xchat_time(), cmdparams->source->name, chandata->channame, modebuf );
ns_free( modebuf );
}

39
logxchat.h Executable file
View file

@ -0,0 +1,39 @@
/* NeoStats - IRC Statistical Services
** Copyright (c) 1999-2006 Adam Rutter, Justin Hammond, Mark Hetherington
** http://www.neostats.net/
**
** 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
**
** NeoStats CVS Identification
** $Id$
*/
#ifndef LOGXCHAT_H
#define LOGXCHAT_H
void xchat_startlog( ChannelLog *chandata, const CmdParams *cmdparams );
void xchat_joinproc( ChannelLog *chandata, const CmdParams *cmdparams );
void xchat_partproc( ChannelLog *chandata, const CmdParams *cmdparams );
void xchat_msgproc( ChannelLog *chandata, const CmdParams *cmdparams );
void xchat_noticeproc( ChannelLog *chandata, const CmdParams *cmdparams );
void xchat_ctcpaction( ChannelLog *chandata, const CmdParams *cmdparams );
void xchat_quitproc( ChannelLog *chandata, const CmdParams *cmdparams );
void xchat_topicproc( ChannelLog *chandata, const CmdParams *cmdparams );
void xchat_kickproc( ChannelLog *chandata, const CmdParams *cmdparams );
void xchat_nickproc( ChannelLog *chandata, const CmdParams *cmdparams );
void xchat_modeproc( ChannelLog *chandata, const CmdParams *cmdparams );
#endif

View file

@ -9,3 +9,6 @@
/* Minor Version */
#undef MODULE_MINOR
/* Revision */
#undef MODULE_REV

15
modconfigwin32.h Executable file
View file

@ -0,0 +1,15 @@
/* modconfig.h. Generated by configure. */
/* define this to enable debug code for this module */
/* #undef DEBUG */
/* Version number of package */
#define MODULE_VERSION "3.0.a4-dev"
/* Major Version */
#define MODULE_MAJOR "3"
/* Minor Version */
#define MODULE_MINOR "0"
/* Revision */
#define MODULE_REV "a4-dev"

62
pulse.xml Normal file
View file

@ -0,0 +1,62 @@
<?xml version="1.0" encoding="UTF-8"?>
<project default-recipe="default">
<recipe name="Configure">
<post-processor name="checkbuild.pp">
<gcc.pp name="gcc.pp"/>
<make.pp name="make.pp"/>
</post-processor>
<executable name="ShutUp Configure" exe="touch" args="${base.dir}/.hush"> </executable>
<executable name="run configure" exe="${base.dir}/configure" args="--enable-debug --disable-ccdv --enable-autodebug"> </executable>
<make name="build">
<process processor="${checkbuild.pp}"/>
</make>
</recipe>
<recipe name="SnapShowCheck">
<post-processor name="checkbuild.pp">
<gcc.pp name="gcc.pp"/>
<make.pp name="make.pp"/>
</post-processor>
<executable name="ShutUp Configure" exe="touch" args="${base.dir}/.hush"> </executable>
<executable name="run configure" exe="${base.dir}/configure" args="--enable-debug --disable-ccdv --enable-autodebug --with-distversion=${build.revision}"> </executable>
<command name="Build">
<make name="build" targets="distcheck">
<process processor="${checkbuild.pp}"/>
</make>
<artifact name="SnapShot" file="LogServ-*.tar.gz"/>
</command>
</recipe>
<recipe name="Win32-Build">
<post-processor name="checkbuild.pp">
<regex.pp name="compile.pp">
<pattern category="error" expression="\\.[chl]\\([0-9]+\\): error"/>
<pattern category="warning" expression="\\.[chl]\\([0-9]+\\): warning"/>
</regex.pp>
</post-processor>
<resource name="Win32" required="true" version="1"/>
<command name="Build-Core">
<executable name="MSBuild core" exe="${MSBuildPath}\MSBuild.exe" args="secureserv.sln /p:Configuration=Release">
<environment name="VCBUILD_DEFAULT_OPTIONS" value="/u"/>
<process processor="${checkbuild.pp}"/>
</executable>
</command>
</recipe>
<recipe name="Win32-Snapshow">
<post-processor name="checkbuild.pp">
<regex.pp name="compile.pp">
<pattern category="error" expression="\\.[chl]\\([0-9]+\\): error"/>
<pattern category="warning" expression="\\.[chl]\\([0-9]+\\): warning"/>
</regex.pp>
</post-processor>
<resource name="Win32" required="true" version="1"/>
<command name="Build-Core">
<executable name="MSBuild core" exe="${MSBuildPath}\MSBuild.exe" args="secureserv.sln /p:Configuration=Release">
<environment name="VCBUILD_DEFAULT_OPTIONS" value="/u"/>
<process processor="${checkbuild.pp}"/>
</executable>
</command>
<command name="MakeDist">
<executable name="MakeSnap" exe="${base.dir}\\tools\\buildwin32snap.bat" args="${build.revision}"/>
<artifact name="LogServ Setup File" file="${base.dir}\\tools\\LogServ-Setup-*.exe"/>
</command>
</recipe>
</project>