1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-06-12 17:14:46 +02:00

Unreal3.1-beta3 to Unreal3.1

This commit is contained in:
stskeeps
2000-07-16 20:37:15 +00:00
parent 5d21b18d82
commit 206dc189ba
88 changed files with 6487 additions and 3870 deletions
+17 -2
View File
@@ -10,5 +10,20 @@ unreal-support@lists.sourceforge.net or ask at IRC:
For any sake, read Unreal.nfo and read doc/faq before asking questions
Press Escape now if you want to abort the setup, or press Enter
to continue.
NOTE: If the code is changed in any way, or the version string is changed,
we do _NOT_ support the product, except if you got explicit permission
from one of the UnrealIRCd coders. If it fails and you messed with it,
you can't blame noone but yourself. Also, non-official UnrealIRCd/32
builds (if it doesn't say "geniune" in the display) are _NOT_
supported.
It has been a year since I made the first UnrealIRCd release, Unreal2.1.
A lot of things have happened since. I started Unreal as a hobby project,
but it has turned into a community, where people ask for help, and give help
too - people like the program (as the first I've made actually :>). So I
am happy you have followed all this way - Thanks to Shmad, Nutcais,
Sporty_McFly, DjBoxy, zero9000, and all the people following the product
for the time it has existed. So - enjoy this release - we have tried to do
our best, and if its not - we'll make the next our best. So - Seeya in 2001
-Stskeeps (Head coder of UnrealIRCd)
Vendored
+51
View File
@@ -0,0 +1,51 @@
--leave-preprocessor-space
--dont-break-procedure-type
--no-space-after-function-call-names
--brace-indent0
--indent-level8
-ip8
--dont-line-up-parentheses
--continuation-indentation4
--case-indentation2
--no-space-after-casts
--blank-lines-after-procedures
--no-blank-lines-after-declarations
--braces-on-struct-decl-line
--paren-indentation0
--case-brace-indentation0
--line-length80
--declaration-indentation5
-T size_t
-T aClass
-T aClient
-T aServer
-T anUser
-T aChannel
-T Mode
-T aConfItem
-T aMessage
-T aMessageTree
-T aGline
-T aListingArgs
-T snomask_t
-T n_short
-T n_long
-T n_time
-T u_char
-T u_short
-T u_long
-T u_int
-T dbuf
-T dbufbuf
-T aHashEntry
-T Link
-T Dlink
-T VOIDSIG
-T aHostent
-T ResRQ
-T aCache
-T CacheTable
-T cainfo
-T reinfo
-T RETSIGTYPE
-T OPT_TYPE
+152 -13
View File
@@ -1,6 +1,7 @@
/*
* UnrealIRCd Changes File - (C) Carsten Munk 1999-2000 &
* The UnrealIRCd Team
*
* $Id$
*
* This program is free software; you can redistribute it and/or modify
@@ -17,20 +18,9 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
*/
*/
*** BUGS ***
* /map has a few little display problems (fixable? sts: no not the hide ulines, already fixed)
* You can make the server flood off opers if you clone with > MAXCLIENTS
fix: make a unknown connection clone defense:P
* -ex-2.routing.md.us.exchat.org- *** Notice -- Aieeee!!! Server terminating: Segmention fault (buf:
:Methos PRIVMSG #exchat :for the * flag)
*** FIXED -- we think ***
- Potential problem with die/restart from 3.0(fix) ... peopl can not restart/kill servers even
if they have the neseccery O:Lines -- it seems towork in 3.1
*** Unreal3.1 *** (state: beta third state)
*** Unreal3.1 *** (final)
- Moved REMOVE_ADVERTISE a little
- Fixed bug where you could /mode #test +L #test (link a channel to
itself)
@@ -319,3 +309,152 @@
- Fixed a bug with /chgname with incorrect parameters to other servers
- "Fixed" the /stats u bug?
- Fixed +f not working (?)
- Made the Own-protection just reduce the class maxli instead of bitching..
- Did a dirty hack on ALN problem with colliding hash (will deny linking in
wrong servers)
- Fixed /stats C not showing N:lines, reported by auspice
- Fixed codemastr (possible) fucked up the shell ircd script with
overwriting it ...
- Created /shun, /gline style. /shun +user@host time reason /shun -user@host
will extend it so you can /shun +nick later
- A little anti-0 fix in channel.c
- Made MODE_X, MODE_I etc show mode change to user
- Added channel mode +C to disallow channel CTCPs, /me (CTCP ACTION) is still allowed
- Fixed a bunch of +H bugs
- Fixed a bug where the channel was still shown in /who for +I users
- First part of ZIP_LINKS
- Fixed a typo in ./newnet
- Made /close reset IRCstats.unknown ..
- Made SVSO (ofcourse) IRCstats.operators--;
- Another IRCstats.unknown fix. Hope this works (hacked from undernet code)
- NETINFO protocol 0 is accepted as valid protocool (for services etc)
- /stats s is now avail only for opers in mainstream
- Took out "nick did a /userhost on you"
- Reduced hashtable size
- Took out sequent/dynix support
- Fixed a bug that prolly was fixed by Potvin, but was "not fixed correctly"
- Fixed a crash problem in register_user and most likely fixed the "strange
vhost" thing, (was a dumb bug, mising ircsprintf)
- Fixed the *** NickServ sets mode +creep SVS2MODE bug..
- sendto_serv_butone_token_opt ()..
- Small testing stuff
- In ./Config it runs a quick test to see how many socket()s you can do
- Fixed the double +cF notice on local connections exiting, ugly hack
- Removed the last traces of unix sockets, flag 0x10 free now
- Made all ircops able to use +F (totally this time)
- /quote close do not show realhost of caller anymore
- /shun accepts nick in add mode now (adds *@host)
- Allowed /shunned users to use /pong now
- Fixed (by DrBin) Shun and Gline bug, where they replaced eachothers ->type
.... Learn that (= != ==) /me looks at Sts
- You can now specify 0 as the time for any TKL (ex Glines, Shun) for it to be perm
- Fixed a +L bug, (3.1 only) where any op could set +L
- Added channel mode +u, "Auditorium". Makes /names and /who #channel only
show @'s
- Added config.h setting to disable oper overrides, NO_OPEROVERRIDE
- Added Debug support to win32 makefile ... compile with syntax
NMAKE -f makefile.win32 DEBUG=1
inorder to have debug support ... leave the DEBUG=1 out for normal builds
- Fixed ircsprintf.h ... we do want it to compile in debug mode yes ?
- Made /addline write to correct place when you use -f
- Made /zline not memory corrupt/crash, bad df bug
- Fixed a counting bug with unknown connections, very hopefully
- Fixed /htm giving wrong response when /htm to 1
- Fixed /shun showing "1970" to permanently shunned users
- Fixed ./Config showing freebsd 3.0 in freebsd 4
- Made so badwords.*.conf accepts # comments
- Added some default default badwords.message.conf and badwords.channel.conf
- Made so auditorium mode shows users to @'s
- Fixed a bug where /chgident would overflow into the *real* host if it where greater than USERLEN
because _someone_ aka sts told it to check against HOSTLEN rather than USERLEN... reported by wshs
- Fixed a bug in badwords not loading words correctly, and upped word limit
to 50
- Small fix with ./Config showing incorrect path of stddef.h
- Made operkick be part of NO_OPEROVERRIDE
- Made admins unable to be shunned
- Made some socket errors which normally only showed up in DEBUGMODE, show
up in ircd.log as well
- Fixed a wrongly outputted message (in hash collision detect)
- Removed aHush, not in use
- Removed DISALLOW_MIXED_CASE and IGNORE_FIRST_CHAR, waste of space
- Made IDLE_FROM_MSG stock define
- Made IRCII_KLUDGE disappear :P
- Fixed SENDQ_ALWAYS to be mainstream define (as always)
- Removed s_gline, not in use, removed some modeless channel checks (not needed), removed an old zombie
code, and removed a line from aHush that was missed
- Added networks/seveneagle.network
- /msg irc <command> now works whether or not WEBTV_SUPPORT is on
- Moved /mode #channel ^ and ListBits() to #ifdef DEVELOP
- Made it so servers behind a U:lined server (ex Juped Server) are U:lined too, helpful if HIDE_ULINES is
on (from bahamut)
- Added find_uline (from bahamut) for the new U:line code
- Modified /map to work with the new U:line code
- Redid s_err.c to be ALOT faster, based on bahamut's s_err.c (ALOT of
work)
- Fixed last R_LINE stuff (check_time_interval)
- Fixed /setname desynch
- Removed IsService(), and some wierd stuff
- Broken INETD support removed
- Removed some odd Clone stuff(?)
- Added Blowfish encryption ability (SetSecure()), will extend to more
better encryption
- Fixed a typo in /stats z
- Some more crypto stuff, will work on the new engine tommorow
- You can now encrypt the I:line passwords using mkpasswd (must have CRYPT_ILINE_PASSWORD defined)
- Editted Config to ask if you want encrypted I:line passwords
- Made it so you can encrypt restart/die passwords (same as I:line passwords)
- Editted Config to ask about encrypted restart/die passwords
- Made it so you can *view* a channel topic using /topic #channel without being a member
- Removed , support from /topic (not needed)
- Removed count_channels (not in use)
- Made a major is_banned speed up
- Redid K:line and n:line checking to be alot faster
- Fixed crypto stuff 100% :))
- Added CRYPTOIRCd ('r') to version string
- Added some more crypto stuff
- /crypto <algoritm> <keyfile laying in keys/> <parameters>
- Fixed a ->passwd bug caused by codemastr..
- Added fclose() calls to the vhost, dccdeny, and chrestrict confs
- Some V:line stuff (added VL protoctl, and parsing of the SERVER command for the proto and flags)
- Fixed so that in +c it shows if a user is connected securely
- Backported the passwd stuff, not needed.
- Fixed a crash problem on /quit or /squit
- Fixed some aligning in the VL PROTOCTL
- Fixed some fucked up passwd stuff again ..
- Fixed a little Client Protoctl problem
- Fixed a crypto problem (forgot an #ifdef bad sts!)
- Fully added V:lines (doesn't really do much till the next version, since old versions don't support it)
- Added /stats v to list V:lines (/stats V still does vhost.conf)
- Added OpenBSD 2.x support, thanks to noriko for donating the development shell
- Added so stuff like Lost connection to, (report_error) only goes to realops
- Added some more descriptive error messages
- Added doc/crypto.doc describing the encrypted irc protocol
- Fixed a sendto_serv_butone_token problem
- Removed any trace of MD5, we use random() for nospoof now, this fixed a
license problem too
- Removed NOSPOOF_SEED01 and 02
- Added VHP protoctl, (not in use in the synch). This makes virthost field
in NICKv2 use the real virthost even if its +t. (Thanks to SL7)
- Added support for the CR Java Chat auto join feature
- Fixed a msg.h location problem ..
- Added secure connections and openssl tracing to Config
- Added regex portablity and checks in Config
- Added a #define capability to config.h (DISABLE_USERMOD),
disables /sethost, /setident, /chgname, /chghost, /chgident
- Fixed a /rehash -garbage bug reported by Curt|s
- Added networks/makenet (generates a network configuration file)
- Added networks/staticedge.network
- Fixed some host revealing nick collision stuff
- Tokenized nick->nick PRIVMSG and NOTICE
- Made it so you can remove a protoctl by putting a - in front
- Fixed a bug in summon
- Added protection against webproxies
- Fixed TKL?
- Added SJ3, removed the old
- SJ3 bugfix, and another
- Hopefully a res.c fix.
- Fixed a +I bug
- Fixed a more SJ3 bug
- Updated networks/networks.ndx (bad sts!)
- Added networks/linuxsquare.network
- Added networks/chatstation.network
+226 -101
View File
@@ -11,7 +11,7 @@
# distribution without the author's prior consent.
#
# $Id$
IRCD_VERSION="Unreal3.1-beta3"
IRCD_VERSION="Unreal3.1"
CONF_DATE=`date`
LAST_VERSION="very very old"
#
@@ -42,7 +42,11 @@ NINETNETOF=undef
GETTIMEOFDAY=undef
LRAND48=undef
STRTOUL=undef
OPENSSL=""
REGEXP=""
NEEDSKIPNAME=""
CRYPTOLIB=""
CRYPTOIRCD=""
CCPATH=''
SIGNAL=''
BLOCKING=''
@@ -63,8 +67,6 @@ OSNAME="an unrecgonized operating system"
#
IRCNET=""
NOSPOOF="1"
NOSPOOF_SEED01="0x12345678"
NOSPOOF_SEED02="0x9abcdef0"
KLINE_ADDRESS=""
DPATH="$DIR"
SPATH="$DIR/src/ircd"
@@ -72,6 +74,8 @@ MODE_X=""
TRUEHUB=""
CRYPT_OPER_PASSWORD=""
CRYPT_LINK_PASSWORD=""
CRYPT_ILINE_PASSWORD=""
CRYPT_XLINE_PASSWORD=""
LISTEN_SIZE="5"
MAXSENDQLENGTH="3000000"
BUFFERPOOL="(9 * MAXSENDQLENGTH)"
@@ -96,13 +100,11 @@ fi
clear
if [ "$LAST_VERSION" != "$IRCD_VERSION" ] ; then
if [ -r .CHANGES.NEW ] ; then
more .CHANGES.NEW
echo $n "[Enter to begin]"
read cc
fi
fi
if [ "$1" = "-n" ] ; then
if [ "$LAST_VERSION" != "$IRCD_VERSION" ] ; then
@@ -134,6 +136,8 @@ case "$OS" in
OSNAME="FreeBSD 2.2.x"
CRYPT_OPER_PASSWORD=""
CRYPT_LINK_PASSWORD=""
CRYPT_ILINE_PASSWORD=""
CRYPT_XLINE_PASSWORD=""
echo "You are using FreeBSD 2.2.x; do NOT crypt passwords at this time"
;;
*FreeBSD*2.2*)
@@ -142,7 +146,19 @@ case "$OS" in
OSNAME="FreeBSD 2.2"
CRYPT_OPER_PASSWORD=""
CRYPT_LINK_PASSWORD=""
echo "You are using FreeBSD 2.2; do NOT crypt passwords at this time"
CRYPT_ILINE_PASSWORD=""
CRYPT_XLINE_PASSWORD=""
echo "You are using FreeBSD 2.2; do NOT crypt passwords at this time"
;;
*FreeBSD*4.0*)
DEFCFLAGS="$DEFOPT"
DEFLIBS="-lcrypt"
OSNAME="FreeBSD 4.0"
CRYPT_OPER_PASSWORD=""
CRYPT_LINK_PASSWORD=""
CRYPT_ILINE_PASSWORD=""
CRYPT+XLINE_PASSWORD=""
echo "You are using FreeBSD 4.0; You can use encrypted passwords now."
;;
*FreeBSD*3*)
DEFCFLAGS="$DEFOPT"
@@ -150,6 +166,8 @@ case "$OS" in
OSNAME="FreeBSD 3.x"
CRYPT_OPER_PASSWORD=""
CRYPT_LINK_PASSWORD=""
CRYPT_ILINE_PASSWORD=""
CRYPT_XLINE_PASSWORD=""
echo "You are using FreeBSD 3.x; You can use encrypted passwords now."
;;
*FreeBSD*)
@@ -158,8 +176,19 @@ case "$OS" in
OSNAME="FreeBSD"
CRYPT_OPER_PASSWORD=""
CRYPT_LINK_PASSWORD=""
CRYPT_ILINE_PASSWORD=""
CRYPT_XLINE_PASSWORD=""
echo "You are using FreeBSD ; do NOT crypt passwords at this time"
;;
*OpenBSD*2*)
DEFCFLAGS="$DEFOPT"
DEFLIBS="none"
OSNAME="OpenBSD 2.x"
CRYPT_OPER_PASSWORD=""
CRYPT_LINK_PASSWORD=""
CRYPT_ILINE_PASSWORD=""
CRYPT_XLINE_PASSWORD=""
;;
*SCO_SV*)
DEFCFLAGS="$DEFOPT -DSCOUNIX"
DEFLIBS="-lsocket"
@@ -389,7 +418,7 @@ if [ -r /usr/include/stdlib.h ] ; then
else
echo 'not found :('
fi
echo $n "...Looking for stddef.h...$c"
echo $n "...Looking for /usr/include/stddef.h...$c"
if [ -r /usr/include/stddef.h ] ; then
STDDEFH=define
echo 'found!'
@@ -450,6 +479,28 @@ if [ -r /usr/include/sys/rusage.h ] ; then
else
echo 'not found (good!)'
fi
echo $n "...Looking for /usr/include/openssl/blowfish.h...$c"
if [ -r /usr/include/openssl/blowfish.h ] ; then
OPENSSL=define
echo 'found!'
else
echo 'not found (you will not be able to do secure connections)'
fi
echo $n "...Looking for /usr/include/regex.h...$c"
if [ -r /usr/include/regex.h ] ; then
REGEX=define
echo 'found!'
else
echo 'not found :('
echo $n '*** configuring regex package ***' $n
cd extras/regex
./configure
make
cd ../..
fi
#
# to b or not to b
#
@@ -1066,87 +1117,6 @@ while [ -z "$FOO" ] ; do
esac
done
if [ -n "$NOSPOOF" ] ; then
FOO=""
runonce=""
while [ -z "$FOO" ] ; do
FOO="$NOSPOOF_SEED01"
echo "For security, the nospoof code uses two special values, called"
echo "seeds. Here, please enter one of them. The values are in"
echo "hexidecimal (base 16) using the digits 0123456789abcdef. Each"
echo "value can contain up to 8 digits, and should be specified in the"
echo "form 0x12345678. If you use the defaults, that should be ok, but"
echo "it is more secure if you choose your own special values and keep"
echo "them secret."
echo $n "[$FOO] -> $c"
if [ -z "$AUTO_CONFIG" -o -n "$runonce" ] ; then
read cc
else
cc=""
runonce=Yes
fi
if [ -z "$cc" ] ; then
cc=$FOO
fi
case "$cc" in
0x[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F])
NOSPOOF_SEED01=$cc
;;
[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F])
NOSPOOF_SEED01=0x$cc
;;
*)
echo " "
echo "Read the instructions and try again... You did not enter the"
echo "value correctly."
echo ""
FOO=""
;;
esac
done
FOO=""
runonce=""
while [ -z "$FOO" ] ; do
FOO="$NOSPOOF_SEED02"
echo "For security, the nospoof code uses two special values, called"
echo "seeds. Here, please enter one of them. The values are in"
echo "hexidecimal (base 16) using the digits 0123456789abcdef. Each"
echo "value can contain up to 8 digits, and should be specified in the"
echo "form 0x12345678. If you use the defaults, that should be ok, but"
echo "it is more secure if you choose your own special values and keep"
echo "them secret."
echo $n "[$FOO] -> $c"
if [ -z "$AUTO_CONFIG" -o -n "$runonce" ] ; then
read cc
else
cc=""
runonce=Yes
fi
if [ -z "$cc" ] ; then
cc=$FOO
fi
case "$cc" in
0x[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F])
NOSPOOF_SEED02=$cc
;;
[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F])
NOSPOOF_SEED02=0x$cc
;;
*)
echo " "
echo "Read the instructions and try again... You did not enter the"
echo "value correctly."
echo ""
FOO=""
;;
esac
done
# this matches a NOSPOOF check waaaaaay up there
fi
FOO=""
runonce=""
while [ -z "$FOO" ] ; do
@@ -1224,7 +1194,7 @@ while [ -z "$FOO" ] ; do
esac
done
DOMAINNAME="box.name"
DOMAINNAME=`hostname -f`
FOO=""
runonce=""
while [ -z "$FOO" ] ; do
@@ -1244,6 +1214,45 @@ while [ -z "$FOO" ] ; do
done
DOMAINNAME=$cc
if [ -n "$OPENSSL" ] ; then
FOO=""
runonce=""
while [ -z "$FOO" ] ; do
if [ -n "$CRYPTOIRCD" ] ; then
FOO="Yes"
else
FOO="No"
fi
echo ""
echo "Do you want to support encrypted connections"
echo $n "[$FOO] -> $c"
if [ -z "$AUTO_CONFIG" -o -n "$runonce" ] ; then
read cc
else
cc=""
runonce=Yes
fi
if [ -z "$cc" ] ; then
cc=$FOO
fi
case "$cc" in
[Yy]*)
CRYPTOIRCD="1"
CRYPTOLIB="-lcrypto"
;;
[Nn]*)
CRYPTOIRCD=""
;;
*)
echo ""
echo "You need to enter either Yes or No here..."
echo ""
FOO=""
;;
esac
done
fi
FOO=""
runonce=""
while [ -z "$FOO" ] ; do
@@ -1317,6 +1326,77 @@ while [ -z "$FOO" ] ; do
esac
done
FOO=""
runonce=""
while [ -z "$FOO" ] ; do
if [ -n "$CRYPT_XLINE_PASSWORD" ] ; then
FOO="yes"
else
FOO="No"
fi
echo ""
echo "Do you want to use encrypted Restart/Die passwords?"
echo $n "[$FOO] -> $c"
if [ -z "$AUTO_CONFIG" -o -n "$runonce" ] ; then
read cc
else
cc=""
runonce=Yes
fi
if [ -z "$cc" ] ; then
cc=$FOO
fi
case "$cc" in
[Yy]*)
CRYPT_XLINE_PASSWORD="1"
;;
[Nn]*)
CRYPT_XLINE_PASSWORD=""
;;
*)
echo ""
echo "You need to enter either Yes or No here..."
echo ""
FOO=""
;;
esac
done
FOO=""
runonce=""
while [ -z "$FOO" ] ; do
if [ -n "$CRYPT_ILINE_PASSWORD" ] ; then
FOO="Yes"
else
FOO="No"
fi
echo ""
echo "Do you want to use encrypted I:line passwords?"
echo $n "[$FOO] -> $c"
if [ -z "$AUTO_CONFIG" -o -n "$runonce" ] ; then
read cc
else
cc=""
runonce=Yes
fi
if [ -z "$cc" ] ; then
cc=$FOO
fi
case "$cc" in
[Yy]*)
CRYPT_ILINE_PASSWORD="1"
;;
[Nn]*)
CRYPT_ILINE_PASSWORD=""
;;
*)
echo ""
echo "You need to enter either Yes or No here..."
echo ""
FOO=""
;;
esac
done
FOO=""
runonce=""
while [ -z "$FOO" ] ; do
@@ -1437,7 +1517,10 @@ while [ -z "$FOO" ] ; do
;;
esac
done
echo ""
echo ""
$CCPATH -o src/fdmaxcounter src/fdmaxcounter.c
src/fdmaxcounter
FOO=""
runonce=""
while [ -z "$FOO" ] ; do
@@ -1450,6 +1533,8 @@ else
fi
echo ""
echo "How many file descriptors (or sockets) can the irc server use?"
echo "(The result above, if any - shows how many sockets that the ircd can use",
echo " and can be used as an answer here)"
echo $n "[$FOO] -> $c"
if [ -z "$AUTO_CONFIG" -o -n "$runonce" ] ; then
read cc
@@ -1554,6 +1639,31 @@ else
$RM -f Makefile.tmp
fi
if [ -n "$CRYPTOLIB" ] ; then
$RM -f Makefile.tmp
sed -e "s@^CRYPTOLIB=\(.*\)@CRYPTOLIB=$CRYPTOLIB@" Makefile > Makefile.tmp
cp Makefile.tmp Makefile
$RM -f Makefile.tmp
else
$RM -f Makefile.tmp
sed -e "s@^CRYPTOLIB=\(.*\)@CRYPTOLIB=@" Makefile > Makefile.tmp
cp Makefile.tmp Makefile
$RM -f Makefile.tmp
fi
if [ -n "$REGEX" ] ; then
$RM -f Makefile.tmp
sed -e "s@^REGEX=\(.*\)@REGEX=@" Makefile > Makefile.tmp
cp Makefile.tmp Makefile
$RM -f Makefile.tmp
else
$RM -f Makefile.tmp
sed -e "s@^REGEX=\(.*\)@REGEX=../extras/regex/regex.o@" Makefile > Makefile.tmp
cp Makefile.tmp Makefile
$RM -f Makefile.tmp
fi
$RM -f $EXEC $TMP
$RM -f ./core
@@ -1588,28 +1698,43 @@ if [ -n "$CRYPT_OPER_PASSWORD" ] ; then
else
echo "#undef CRYPT_OPER_PASSWORD" >> $OPTIONS_H
fi
if [ -n "$CRYPTOIRCD" ] ; then
echo "#define CRYPTOIRCD 1" >> $OPTIONS_H
else
echo "#undef CRYPTOIRCD" >> $OPTIONS_H
fi
if [ -n "$CRYPT_LINK_PASSWORD" ] ; then
echo "#define CRYPT_LINK_PASSWORD 1" >> $OPTIONS_H
else
echo "#undef CRYPT_LINK_PASSWORD" >> $OPTIONS_H
fi
if [ -n "$CRYPT_ILINE_PASSWORD" ] ; then
echo "#define CRYPT_ILINE_PASSWORD 1" >> $OPTIONS_H
else
echo "#undef CRYPT_ILINE_PASSWORD" >> $OPTIONS_H
fi
if [ -n "$CRYPT_XLINE_PASSWORD" ] ; then
echo "#define CRYPT_XLINE_PASSWORD 1" >> $OPTIONS_H
else
echo "#undef CRYPT_XLINE_PASSWORD" >> $OPTIONS_H
fi
if [ -n "$HUB" ] ; then
echo "#define HUB 1" >> $OPTIONS_H
else
echo "#undef HUB" >> $OPTIONS_H
fi
if [ -n "$REGEX" ] ; then
echo "#define HAVE_REGEX 1" >> $OPTIONS_H
else
echo "#undef HAVE_REGEX" >> $OPTIONS_H
fi
if [ -n "$NOSPOOF" ] ; then
echo "#define NOSPOOF 1" >> $OPTIONS_H
else
echo "#undef NOSPOOF" >> $OPTIONS_H
fi
if [ -n "$NOSPOOF_SEED01" ] ; then
echo "#define NOSPOOF_SEED01 $NOSPOOF_SEED01" >> $OPTIONS_H
fi
if [ -n "$NOSPOOF_SEED02" ] ; then
echo "#define NOSPOOF_SEED02 $NOSPOOF_SEED02" >> $OPTIONS_H
fi
if [ "$OSNAME" = "Linux (with GLIBC 2.x or greater)" ]; then
echo "#define GLIBC2_x" >> $OPTIONS_H
@@ -1632,12 +1757,12 @@ cat > $OPTIONS << __EOF__
IRCNET="$IRCNET"
LAST_VERSION="$IRCD_VERSION"
NOSPOOF="$NOSPOOF"
NOSPOOF_SEED01="$NOSPOOF_SEED01"
NOSPOOF_SEED02="$NOSPOOF_SEED02"
DPATH="$DPATH"
SPATH="$SPATH"
CRYPT_OPER_PASSWORD="$CRYPT_OPER_PASSWORD"
CRYPT_LINK_PASSWORD="$CRYPT_LINK_PASSWORD"
CRYPT_ILINE_PASSWORD="$CRYPT_ILINE_PASSWORD"
CRYPT_XLINE_PASSWORD="$CRYPT_XLINE_PASSWORD"
LISTEN_SIZE="$LISTEN_SIZE"
MAXSENDQLENGTH="$MAXSENDQLENGTH"
BUFFERPOOL="$BUFFERPOOL"
@@ -1670,8 +1795,8 @@ cat << __EOF__
|_____________________________________________________________________|
|_____________________________________________________________________|
| - The UnrealIRCd Team - |
| * Stskeeps stskeeps@tspre.org
| * codemastr codemastr@tspre.org
| * DrBin drbin@tspre.org
| * Stskeeps stskeeps@tspre.org |
| * codemastr codemastr@tspre.org |
| * DrBin drbin@tspre.org |
|_____________________________________________________________________|
__EOF__
+12 -5
View File
@@ -33,7 +33,7 @@ FROMDOS=/home/cmunk/bin/4dos
#
XCFLAGS=
IRCDLIBS=
CRYPTOLIB=
#
# use the following on MIPS:
#CFLAGS= -systype bsd43 -DSYSTYPE_BSD43 -I$(INCLUDEDIR)
@@ -97,6 +97,12 @@ IRCDDIR=/usr/local/lib/ircd
# The rest are perfectly content with this.
RES=
#
# If your system is lacking regex, uncomment this line
#
#REGEX=../extras/regex/regex.o
REGEX=
# [CHANGEME]
# If you get a compile-time error dealing with u_int32_t, comment out
# this line.
@@ -133,7 +139,8 @@ MAKEARGS = 'CFLAGS=${CFLAGS}' 'CC=${CC}' 'IRCDLIBS=${IRCDLIBS}' \
'BINDIR=${BINDIR}' 'INSTALL=${INSTALL}' \
'INCLUDEDIR=${INCLUDEDIR}' 'IRCDDIR=${IRCDDIR}' \
'MANDIR=${MANDIR}' 'RM=${RM}' 'CP=${CP}' 'TOUCH=${TOUCH}' \
'RES=${RES}' 'SHELL=${SHELL}' 'STRTOUL=${STRTOUL}'
'RES=${RES}' 'SHELL=${SHELL}' 'STRTOUL=${STRTOUL}' \
'CRYPTOLIB=${CRYPTOLIB}' 'REGEX=${REGEX}'
server:
build:
@@ -174,8 +181,8 @@ clean:
cleandir: clean
rm -rf include/networks.h include/setup.h include/settings.h Makefile Settings
makex: fromdos
chmod +x Config newnet bsdinstall ircd ircdcron/ircdchk killircd
makex:
chmod +x Config newnet ircd ircdcron/ircdchk killircd
chmod +x makeconf rehash ircdreg
fromdos: cleandir
@@ -186,7 +193,7 @@ fromdos: cleandir
$(FROMDOS) -dv crypt/*
$(FROMDOS) -dv ircdcron/*
makedist: makex
echo "Making UnrealIRCd compatible IRCd Dist."
echo "Stamping.."
stamp: makedist
echo "/* Auto created release stamping */" > include/stamp.h
-13
View File
@@ -1,13 +0,0 @@
WARNING! WARNING! WARNING! WARNING! WARNING!
============================================
THIS IS AN BETA VERSION OF UNREAL. THIS IS
AT NO WAY SUPPORTED BY THE DEVELOPERS. DO NOT
COMPLAIN ABOUT ANY DAMAGE CAUSED WITH THIS VERSION
OF UNREALIRCD - AS THIS IS A VERSION IN DEVELOPMENT.
If - however you decide to compile and run this version
please tell us if you find any bugs, please mail
unreal-dev@lists.sourceforge.net if you do. Any
ideas for features etc goes to same address.
-3
View File
@@ -38,12 +38,9 @@ Assigned to DrBin:
or something :P
(from irc2.10.3)
* CTCP flood protection(?)
* More /HTM stuff, when HTM is active certain features are disabled
* A /who flag system, like bahamut's
* More unrealircd.conf options
* Something like bahamut/hybrids P:line system where you can specify
which IPs can you a specific port, maybe port specific passwords too?
* /hush or /shun (shun most likely)
* add -SIGTERM support, /restarts on SIGTERM
* Recode dynconf and all the other new confs
* Make proxy scanner scan port 23 also (postponed)
+2
View File
@@ -11,6 +11,8 @@ NOTE: tspre.org does not exist at the moment,
as I dont have a shell for it anymore.
If anyone want to donate a shell with a background process,
and 1 IP with port 6667 open, they are welcome.
however, when i get my adsl connection, it will run off that - on a
50mhz machine *g*
+11 -6
View File
@@ -10,12 +10,17 @@
* http://unreal.tspre.org or http://unreal.sourceforge.net
* ftp://unreal.sourceforge.net/pub/unreal
CVS Repository:
* Alpha versions (or beta)
==========================
cvs -z9 -d :pserver:anonymous@cvs.unreal.sourceforge.net:/cvsroot/unreal login
(just press enter when it asks for password)
cvs -z9 -d :pserver:anonymous@cvs.unreal.sourgeforge.net:/cvsroot/unreal co alpha
CVS:
To get anonymous access: (read only)
"cvs -d :pserver:anonymous@cvs.ircsystems.net:/home/cmunk/ircsystems/cvsroot login"
press enter when asked for password
and to get latest stable:
"cvs -d :pserver:anonymous@cvs.ircsystems.net:/home/cmunk/ircsystems/cvsroot checkout -r stable -d Unreal-stable unreal"
latest beta:
"cvs -d :pserver:anonymous@cvs.ircsystems.net:/home/cmunk/ircsystems/cvsroot checkout -r beta -d Unreal-beta unreal"
* To get support
================
+54
View File
@@ -0,0 +1,54 @@
#
# Unreal Internet Relay Chat Daemon
# Copyright (C) Carsten V. Munk 2000
#
# NOTE: Those words are not meant to insult you (the user)
# but is meant to be a list of words so that the +G channel/user mode
# will work properly. You can easily modify this file at your will.
# If you got words to add to this file, please mail badwords@tspre.org
#
#
#
#
#
#
# This is some filling space, scroll down to see the words
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
pussy
fuck
whore
slut
shit
asshole
bitch
cunt
vagina
penis
jackass
*fucker*
faggot
fag
horny
gay
dickhead
sonuvabitch
*fuck*
ass
boobs
tits
+54
View File
@@ -0,0 +1,54 @@
#
# Unreal Internet Relay Chat Daemon
# Copyright (C) Carsten V. Munk 2000
#
# NOTE: Those words are not meant to insult you (the user)
# but is meant to be a list of words so that the +G channel/user mode
# will work properly. You can easily modify this file at your will.
# If you got words to add to this file, please mail badwords@tspre.org
#
#
#
#
#
#
# This is some filling space, scroll down to see the words
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
pussy
fuck
whore
slut
shit
asshole
bitch
cunt
vagina
penis
jackass
*fucker*
faggot
fag
horny
gay
dickhead
sonuvabitch
*fuck*
ass
boobs
tits
-84
View File
@@ -1,84 +0,0 @@
#! /bin/sh
#
# $Id$
# Old: @(#)install.sh 4.5 (Berkeley) 10/12/83
#
cmd=/bin/mv
strip=""
chmod="/bin/chmod 755"
chown="chown -f root"
chgrp="/bin/chgrp -f bin"
while true ; do
case $1 in
-s ) strip="strip"
shift
;;
-c ) cmd="/bin/cp"
shift
;;
-m ) chmod="/bin/chmod $2"
shift
shift
;;
-o ) chown="/etc/chown -f $2"
shift
shift
;;
-g ) chgrp="/bin/chgrp -f $2"
shift
shift
;;
-d ) cmd="/bin/mkdir"
shift
;;
* ) break
;;
esac
done
if [ ! ${2-""} ]
then echo "install: no destination specified"
exit 1
fi
if [ ${3-""} ]
then echo "install: too many files specified -> $*"
exit 1
fi
if [ $1 = $2 -o $2 = . ]
then echo "install: can't move $1 onto itself"
exit 1
fi
case $cmd in
/bin/mkdir )
file=$2/$1
;;
* )
if [ '!' -f $1 ]
then echo "install: can't open $1"
exit 1
fi
if [ -d $2 ]
then file=$2/$1
else file=$2
fi
/bin/rm -f $file
;;
esac
case $cmd in
/bin/mkdir )
if [ ! -d "$file" ]
then $cmd $file
fi
;;
* )
$cmd $1 $file
if [ $strip ]
then $strip $file
fi
;;
esac
$chown $file
$chgrp $file
$chmod $file
+191
View File
@@ -0,0 +1,191 @@
UnrealIRCd Encryption Protocol
version 1.0
by Carsten V. Munk (stskeeps@tspre.org)
1. Introduction
---------------
As of UnrealIRCd version 3.1 we have included capability for secure
connections (Encrypted IRC connections). This was done after I read an "Ask
Slashdot" article at slashdot.org, (http://slashdot.org/askslashdot/00/04/19/0443251.shtml)
where a guy asked:
cylent asks: "I have a close-knit group of acquaintances that like to communicate with each other
often. Public IRC servers are fine for chit-chat, although for more in-depth discussions a more
secure form of communication is preferred. I'm wondering what GPL'd software exists to provide for a
secure form of realtime multi-party communication. Are there any IRC servers/clients that support any
form of public key cryptography? Blowfish? 3DES? Are there any other proprietary "chat"
programs available with a forte in cryptography?".
I sat down, did some thoughts. The thing would not be public key, as I
believe client and server should have a keyfile, picked up by SSL, SSH
whatever. The communication would be client<->server, so that the stream
would be encrypted. Safest way to ensure 100% secure communications would be
to set up the IRC server, and join in with only secure communications to
same channel where no non secure clients were and set it +is.
Server<->server communications are not encrypted (yet), but we're working on
it. However, here is a description of the protocol:
2. System Requiriments
--------------------------------
* OpenSSL (with libcrypto), win32 port also availible, read unreal.tspre.org
for more information. Read http://www.openssl.org for more information
(you need the openssl/ directory in includes to compile)
3. Negotiating the secure connection
------------------------------------
The client connects, and sends: (normal irc with \r\n as terminates)
CRYPTO <algoritm> <keyfilename> <parameters>
| | |
| | \--- Unused currently, use "*"
| \--- The name of the file in keys/ containing the key
\--- This is algoritm name, in uppercase (see algoritm list)
NOTE: the keyfilename must not contain a / or a \
Until connection is negotiated the connection is in non-secure mode (normal
irc protocol, see RFC 1459)
The server then responds, if the key was acknowledged:
CRYPTO ON <algoritm>
\---- (see algoritm list, this is in uppercase)
and the connecting is marked as secure, sending secure packets now.
The server responds, if an error has occoured:
CRYPTO ERROR :test
And the secure connection is disabled
Some example errors:
CRYPTO ERROR :Illegal keypath
- Means that keyfilename in CRYPTO command was illegal
CRYPTO ERROR :Failed to open keyfile <filename>
- Means that the IRCd failed to open the keyfile
CRYPTO ERROR :Unable to read keyfile <filename>
- Means that the IRCd failed to read the keyfile
CRYPTO ERROR :No such method/command <command>
- Means that the method (algoritm) or command does not exist
4. The stream packets
---------------------
When secure mode (CRYPTO ON), is acknowledged the IRCd sends, and expects
to recieve packets with the encrypted data.
The packet is started with a header
struct crypto_header
{
unsigned char highbyte;
unsigned char lowbyte;
};
after the header, a buffer with exact length ((highbyte * 256) + lowbyte)
is coming after (binary buffer). When the string is recieved, decrypt using
the cipher.
Example function: (this decrypts a buffer), wont work with direct paste, but
you can see the principle:
char *ep_decrypt(aClient *cptr, char *string)
{
static char decryptbuffer[8192];
int num;
char ivec[9];
int length;
if (!cptr->cryptinfo)
return string;
bzero(decryptbuffer, sizeof(decryptbuffer));
bzero(ivec, sizeof(ivec));
num = 0;
length = (*(string) * 256) + (*(string + 1));
if (cptr->cryptinfo->method == METHOD_BLOWFISH)
{
BF_cfb64_encrypt(string + 2, decryptbuffer, length,
cptr->cryptinfo->key, ivec, &num, BF_DECRYPT);
return (decryptbuffer);
}
}
The IRCd expects same format back, here is what the ircd encrypts with:
char *ep_encrypt(aClient *cptr, char *string, int *len)
{
static unsigned char cryptobuffer[8192];
char ivec[9];
int length;
char *c;
int num;
if (!cptr->cryptinfo)
return string;
bzero(cryptobuffer, sizeof(cryptobuffer));
bzero(ivec, sizeof(ivec));
num = 0;
if ((c = (char *)strchr(string, '\n')))
*c = '\0';
if ((c = (char *)strchr(string, '\r')))
*c = '\0';
length = strlen(string) + 1;
cryptobuffer[0] = (unsigned char) length / 256;
cryptobuffer[1] = (unsigned char) length - (cryptobuffer[0] * 256);
if (cptr->cryptinfo->method == METHOD_BLOWFISH)
{
BF_cfb64_encrypt(string, &cryptobuffer[2], length,
cptr->cryptinfo->key, ivec, &num, BF_ENCRYPT);
*len = length + 2;
return (cryptobuffer);
}
}
To abort the secure connection, either QUIT (to exit completely), or
send CRYPT OFF.
5. Algoritms
------------
As of Unreal3.1 only BLOWFISH is implemented, but there will be patches
for extended algoritms. We use the <openssl/blowfish.h> include at the
moment.
Mail stskeeps@tspre.org if you show interest in other algoritms
6. Credits
----------
Credits to the UnrealIRCd team (me, codemastr, DrBin)
Credits to slashdot.org as well.
This product includes software developed by Eric Young (eay@cryptsoft.com)
7. Contact info
----------------
Mail stskeeps@tspre.org for any questions
+9 -4
View File
@@ -4,17 +4,22 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef HAVE_REGEX
#include <regex.h>
#else
#include "../extras/regex/regex.h"
#endif
#define MAX_MATCH 1
#define MAX_WORDLEN 64
#define MAX_WORDS 30
#define MAX_WORDS 50
#define PATTERN "\\w*%s\\w*"
#define REPLACEWORD "<censored>"
char *stripbadwords(char *, int);
int loadbadwords(char *, int);
void freebadwords(void);
char *stripbadwords(char *, int);
int loadbadwords(char *, int);
void freebadwords(void);
#endif
+4 -4
View File
@@ -21,8 +21,8 @@
#ifndef __channel_include__
#define __channel_include__
#define CREATE 1 /* whether a channel should be
created or just tested for existance */
#define CREATE 1 /* whether a channel should be
created or just tested for existance */
#define MODEBUFLEN 200
@@ -38,7 +38,7 @@
*/
#include "msg.h"
#define MAXMODEPARAMS (MAXPARA-2) /* Maximum modes processed */
#define RESYNCMODES 12 /* Max modes per MODE in resync */
#define MODEPARAMS 6 /* Max modes from user */
#define RESYNCMODES 12 /* Max modes per MODE in resync */
#define MODEPARAMS 6 /* Max modes from user */
#endif
+9 -12
View File
@@ -7,21 +7,18 @@
#ifndef CIO
#define CIO
typedef struct tag_CioLine
{
BYTE *Data;
WORD Len;
struct tag_CioLine *Prev, *Next;
typedef struct tag_CioLine {
BYTE *Data;
WORD Len;
struct tag_CioLine *Prev, *Next;
} CioLine;
typedef struct tag_CioWndInfo
{
typedef struct tag_CioWndInfo {
CioLine *FirstLine, *CurLine;
int Lines, Scroll;
int Width, Height, XChar, YChar, YJunk, ScrollMe;
HFONT hFont;
BYTE FR, FG, FB;
int Lines, Scroll;
int Width, Height, XChar, YChar, YJunk, ScrollMe;
HFONT hFont;
BYTE FR, FG, FB;
} CioWndInfo;
#endif
+3 -2
View File
@@ -10,11 +10,12 @@ BOOL Cio_Init(HINSTANCE hInstance);
// Cio_Main.c
LRESULT CALLBACK Cio_WndProc(HWND, UINT, WPARAM, LPARAM);
HWND Cio_Create(HINSTANCE hInstance, HWND hParent, DWORD Style, int X, int Y, int W, int H);
HWND Cio_Create(HINSTANCE hInstance, HWND hParent, DWORD Style, int X, int Y,
int W, int H);
BOOL Cio_WndCreate(HWND hWnd);
BOOL Cio_WndPaint(HWND hWnd);
BOOL Cio_WndDestroy(HWND hWnd);
BOOL Cio_WndAddString(HWND hWnd, int Len, char *Buffer);
BOOL Cio_WndSize(HWND hWnd, LPARAM lParam);
void Cio_Scroll(HWND hWnd, CioWndInfo *CWI, int Scroll);
void Cio_Scroll(HWND hWnd, CioWndInfo * CWI, int Scroll);
BOOL Cio_PrintF(HWND hWnd, char *InBuf, ...);
+15 -15
View File
@@ -31,12 +31,12 @@
#endif
typedef struct Class {
int class;
int conFreq;
int pingFreq;
int maxLinks;
long maxSendq;
int links;
int class;
int conFreq;
int pingFreq;
int maxLinks;
long maxSendq;
int links;
struct Class *next;
} aClass;
@@ -57,15 +57,15 @@ typedef struct Class {
#define FirstClass() classes
#define NextClass(x) ((x)->next)
extern aClass *classes;
extern aClass *classes;
extern aClass *find_class PROTO((int));
extern int get_conf_class PROTO((aConfItem *));
extern int get_client_class PROTO((aClient *));
extern int get_client_ping PROTO((aClient *));
extern int get_con_freq PROTO((aClass *));
extern void add_class PROTO((int, int, int, int, long));
extern void check_class PROTO((void));
extern void initclass PROTO((void));
extern aClass *find_class PROTO((int));
extern int get_conf_class PROTO((aConfItem *));
extern int get_client_class PROTO((aClient *));
extern int get_client_ping PROTO((aClient *));
extern int get_con_freq PROTO((aClass *));
extern void add_class PROTO((int, int, int, int, long));
extern void check_class PROTO((void));
extern void initclass PROTO((void));
#endif /* __class_include__ */
+24 -17
View File
@@ -79,27 +79,27 @@
#if 0
#ifndef MALLOCH
char *malloc(), *calloc();
void free();
char *malloc(), *calloc();
void free();
#else
#include MALLOCH
#endif
#endif
extern int match PROTO((char *, char *));
extern int match PROTO((char *, char *));
#define mycmp(a,b) \
( (toupper((a)[0])!=toupper((b)[0])) || smycmp((a)+1,(b)+1) )
extern int smycmp PROTO((char *, char *));
extern int smycmp PROTO((char *, char *));
#ifndef GLIBC2_x
extern int myncmp PROTO((char *, char *, int));
#endif
extern int myncmp PROTO((char *, char *, int));
#endif
#ifdef NEED_STRTOK
extern char *strtok2 PROTO((char *, char *));
extern char *strtok2 PROTO((char *, char *));
#endif
#ifdef NEED_STRTOKEN
extern char *strtoken PROTO((char **, char *, char *));
extern char *strtoken PROTO((char **, char *, char *));
#endif
#ifdef NEED_INET_ADDR
extern unsigned long inet_addr PROTO((char *));
@@ -116,7 +116,7 @@ extern char *inet_ntoa PROTO((struct IN_ADDR));
extern int inet_netof PROTO((struct IN_ADDR));
#endif
int global_count, max_global_count;
int global_count, max_global_count;
extern char *myctime PROTO((time_t));
extern char *strtoken PROTO((char **, char *, char *));
@@ -195,21 +195,28 @@ extern char *MyMalloc();
// #define MyFree free
// #endif
extern void flush_connections();
extern struct SLink *find_user_link(/* struct SLink *, struct Client * */);
extern struct SLink *find_user_link( /* struct SLink *, struct Client * */ );
/*
* Protocol support text. DO NO CHANGE THIS unless you know what
* you are doing.
*/
#ifdef ZIP_LINKS
#define ZIPSTUFF " ZIP"
#else
#define ZIPSTUFF ""
#endif
#define PROTOCTL_CLIENT "TOKEN WATCH=128 SAFELIST HCN PREFIX=@+%"
#define PROTOCTL_SERVER "NOQUIT TOKEN NICKv2 SJOIN SJOIN2 UMODE2 ALN"
#define PROTOCTL_SERVER "NOQUIT TOKEN NICKv2 SJOIN SJOIN2 UMODE2 ALN VL SJ3" ZIPSTUFF
#ifdef _WIN32
/*
* Used to display a string to the GUI interface.
* Windows' internal strerror() function doesn't work with socket errors.
*/
extern int DisplayString(HWND hWnd, char *InBuf, ...);
extern int DisplayString(HWND hWnd, char *InBuf, ...);
#undef strerror
#endif
@@ -217,10 +224,10 @@ extern int DisplayString(HWND hWnd, char *InBuf, ...);
extern char *malloc_options;
#endif
extern int lu_noninv, lu_inv, lu_serv, lu_oper,
lu_unknown, lu_channel, lu_lu, lu_lulocal, lu_lserv,
lu_clu, lu_mlu, lu_cglobalu, lu_mglobalu;
time_t now;
extern int lu_noninv, lu_inv, lu_serv, lu_oper,
lu_unknown, lu_channel, lu_lu, lu_lulocal, lu_lserv,
lu_clu, lu_mlu, lu_cglobalu, lu_mglobalu;
time_t now;
#endif /* __common_include__ */
+53 -137
View File
@@ -49,8 +49,8 @@
#endif
/*
* Define this if you're testing/debugging/programming.
*/
* Define this if you're testing/debugging/programming.
*/
#undef DEBUG
/* Type of host. These should be made redundant somehow. -avalon */
@@ -72,7 +72,7 @@
/* Additional flags to give FreeBSD's malloc, only play with this if you
* know what you're doing.
*/
#define MALLOC_FLAGS_EXTRA ""
/*
ConferenceRoom Java Client Hack -Fish
@@ -93,11 +93,28 @@
*/
#define ADMINCHAT 1
/*
Remote rehash
*/
#define REMOTE_REHASH
/*
Stripbadwords patch
*/
#define STRIPBADWORDS
/*
* NO_OPEROVERRIDE
* This will disable OperMode, OperTopic and Banwalks
*/
#undef NO_OPEROVERRIDE
/*
* Disable /sethost, /setident, /chgname, /chghost, /chgident
*/
#undef DISABLE_USERMOD
/*
Ident checking
#define this to disable ident checking
@@ -111,47 +128,11 @@
*/
/* #define NOSPOOF 1 /* */
/*
*
* This controls the "nospoof" system. These numbers are "seeds" of the
* "random" number generating formula. Choose any number you like in the
* range of 0x00000000 to 0xFFFFFFFF. Don't tell anyone these numbers, and
* don't use the default ones. Change both #define NOSPOOF... lines below.
*
* Other data is mixed in as well, but these guarantee a per-server secret.
* Also, these values need not remain constant over compilations... Change
* them as often as you like.
*/
#ifdef NOSPOOF
#ifndef NOSPOOF_SEED01
#define NOSPOOF_SEED01 0x12345678
#endif
#ifndef NOSPOOF_SEED02
#define NOSPOOF_SEED02 0x87654321
#endif
#endif /* NOSPOOF */
/*
* HOSTILENAME - Define this if you want the hostile username patch included,
* it will strip characters that are not 0-9,a-z,A-Z,_,- or .
*/
#define HOSTILENAME /* */
/*
* Define this to prevent mixed case userids that clonebots use. However
* this affects the servers running telclients WLD* FIN* etc.
*/
#undef DISALLOW_MIXED_CASE
/*
* Define this if you wish to ignore the case of the first character of
* the user id when disallowing mixed case. This allows PC users to
* enter the more intuitive first name with the first letter capitalised
*/
#define IGNORE_CASE_FIRST_CHAR
#define HOSTILENAME /* */
/*
** Nick flood limit
@@ -161,7 +142,7 @@
** Define NICK_DELAY if you want this feature.
*/
#define NICK_DELAY 15 /* recommended value 15 */
#define NICK_DELAY 15 /* recommended value 15 */
/*
** Freelinks garbage collector -Stskeeps
@@ -170,10 +151,10 @@
** HOW_MANY_FREELINKS_ALLOWED - how many freelinks allowed
*/
#ifndef GARBAGE_COLLECT_EVERY
#define GARBAGE_COLLECT_EVERY 600 /* default: 600 (10 mins) */
#define GARBAGE_COLLECT_EVERY 600 /* default: 600 (10 mins) */
#endif
#define HOW_MANY_FREELINKS_ALLOWED 200 /* default: 200 */
#define HOW_MANY_FREELINKS_ALLOWED 200 /* default: 200 */
/*
* Define this if you wish to output a *file* to a K lined client rather
@@ -229,16 +210,16 @@
*/
#define CPATH "ircd.conf" /* server configuration file */
#define MPATH "ircd.motd" /* server MOTD file */
#define RPATH "ircd.rules" /* server rules file */
#define RPATH "ircd.rules" /* server rules file */
#define ZPATH "ircd.notes" /* server notes */
#define ZCONF "networks/unrealircd.conf" /* ircd configuration .. */
#define OPATH "oper.motd" /* Operators MOTD file */
#define ZCONF "networks/unrealircd.conf" /* ircd configuration .. */
#define OPATH "oper.motd" /* Operators MOTD file */
#define LPATH "debug.log" /* Where the debug file lives, if DEBUGMODE */
#define PPATH "ircd.pid" /* file for server pid */
#define lPATH "ircd.log" /* server log file */
#define VPATH "ircd.svsmotd" /* Services MOTD append. */
#define VPATH "ircd.svsmotd" /* Services MOTD append. */
#define BPATH "bot.motd" /* Bot MOTD */
#define IRCDTUNE "ircd.tune" /* tuning .. */
#define IRCDTUNE "ircd.tune" /* tuning .. */
/*
* Define this filename to maintain a list of persons who log
@@ -278,13 +259,6 @@
*/
#define SHOW_INVISIBLE_LUSERS
/* OPER_* defines
*
* See ./docs/example.conf for examples of how to restrict access for
* your IRC Operators
*/
/* MAXIMUM LINKS
*
* This define is useful for leaf nodes and gateways. It keeps you from
@@ -323,14 +297,7 @@
* starts up the server with a new conf file that has some extra
* O-lines. So don't use this unless you're debugging.
*/
#define CMDLINE_CONFIG /* allow conf-file to be specified on command line */
/*
* To use m4 as a preprocessor on the ircd.conf file, define M4_PREPROC.
* The server will then call m4 each time it reads the ircd.conf file,
* reading m4 output as the server's ircd.conf file.
*/
#undef M4_PREPROC
#define CMDLINE_CONFIG /* allow conf-file to be specified on command line */
/*
* If you wish to have the server send 'vital' messages about server
@@ -349,11 +316,11 @@
* If you use syslog above, you may want to turn some (none) of the
* spurious log messages for KILL/SQUIT off.
*/
#undef SYSLOG_KILL /* log all operator kills to syslog */
#undef SYSLOG_SQUIT /* log all remote squits for all servers to syslog */
#undef SYSLOG_CONNECT /* log remote connect messages for other all servs */
#undef SYSLOG_USERS /* send userlog stuff to syslog */
#undef SYSLOG_OPER /* log all users who successfully become an Op */
#undef SYSLOG_KILL /* log all operator kills to syslog */
#undef SYSLOG_SQUIT /* log all remote squits for all servers to syslog */
#undef SYSLOG_CONNECT /* log remote connect messages for other all servs */
#undef SYSLOG_USERS /* send userlog stuff to syslog */
#undef SYSLOG_OPER /* log all users who successfully become an Op */
/*
* If you want to log to a different facility than DAEMON, change
@@ -362,15 +329,6 @@
#define LOG_FACILITY LOG_DAEMON
#endif /* USE_SYSLOG */
/*
* IDLE_FROM_MSG
*
* Idle-time nullified only from privmsg, if undefined idle-time
* is nullified from everything except ping/pong.
* Added 3.8.1992, kny@cs.hut.fi (nam)
*/
#define IDLE_FROM_MSG
/*
* Size of the LISTEN request. Some machines handle this large
* without problem, but not all. It defaults to 5, but can be
@@ -413,13 +371,13 @@
* If you _must_ insist on running as root and not wanting the program to change its
* UID, then define BIG_SECURITY_HOLE below
*/
#if !defined(_WIN32) && !defined(_AMIGA)
/* Change This Line Below \/ */
#define BIG_SECURITY_HOLE
#if !defined(_WIN32)
/* Change This Line Below \/ */
#define BIG_SECURITY_HOLE
/* Its the one above ^^^^^^^ */
#ifndef BIG_SECUTIRY_HOLE
#define IRC_UID un_uid
#define IRC_GID un_gid
#ifndef BIG_SECURITY_HOLE
#define IRC_UID un_uid
#define IRC_GID un_gid
#endif
#endif
@@ -432,10 +390,6 @@
*/
#define CLIENT_FLOOD 8000
/* Define this if you want the server to accomplish ircII standard */
/* Sends an extra NOTICE in the beginning of client connection */
#undef IRCII_KLUDGE
/*
* Define your network service names here.
*/
@@ -483,9 +437,6 @@
*/
#define SOCKSPORT 6013
/* Define default Z:line time for SOCKS -taz */
#define ZLINE_TIME 300
/* STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP */
/* You shouldn't change anything below this line, unless absolutely needed. */
@@ -494,7 +445,7 @@
* Port where ircd resides. NOTE: This *MUST* be greater than 1024 if you
* plan to run ircd under any other uid than root.
*/
#define PORTNUM 6667 /* 6667 is default */
#define PORTNUM 6667 /* 6667 is default */
/*
* Maximum number of network connections your server will allow. This should
@@ -535,7 +486,7 @@
* chasing possible for mode and kick.
*/
#ifndef NICKNAMEHISTORYLENGTH
#define NICKNAMEHISTORYLENGTH 2000
#define NICKNAMEHISTORYLENGTH 2000
#endif
/*
@@ -587,17 +538,7 @@
* Max time from the nickname change that still causes KILL
* automaticly to switch for the current nick of that user. (seconds)
*/
#define KILLCHASETIMELIMIT 90 /* Recommended value: 90 */
/*
* SendQ-Always causes the server to put all outbound data into the sendq and
* flushing the sendq at the end of input processing. This should cause more
* efficient write's to be made to the network.
* There *shouldn't* be any problems with this method.
* -avalon
*/
#define SENDQ_ALWAYS
#define KILLCHASETIMELIMIT 90 /* Recommended value: 90 */
/* ------------------------- END CONFIGURATION SECTION -------------------- */
#define MOTD MPATH
@@ -618,11 +559,6 @@
#endif
#endif
#ifdef _SEQUENT_ /* Dynix 1.4 or 2.0 Generic Define.. */
#undef BSD
#define SYSV /* Also #define SYSV */
#endif
#ifdef ultrix
#define ULTRIX
#endif
@@ -643,7 +579,7 @@
#endif
#ifdef DEBUGMODE
extern void debug();
extern void debug();
# define Debug(x) debug x
# define LOGFILE LPATH
#else
@@ -665,72 +601,57 @@ extern void debug();
#ifdef MIPS
#undef BSD
#define BSD 1 /* mips only works in bsd43 environment */
#endif
#ifdef sequent /* Dynix (sequent OS) */
#define SEQ_NOFILE 128 /* set to your current kernel impl, */
#endif /* max number of socket connections */
#ifdef _SEQUENT_
#define DYNIXPTX
#define BSD 1 /* mips only works in bsd43 environment */
#endif
#ifdef BSD_RELIABLE_SIGNALS
# if defined(SYSV_UNRELIABLE_SIGNALS) || defined(POSIX_SIGNALS)
error You stuffed up config.h signals #defines use only one.
error You stuffed up config.h signals
#defines use only one.
# endif
#define HAVE_RELIABLE_SIGNALS
#endif
#ifdef SYSV_UNRELIABLE_SIGNALS
# ifdef POSIX_SIGNALS
error You stuffed up config.h signals #defines use only one.
error You stuffed up config.h signals
#defines use only one.
# endif
#undef HAVE_RELIABLE_SIGNALS
#endif
#ifdef POSIX_SIGNALS
#define HAVE_RELIABLE_SIGNALS
#endif
/*
* safety margin so we can always have one spare fd, for motd/authd or
* whatever else. -4 allows "safety" margin of 1 and space reserved.
*/
#define MAXCLIENTS (MAXCONNECTIONS-4)
#ifdef HAVECURSES
# define DOCURSES
#else
# undef DOCURSES
#endif
#ifdef HAVETERMCAP
# define DOTERMCAP
#else
# undef DOTERMCAP
#endif
# define stricmp strcasecmp
# define strnicmp strncasecmp
#if defined(CLIENT_FLOOD)
# if (CLIENT_FLOOD > 8000)
# define CLIENT_FLOOD 8000
# else
# if (CLIENT_FLOOD < 512)
error CLIENT_FLOOD needs redefining.
error CLIENT_FLOOD needs redefining.
# endif
# endif
#else
error CLIENT_FLOOD undefined
error CLIENT_FLOOD undefined
#endif
#if (NICKNAMEHISTORYLENGTH < 100)
# define NICKNAMEHISTORYLENGTH 100
#endif
/*
* Some ugliness for AIX platforms.
*/
@@ -753,8 +674,6 @@ error CLIENT_FLOOD undefined
#if defined(SOL20) || defined(SOL25) || defined(SOL26) || defined(SOL27)
#define _SOLARIS
#endif
/*
* Cleaup for WIN32 platform.
*/
@@ -773,7 +692,4 @@ error CLIENT_FLOOD undefined
#define Reg8 register
#define Reg9 register
#define Reg10 register
#endif /* __config_include__ */
#endif /* __config_include__ */
+20 -32
View File
@@ -45,25 +45,14 @@
** implementation of this package without changing the
** interface.
*/
#if !defined(_SEQUENT_)
typedef struct dbuf
{
u_int length; /* Current number of bytes stored */
u_int offset; /* Offset to the first byte */
struct dbufbuf *head; /* First data buffer, if length > 0 */
typedef struct dbuf {
u_int length; /* Current number of bytes stored */
u_int offset; /* Offset to the first byte */
struct dbufbuf *head; /* First data buffer, if length > 0 */
/* added by mnystrom@mit.edu: */
struct dbufbuf *tail; /* last data buffer, if length > 0 */
} dbuf;
#else
typedef struct dbuf
{
uint length; /* Current number of bytes stored */
uint offset; /* Offset to the first byte */
struct dbufbuf *head; /* First data buffer, if length > 0 */
/* added by mnystrom@mit.edu: */
struct dbufbuf *tail; /* last data buffer, if length > 0 */
} dbuf;
#endif
struct dbufbuf *tail; /* last data buffer, if length > 0 */
} dbuf;
/*
** And this 'dbufbuf' should never be referenced outside the
** implementation of 'dbuf'--would be "hidden" if C had such
@@ -73,11 +62,10 @@ typedef struct dbuf
** as long as a pointer is 4 bytes, we get 2032 bytes for buffer
** data after we take away a bit for malloc to play with. -avalon
*/
typedef struct dbufbuf
{
struct dbufbuf *next; /* Next data buffer, NULL if this is last */
char data[2032]; /* Actual data stored here */
} dbufbuf;
typedef struct dbufbuf {
struct dbufbuf *next; /* Next data buffer, NULL if this is last */
char data[2032]; /* Actual data stored here */
} dbufbuf;
/*
** dbuf_put
@@ -88,10 +76,10 @@ typedef struct dbufbuf
** returns > 0, if operation successfull
** < 0, if failed (due memory allocation problem)
*/
int dbuf_put PROTO((dbuf *, char *, int));
int dbuf_put PROTO((dbuf *, char *, int));
/* Dynamic buffer header */
/* Pointer to data to be stored */
/* Number of bytes to store */
/* Pointer to data to be stored */
/* Number of bytes to store */
/*
** dbuf_get
@@ -108,10 +96,10 @@ int dbuf_put PROTO((dbuf *, char *, int));
** Negative return values indicate some unspecified
** error condition, rather fatal...
*/
int dbuf_get PROTO(( dbuf *, char *, int));
int dbuf_get PROTO((dbuf *, char *, int));
/* Dynamic buffer header */
/* Pointer to buffer to receive the data */
/* Max amount of bytes that can be received */
/* Pointer to buffer to receive the data */
/* Max amount of bytes that can be received */
/*
** dbuf_map, dbuf_delete
@@ -138,8 +126,8 @@ int dbuf_get PROTO(( dbuf *, char *, int));
** between map and delete functions...
*/
char *dbuf_map PROTO((dbuf *, int *));
/* Dynamic buffer header */
/* Return number of bytes accessible */
/* Dynamic buffer header */
/* Return number of bytes accessible */
int dbuf_delete PROTO((dbuf *, int));
/* Dynamic buffer header */
@@ -160,6 +148,6 @@ int dbuf_delete PROTO((dbuf *, int));
*/
#define DBufClear(dyn) dbuf_delete((dyn),DBufLength(dyn))
extern int dbuf_getmsg PROTO((dbuf *, char *, int));
extern int dbuf_getmsg PROTO((dbuf *, char *, int));
#endif /* __dbuf_include__ */
+44 -46
View File
@@ -26,62 +26,60 @@
#define DYNCONF_CONF_VERSION "1.5"
#define DYNCONF_NETWORK_VERSION "2.2"
typedef struct zNetwork aNetwork;
struct zNetwork {
unsigned x_inah : 1;
char *x_ircnetwork;
char *x_defserv;
char *x_services_name;
char *x_oper_host;
char *x_admin_host;
char *x_locop_host;
char *x_sadmin_host;
char *x_netadmin_host;
char *x_coadmin_host;
char *x_techadmin_host;
char *x_hidden_host;
char *x_netdomain;
char *x_helpchan;
char *x_stats_server;
typedef struct zNetwork aNetwork;
struct zNetwork {
unsigned x_inah:1;
char *x_ircnetwork;
char *x_defserv;
char *x_services_name;
char *x_oper_host;
char *x_admin_host;
char *x_locop_host;
char *x_sadmin_host;
char *x_netadmin_host;
char *x_coadmin_host;
char *x_techadmin_host;
char *x_hidden_host;
char *x_netdomain;
char *x_helpchan;
char *x_stats_server;
};
typedef struct zConfiguration aConfiguration;
struct zConfiguration {
unsigned som : 1;
unsigned mode_x : 1;
unsigned mode_i : 1;
unsigned mode_stripbadwords : 1;
unsigned truehub : 1;
unsigned stop : 1;
unsigned showopers : 1;
unsigned killdiff : 1;
unsigned hide_ulines : 1;
unsigned allow_chatops : 1;
unsigned webtv_support : 1;
unsigned no_oper_hiding : 1;
struct zConfiguration {
unsigned som:1;
unsigned mode_x:1;
unsigned mode_i:1;
unsigned mode_stripbadwords:1;
unsigned truehub:1;
unsigned stop:1;
unsigned showopers:1;
unsigned killdiff:1;
unsigned hide_ulines:1;
unsigned allow_chatops:1;
unsigned webtv_support:1;
unsigned no_oper_hiding:1;
/* long nospoof_seed01;
long nospoof_seed02; */
long host_timeout;
int host_retries;
char *kline_address;
char *include;
char *domainname;
char *domainmask; /* '*' + domainname */
char *auto_join_chans;
char *oper_auto_join_chans;
int socksbantime;
int maxchannelsperuser;
char *socksbanmessage;
char *socksquitmessage;
aNetwork network;
long host_timeout;
int host_retries;
char *kline_address;
char *include;
char *domainname;
char *domainmask; /* '*' + domainname */
char *auto_join_chans;
char *oper_auto_join_chans;
int socksbantime;
int maxchannelsperuser;
char *socksbanmessage;
char *socksquitmessage;
aNetwork network;
};
#ifndef DYNCONF_C
extern aConfiguration iConf;
extern aConfiguration iConf;
#endif
// #define NOSPOOF_SEED01 iConf.nospoof_seed01
// #define NOSPOOF_SEED02 iConf.nospoof_seed02
#define KLINE_ADDRESS iConf.kline_address
#define INCLUDE iConf.include
#define DOMAINNAMEMASK "*" DOMAINNAME
+7 -7
View File
@@ -4,21 +4,21 @@
/* $Id$ */
typedef struct fdstruct {
int entry[MAXCONNECTIONS + 2];
int last_entry;
int entry[MAXCONNECTIONS + 2];
int last_entry;
} fdlist;
void addto_fdlist(int a, fdlist * b);
void delfrom_fdlist(int a, fdlist * b);
void init_fdlist(fdlist * b);
void addto_fdlist(int a, fdlist * b);
void delfrom_fdlist(int a, fdlist * b);
void init_fdlist(fdlist * b);
#ifndef TRUE
#define TRUE 1
#endif
#define LOADCFREQ 5
#define LOADRECV 35
#define FDLISTCHKFREQ 2
#define FDLISTCHKFREQ 2
#endif /*
* _IRCD_DOG3_FDLIST
+229 -225
View File
@@ -29,19 +29,24 @@
#include "fdlist.h"
#endif
extern time_t nextconnect, nextdnscheck, nextping;
extern aClient *client, me, *local[];
extern aChannel *channel;
extern struct stats *ircstp;
extern int bootopt;
extern time_t TSoffset;
/* for the new s_err.c */
extern char *getreply(int);
#define rpl_str(x) getreply(x)
#define err_str(x) getreply(x)
extern time_t nextconnect, nextdnscheck, nextping;
extern aClient *client, me, *local[];
extern aChannel *channel;
extern struct stats *ircstp;
extern int bootopt;
extern time_t TSoffset;
/* Prototype added to force errors -- Barubary */
extern time_t check_pings(time_t now, int check_kills);
extern time_t check_pings(time_t now, int check_kills);
/* Remmed out for win32 compatibility.. as stated of 467leaf win32 port.. */
#ifdef _WIN32
// extern void *hCio;
// extern void *hCio;
#endif
#ifdef SHOWCONNECTINFO
@@ -61,282 +66,281 @@ extern time_t check_pings(time_t now, int check_kills);
#define BREPORT_FAIL_ID "NOTICE AUTH :*** No ident response; username prefixed with ~\r\n"
extern char REPORT_DO_DNS[128], REPORT_FIN_DNS[128], REPORT_FIN_DNSC[128],
REPORT_FAIL_DNS[128], REPORT_DO_ID[128], REPORT_FIN_ID[128],
REPORT_FAIL_ID[128];
REPORT_FAIL_DNS[128], REPORT_DO_ID[128], REPORT_FIN_ID[128],
REPORT_FAIL_ID[128];
#ifdef SOCKSPORT
extern char REPORT_DO_SOCKS[128], REPORT_GOOD_SOCKS[128],
REPORT_NO_SOCKS[128];
extern char REPORT_DO_SOCKS[128], REPORT_GOOD_SOCKS[128], REPORT_NO_SOCKS[128];
#endif
extern int R_do_dns, R_fin_dns, R_fin_dnsc, R_fail_dns,
R_do_id, R_fin_id, R_fail_id;
R_do_id, R_fin_id, R_fail_id;
#ifdef SOCKSPORT
extern int R_do_socks,
R_good_socks, R_no_socks;
extern int R_do_socks, R_good_socks, R_no_socks;
#endif
#endif
extern aChannel *find_channel PROTO((char *, aChannel *));
extern void remove_user_from_channel PROTO((aClient *, aChannel *));
extern aChannel *find_channel PROTO((char *, aChannel *));
extern void remove_user_from_channel PROTO((aClient *, aChannel *));
/* for services */
extern void del_invite PROTO((aClient *, aChannel *));
extern int del_silence PROTO((aClient *, char *));
extern void send_user_joins PROTO((aClient *, aClient *));
extern void clean_channelname PROTO((char *));
extern int do_nick_name PROTO((char *));
extern int can_send PROTO((aClient *, aChannel *, char *));
extern int is_chan_op PROTO((aClient *, aChannel *));
extern int is_zombie PROTO((aClient *, aChannel *));
extern int has_voice PROTO((aClient *, aChannel *));
extern int is_chanowner PROTO((aClient *, aChannel *));
extern int count_channels PROTO((aClient *));
extern Ban *is_banned PROTO((aClient *, aClient *, aChannel *));
extern int parse_help PROTO((aClient *, char *, char *));
extern void del_invite PROTO((aClient *, aChannel *));
extern int del_silence PROTO((aClient *, char *));
extern void send_user_joins PROTO((aClient *, aClient *));
extern void clean_channelname PROTO((char *));
extern int do_nick_name PROTO((char *));
extern int can_send PROTO((aClient *, aChannel *, char *));
extern int is_chan_op PROTO((aClient *, aChannel *));
extern int has_voice PROTO((aClient *, aChannel *));
extern int is_chanowner PROTO((aClient *, aChannel *));
extern Ban *is_banned PROTO((aClient *, aClient *, aChannel *));
extern int parse_help PROTO((aClient *, char *, char *));
extern void ircd_log PROTO((char *, ...));
extern aClient *find_client PROTO((char *, aClient *));
extern aClient *find_name PROTO((char *, aClient *));
extern aClient *find_nickserv PROTO((char *, aClient *));
extern aClient *find_person PROTO((char *, aClient *));
extern aClient *find_server PROTO((char *, aClient *));
extern aClient *find_service PROTO((char *, aClient *));
extern void ircd_log PROTO((char *, ...));
extern aClient *find_client PROTO((char *, aClient *));
extern aClient *find_name PROTO((char *, aClient *));
extern aClient *find_nickserv PROTO((char *, aClient *));
extern aClient *find_person PROTO((char *, aClient *));
extern aClient *find_server PROTO((char *, aClient *));
extern aClient *find_service PROTO((char *, aClient *));
extern char *find_or_add PROTO((char *));
extern int attach_conf PROTO((aClient *, aConfItem *));
extern aConfItem *attach_confs PROTO((aClient*, char *, int));
extern aConfItem *attach_confs_host PROTO((aClient*, char *, int));
extern int attach_Iline PROTO((aClient *, struct hostent *, char *));
extern aConfItem *conf, *find_me PROTO(()), *find_admin PROTO(());
extern aConfItem *count_cnlines PROTO((Link *));
extern aSqlineItem *sqline;
extern void det_confs_butmask PROTO((aClient *, int));
extern int detach_conf PROTO((aClient *, aConfItem *));
extern aSqlineItem *find_sqline_nick PROTO((char *));
extern aSqlineItem *find_sqline_match PROTO((char *));
extern aConfItem *det_confs_butone PROTO((aClient *, aConfItem *));
extern char *find_diepass();
extern char *find_restartpass();
extern aConfItem *find_conf PROTO((Link *, char*, int));
extern aConfItem *find_conf_exact PROTO((char *, char *, char *, int));
extern aConfItem *find_conf_host PROTO((Link *, char *, int));
extern aConfItem *find_conf_ip PROTO((Link *, char *, char *, int));
extern aConfItem *find_conf_name PROTO((char *, int));
extern aConfItem *find_temp_conf_entry PROTO((aConfItem *, u_int));
extern aConfItem *find_conf_servern PROTO((char *));
extern int find_kill PROTO((aClient *));
extern char *find_zap PROTO((aClient *, int));
extern int find_restrict PROTO((aClient *));
extern int rehash PROTO((aClient *, aClient *, int));
extern int initconf PROTO((int));
extern void add_temp_conf();
extern void inittoken PROTO(());
extern void reset_help PROTO(());
extern int find_exception(char *); /* hidden host */
extern char *find_or_add PROTO((char *));
extern int attach_conf PROTO((aClient *, aConfItem *));
extern aConfItem *attach_confs PROTO((aClient *, char *, int));
extern aConfItem *attach_confs_host PROTO((aClient *, char *, int));
extern int attach_Iline PROTO((aClient *, struct hostent *, char *));
extern aConfItem *conf, *find_me PROTO(()), *find_admin PROTO(());
extern aConfItem *count_cnlines PROTO((Link *));
extern aSqlineItem *sqline;
extern void det_confs_butmask PROTO((aClient *, int));
extern int detach_conf PROTO((aClient *, aConfItem *));
extern aSqlineItem *find_sqline_nick PROTO((char *));
extern aSqlineItem *find_sqline_match PROTO((char *));
extern aConfItem *det_confs_butone PROTO((aClient *, aConfItem *));
extern char *find_diepass();
extern char *find_restartpass();
extern aConfItem *find_conf PROTO((Link *, char *, int));
extern aConfItem *find_conf_exact PROTO((char *, char *, char *, int));
extern aConfItem *find_conf_host PROTO((Link *, char *, int));
extern aConfItem *find_conf_ip PROTO((Link *, char *, char *, int));
extern aConfItem *find_conf_name PROTO((char *, int));
extern aConfItem *find_temp_conf_entry PROTO((aConfItem *, u_int));
extern aConfItem *find_conf_servern PROTO((char *));
extern int find_kill PROTO((aClient *));
extern char *find_zap PROTO((aClient *, int));
extern int find_restrict PROTO((aClient *));
extern int rehash PROTO((aClient *, aClient *, int));
extern int initconf PROTO((int));
extern void add_temp_conf();
extern void inittoken PROTO(());
extern void reset_help PROTO(());
extern int find_exception(char *); /* hidden host */
extern char *MyMalloc PROTO((int)), *MyRealloc PROTO((char *, int));
extern char *MyMalloc PROTO((int)), *MyRealloc PROTO((char *, int));
extern char *debugmode, *configfile, *sbrk0;
extern char *getfield PROTO((char *));
extern void get_sockhost PROTO((aClient *, char *));
extern char *rpl_str PROTO((int)), *err_str PROTO((int));
extern char *strerror PROTO((int));
extern int dgets PROTO((int, char *, int));
extern char *inetntoa PROTO((char *));
extern char *debugmode, *configfile, *sbrk0;
extern char *getfield PROTO((char *));
extern void get_sockhost PROTO((aClient *, char *));
extern char *strerror PROTO((int));
extern int dgets PROTO((int, char *, int));
extern char *inetntoa PROTO((char *));
#ifdef _WIN32
extern int dbufalloc, dbufblocks, debuglevel;
extern int dbufalloc, dbufblocks, debuglevel;
#else
extern int dbufalloc, dbufblocks, debuglevel, errno, h_errno;
extern int dbufalloc, dbufblocks, debuglevel, errno, h_errno;
#endif
extern int highest_fd, debuglevel, portnum, debugtty, maxusersperchannel;
extern int readcalls, udpfd, resfd;
extern aClient *add_connection PROTO((aClient *, int));
extern int add_listener PROTO((aConfItem *));
extern void add_local_domain PROTO((char *, int));
extern int check_client PROTO((aClient *));
extern int check_server PROTO((aClient *, struct hostent *, \
aConfItem *, aConfItem *, int));
extern int check_server_init PROTO((aClient *));
extern void close_connection PROTO((aClient *));
extern void close_listeners PROTO(());
extern int connect_server PROTO((aConfItem *, aClient *, struct hostent *));
extern void get_my_name PROTO((aClient *, char *, int));
extern int get_sockerr PROTO((aClient *));
extern int inetport PROTO((aClient *, char *, int));
extern void init_sys PROTO(());
extern int highest_fd, debuglevel, portnum, debugtty, maxusersperchannel;
extern int readcalls, udpfd, resfd;
extern aClient *add_connection PROTO((aClient *, int));
extern int add_listener PROTO((aConfItem *));
extern void add_local_domain PROTO((char *, int));
extern int check_client PROTO((aClient *));
extern int check_server PROTO((aClient *, struct hostent *, aConfItem *,
aConfItem *, int));
extern int check_server_init PROTO((aClient *));
extern void close_connection PROTO((aClient *));
extern void close_listeners PROTO(());
extern int connect_server PROTO((aConfItem *, aClient *, struct hostent *));
extern void get_my_name PROTO((aClient *, char *, int));
extern int get_sockerr PROTO((aClient *));
extern int inetport PROTO((aClient *, char *, int));
extern void init_sys PROTO(());
#ifdef NO_FDLIST
extern int read_message PROTO((time_t));
extern int read_message PROTO((time_t));
#else
extern int read_message PROTO((time_t, fdlist *));
extern int read_message PROTO((time_t, fdlist *));
#endif
extern void report_error PROTO((char *, aClient *));
extern void set_non_blocking PROTO((int, aClient *));
extern int setup_ping PROTO(());
extern void summon PROTO((aClient *, char *, char *, char *));
extern int unixport PROTO((aClient *, char *, int));
extern int utmp_open PROTO(());
extern int utmp_read PROTO((int, char *, char *, char *, int));
extern int utmp_close PROTO((int));
extern void report_error PROTO((char *, aClient *));
extern void set_non_blocking PROTO((int, aClient *));
extern int setup_ping PROTO(());
extern void summon PROTO((aClient *, char *, char *, char *));
extern int utmp_open PROTO(());
extern int utmp_read PROTO((int, char *, char *, char *, int));
extern int utmp_close PROTO((int));
extern void start_auth PROTO((aClient *));
extern void read_authports PROTO((aClient *));
extern void send_authports PROTO((aClient *));
extern void start_auth PROTO((aClient *));
extern void read_authports PROTO((aClient *));
extern void send_authports PROTO((aClient *));
#ifdef SOCKSPORT
extern void init_socks PROTO((aClient *));
extern void start_socks PROTO((aClient *));
extern void send_socksquery PROTO((aClient *));
extern void read_socks PROTO((aClient *));
extern void init_socks PROTO((aClient *));
extern void start_socks PROTO((aClient *));
extern void send_socksquery PROTO((aClient *));
extern void read_socks PROTO((aClient *));
#endif
extern void restart PROTO((char *));
extern void send_channel_modes PROTO((aClient *, aChannel *));
extern void server_reboot PROTO((char *));
extern void terminate PROTO(()), write_pidfile PROTO(());
extern void restart PROTO((char *));
extern void send_channel_modes PROTO((aClient *, aChannel *));
extern void server_reboot PROTO((char *));
extern void terminate PROTO(()), write_pidfile PROTO(());
extern int send_queued PROTO((aClient *));
extern int send_queued PROTO((aClient *));
/*VARARGS2*/
// extern void sendto_one(char *, ...);
// extern void sendto_one(char *, ...);
/*VARARGS4*/
/* i know this is naughty but :P --stskeeps */
extern void sendto_channel_butone(aClient *, aClient *, aChannel *, char *, ...);
extern void sendto_channelops_butone(aClient *, aClient *, aChannel *, char *, ...);
extern void sendto_channelvoice_butone(aClient *, aClient *, aChannel *, char *, ...);
extern void sendto_channel_butone(aClient *, aClient *, aChannel *, char *,
...);
extern void sendto_channelops_butone(aClient *, aClient *, aChannel *,
char *, ...);
extern void sendto_channelvoice_butone(aClient *, aClient *, aChannel *,
char *, ...);
/*VARARGS2*/
extern void sendto_serv_butone(aClient *, char *, ...);
extern void sendto_serv_butone(aClient *, char *, ...);
/*VARARGS2*/
extern void sendto_serv_butone_quit(aClient *, char *, ...);
extern void sendto_serv_butone_sjoin(aClient *, char *, ...);
extern void sendto_serv_sjoin(aClient *, char *, ...);
extern void sendto_serv_butone_quit(aClient *, char *, ...);
extern void sendto_serv_butone_sjoin(aClient *, char *, ...);
extern void sendto_serv_sjoin(aClient *, char *, ...);
/*VARARGS2*/
extern void sendto_common_channels(aClient *, char *, ...);
extern void sendto_common_channels(aClient *, char *, ...);
/*VARARGS3*/
extern void sendto_channel_butserv(aChannel *, aClient *, char *, ...);
extern void sendto_channel_butserv(aChannel *, aClient *, char *, ...);
/*VARARGS3*/
extern void sendto_match_servs(aChannel *, aClient *, char *, ...);
extern void sendto_match_servs(aChannel *, aClient *, char *, ...);
/*VARARGS5*/
extern void sendto_match_butone(aClient *, aClient *, char *, int, char *pattern, ...);
extern void sendto_match_butone(aClient *, aClient *, char *, int,
char *pattern, ...);
/*VARARGS3*/
extern void sendto_all_butone(aClient *, aClient *, char *, ...);
extern void sendto_all_butone(aClient *, aClient *, char *, ...);
/*VARARGS1*/
extern void sendto_ops(char *, ...);
extern void sendto_ops(char *, ...);
/*VARARGS3*/
extern void sendto_ops_butone(aClient *, aClient *, char *, ...);
extern void sendto_ops_butone(aClient *, aClient *, char *, ...);
/*VARARGS3*/
extern void sendto_ops_butme(aClient *, char *, ...);
extern void sendto_ops_butme(aClient *, char *, ...);
/*VARARGS3*/
extern void sendto_prefix_one(aClient *, aClient *, const char *, ...);
extern void sendto_prefix_one(aClient *, aClient *, const char *, ...);
/*VARARGS3*/
extern void sendto_failops_whoare_opers(char *, ...);
extern void sendto_failops_whoare_opers(char *, ...);
/*VARARGS3*/
extern void sendto_failops(char *, ...);
extern void sendto_failops(char *, ...);
/*VARARGS3*/
extern void sendto_opers(char *, ...);
extern void sendto_opers(char *, ...);
/*VARARGS?*/
extern void sendto_umode(int, char *, ...);
extern void sendto_conn_hcn(char *, ...);
extern int writecalls, writeb[];
extern int deliver_it PROTO((aClient *, char *, int));
extern void sendto_umode(int, char *, ...);
extern void sendto_conn_hcn(char *, ...);
extern int writecalls, writeb[];
extern int deliver_it PROTO((aClient *, char *, int));
extern int check_registered PROTO((aClient *));
extern int check_registered_user PROTO((aClient *));
extern char *get_client_name PROTO((aClient *, int));
extern char *get_client_host PROTO((aClient *));
extern char *my_name_for_link PROTO((char *, aConfItem *));
extern char *myctime PROTO((time_t)), *date PROTO((time_t));
extern int exit_client PROTO((aClient *, aClient *, aClient *, char *));
extern void initstats PROTO(()), tstats PROTO((aClient *, char *));
extern char *check_string PROTO((char *));
extern char *make_nick_user_host PROTO((char *, char *, char *));
extern int check_registered PROTO((aClient *));
extern int check_registered_user PROTO((aClient *));
extern char *get_client_name PROTO((aClient *, int));
extern char *get_client_host PROTO((aClient *));
extern char *my_name_for_link PROTO((char *, aConfItem *));
extern char *myctime PROTO((time_t)), *date PROTO((time_t));
extern int exit_client PROTO((aClient *, aClient *, aClient *, char *));
extern void initstats PROTO(()), tstats PROTO((aClient *, char *));
extern char *check_string PROTO((char *));
extern char *make_nick_user_host PROTO((char *, char *, char *));
extern int parse PROTO((aClient *, char *, char *, struct Message *));
extern int do_numeric PROTO((int, aClient *, aClient *, int, char **));
extern int hunt_server PROTO((aClient *,aClient *,char *,int,int,char **));
extern aClient *next_client PROTO((aClient *, char *));
extern int m_umode PROTO((aClient *, aClient *, int, char **));
extern int m_names PROTO((aClient *, aClient *, int, char **));
extern int m_server_estab PROTO((aClient *));
extern void send_umode PROTO((aClient *, aClient *, int, int, char *));
extern void send_umode_out PROTO((aClient*, aClient *, int));
extern int parse PROTO((aClient *, char *, char *, struct Message *));
extern int do_numeric PROTO((int, aClient *, aClient *, int, char **));
extern int hunt_server PROTO((aClient *, aClient *, char *, int, int, char **));
extern aClient *next_client PROTO((aClient *, char *));
extern int m_umode PROTO((aClient *, aClient *, int, char **));
extern int m_names PROTO((aClient *, aClient *, int, char **));
extern int m_server_estab PROTO((aClient *));
extern void send_umode PROTO((aClient *, aClient *, int, int, char *));
extern void send_umode_out PROTO((aClient *, aClient *, int));
extern void free_client PROTO((aClient *));
extern void free_link PROTO((Link *));
extern void free_ban PROTO((Ban *));
extern void free_conf PROTO((aConfItem *));
extern void free_class PROTO((aClass *));
extern void free_user PROTO((anUser *, aClient *));
extern int find_str_match_link PROTO((Link **, char *));
extern void free_str_list PROTO ((Link *));
extern Link *make_link PROTO(());
extern Ban *make_ban PROTO(());
extern anUser *make_user PROTO((aClient *));
extern aSqlineItem *make_sqline PROTO(());
extern aConfItem *make_conf PROTO(());
extern aClass *make_class PROTO(());
extern aServer *make_server PROTO(());
extern aClient *make_client PROTO((aClient *, aClient *));
extern Link *find_user_link PROTO((Link *, aClient *));
extern Link *find_channel_link PROTO((Link *, aChannel *));
extern char *pretty_mask PROTO((char *));
extern void add_client_to_list PROTO((aClient *));
extern void checklist PROTO(());
extern void remove_client_from_list PROTO((aClient *));
extern void initlists PROTO(());
extern void free_client PROTO((aClient *));
extern void free_link PROTO((Link *));
extern void free_ban PROTO((Ban *));
extern void free_conf PROTO((aConfItem *));
extern void free_class PROTO((aClass *));
extern void free_user PROTO((anUser *, aClient *));
extern int find_str_match_link PROTO((Link **, char *));
extern void free_str_list PROTO((Link *));
extern Link *make_link PROTO(());
extern Ban *make_ban PROTO(());
extern anUser *make_user PROTO((aClient *));
extern aSqlineItem *make_sqline PROTO(());
extern aConfItem *make_conf PROTO(());
extern aClass *make_class PROTO(());
extern aServer *make_server PROTO(());
extern aClient *make_client PROTO((aClient *, aClient *));
extern Link *find_user_link PROTO((Link *, aClient *));
extern Link *find_channel_link PROTO((Link *, aChannel *));
extern char *pretty_mask PROTO((char *));
extern void add_client_to_list PROTO((aClient *));
extern void checklist PROTO(());
extern void remove_client_from_list PROTO((aClient *));
extern void initlists PROTO(());
extern void add_class PROTO((int, int, int, int, long));
extern void fix_class PROTO((aConfItem *, aConfItem *));
extern long get_sendq PROTO((aClient *));
extern int get_con_freq PROTO((aClass *));
extern int get_client_ping PROTO((aClient *));
extern int get_client_class PROTO((aClient *));
extern int get_conf_class PROTO((aConfItem *));
extern void report_classes PROTO((aClient *));
extern void add_class PROTO((int, int, int, int, long));
extern void fix_class PROTO((aConfItem *, aConfItem *));
extern long get_sendq PROTO((aClient *));
extern int get_con_freq PROTO((aClass *));
extern int get_client_ping PROTO((aClient *));
extern int get_client_class PROTO((aClient *));
extern int get_conf_class PROTO((aConfItem *));
extern void report_classes PROTO((aClient *));
extern struct hostent *get_res PROTO((char *));
extern struct hostent *gethost_byaddr PROTO((char *, Link *));
extern struct hostent *gethost_byname PROTO((char *, Link *));
extern void flush_cache PROTO(());
extern int init_resolver PROTO((int));
extern time_t timeout_query_list PROTO((time_t));
extern time_t expire_cache PROTO((time_t));
extern void del_queries PROTO((char *));
extern struct hostent *get_res PROTO((char *));
extern struct hostent *gethost_byaddr PROTO((char *, Link *));
extern struct hostent *gethost_byname PROTO((char *, Link *));
extern void flush_cache PROTO(());
extern int init_resolver PROTO((int));
extern time_t timeout_query_list PROTO((time_t));
extern time_t expire_cache PROTO((time_t));
extern void del_queries PROTO((char *));
extern void clear_channel_hash_table PROTO(());
extern void clear_client_hash_table PROTO(());
extern void clear_notify_hash_table PROTO(());
extern int add_to_client_hash_table PROTO((char *, aClient *));
extern int del_from_client_hash_table PROTO((char *, aClient *));
extern int add_to_channel_hash_table PROTO((char *, aChannel *));
extern int del_from_channel_hash_table PROTO((char *, aChannel *));
extern int add_to_notify_hash_table PROTO((char *, aClient *));
extern int del_from_notify_hash_table PROTO((char *, aClient *));
extern int hash_check_notify PROTO((aClient *, int));
extern int hash_del_notify_list PROTO((aClient *));
extern void count_watch_memory PROTO((int *, u_long *));
extern aNotify *hash_get_notify PROTO((char *));
extern aChannel *hash_get_chan_bucket PROTO((int));
extern aClient *hash_find_client PROTO((char *, aClient *));
extern aClient *hash_find_nickserver PROTO((char *, aClient *));
extern aClient *hash_find_server PROTO((char *, aClient *));
extern char *find_by_aln PROTO((char *));
extern char *convert2aln PROTO((int));
extern int convertfromaln PROTO((char *));
extern char *find_server_aln PROTO((char *));
extern int dopacket PROTO((aClient *, char *, int));
extern void clear_channel_hash_table PROTO(());
extern void clear_client_hash_table PROTO(());
extern void clear_notify_hash_table PROTO(());
extern int add_to_client_hash_table PROTO((char *, aClient *));
extern int del_from_client_hash_table PROTO((char *, aClient *));
extern int add_to_channel_hash_table PROTO((char *, aChannel *));
extern int del_from_channel_hash_table PROTO((char *, aChannel *));
extern int add_to_notify_hash_table PROTO((char *, aClient *));
extern int del_from_notify_hash_table PROTO((char *, aClient *));
extern int hash_check_notify PROTO((aClient *, int));
extern int hash_del_notify_list PROTO((aClient *));
extern void count_watch_memory PROTO((int *, u_long *));
extern aNotify *hash_get_notify PROTO((char *));
extern aChannel *hash_get_chan_bucket PROTO((int));
extern aClient *hash_find_client PROTO((char *, aClient *));
extern aClient *hash_find_nickserver PROTO((char *, aClient *));
extern aClient *hash_find_server PROTO((char *, aClient *));
extern char *find_by_aln PROTO((char *));
extern char *convert2aln PROTO((int));
extern int convertfromaln PROTO((char *));
extern char *find_server_aln PROTO((char *));
extern int dopacket PROTO((aClient *, char *, int));
/*VARARGS2*/
extern void debug();
extern void debug();
#if defined(DEBUGMODE)
extern void send_usage PROTO((aClient *, char *));
extern void send_listinfo PROTO((aClient *, char *));
extern void count_memory PROTO((aClient *, char *));
extern void send_usage PROTO((aClient *, char *));
extern void send_listinfo PROTO((aClient *, char *));
extern void count_memory PROTO((aClient *, char *));
#endif
#ifdef INET6
extern char *inetntop(int af, const void *in, char *local_dummy, size_t the_size);
extern char *inetntop(int af, const void *in, char *local_dummy,
size_t the_size);
#endif
char *crule_parse PROTO((char *));
+6 -6
View File
@@ -23,9 +23,9 @@
#define __hash_include__
typedef struct hashentry {
int hits;
int links;
void *list;
int hits;
int links;
void *list;
} aHashEntry;
/* Taner had BITS_PER_COL 4 BITS_PER_COL_MASK 0xF - Dianora */
@@ -38,7 +38,7 @@ typedef struct hashentry {
* used in hash.c
*/
#define U_MAX_INITIAL 8192
#define U_MAX_INITIAL 2048
#define U_MAX_INITIAL_MASK (U_MAX_INITIAL-1)
#define U_MAX (U_MAX_INITIAL*MAX_SUB)
@@ -58,9 +58,9 @@ typedef struct hashentry {
#define WW_MAX_INITIAL_MASK (WW_MAX_INITIAL-1)
#define WW_MAX (WW_MAX_INITIAL*MAX_SUB)
#define NOTIFYHASHSIZE 10007 /* prime number */
#define NOTIFYHASHSIZE 10007 /* prime number */
#define NullChn ((aChannel *)0)
#define find_channel hash_find_channel
#endif /* __hash_include__ */
#endif /* __hash_include__ */
+2 -2
View File
@@ -22,7 +22,7 @@
*/
/* External definitions for functions in inet(3) */
#include "config.h" /* for system definitions */
#include "config.h" /* for system definitions */
#ifdef __alpha
#define __u_l unsigned int
@@ -35,7 +35,7 @@
extern __u_l inet_addr(char *);
extern char *inet_ntoa(char *);
# endif
extern __u_l inet_makeaddr(int , int);
extern __u_l inet_makeaddr(int, int);
extern __u_l inet_network(char *);
extern __u_l inet_lnaof(struct in_addr);
#else
+10 -1
View File
@@ -14,8 +14,17 @@
* Proto types
*/
/* You do want it to work in debug mode yes ? --DrBin */
#ifndef DEBUGMODE
extern char *ircvsprintf(char *str, const char *format, va_list);
extern char *ircsprintf(char *str, const char *format, ...);
extern char *ircsprintf(char *str, const char *format, ...);
#else
#define ircsprintf sprintf
#define ircvsprintf vsprintf
#endif
extern const char atoi_tab[4000];
#endif
+27 -27
View File
@@ -28,32 +28,32 @@
*/
static char *Statement[] = {
" * This file may not be removed from the IRCd package.",
" * It will be a violation of copyright. This program must always",
" * stay free and not be charged for, being sold commercially or privately",
" * Only charge may be for the transport medium like one CD-ROM, floppy",
" * or other kinds.",
0};
char *gnulicense[] = {
" \2UnrealIRCd License\2",
"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 1, 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., 675 Mass Ave, Cambridge, MA 02139, USA.",
"",
"To see the UnrealIRCd License, please point your browser",
"at http://www.gnu.org/copyleft/gpl.html or look in the",
"file LICENSE in the UnrealIRCd dist",
0
" * This file may not be removed from the IRCd package.",
" * It will be a violation of copyright. This program must always",
" * stay free and not be charged for, being sold commercially or privately",
" * Only charge may be for the transport medium like one CD-ROM, floppy",
" * or other kinds.",
0
};
char *gnulicense[] = {
" \2UnrealIRCd License\2",
"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 1, 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., 675 Mass Ave, Cambridge, MA 02139, USA.",
"",
"To see the UnrealIRCd License, please point your browser",
"at http://www.gnu.org/copyleft/gpl.html or look in the",
"file LICENSE in the UnrealIRCd dist",
0
};
+308 -287
View File
@@ -1,3 +1,4 @@
/************************************************************************
* Unreal Internet Relay Chat Daemon, include/msg.h
* Copyright (C) 1990 Jarkko Oikarinen and
@@ -45,204 +46,204 @@
* knowing it, I'm considering that reserved, and TRACE/A is now 'b'.
* The normal msgtab should probably process this as special. -Donwulff
*/
/* 12/05/1999 - I was wrong - I didnt see the token[2] in struct Message
okie 60*60 commands more :P - Sowwy!!! -sts
*/
#define MSG_PRIVATE "PRIVMSG" /* PRIV */
#define TOK_PRIVATE "!" /* 33 */
#define MSG_WHO "WHO" /* WHO -> WHOC */
#define TOK_WHO "\"" /* 34 */
#define MSG_WHOIS "WHOIS" /* WHOI */
#define TOK_WHOIS "#" /* 35 */
#define TOK_PRIVATE "!" /* 33 */
#define MSG_WHO "WHO" /* WHO -> WHOC */
#define TOK_WHO "\"" /* 34 */
#define MSG_WHOIS "WHOIS" /* WHOI */
#define TOK_WHOIS "#" /* 35 */
#define MSG_WHOWAS "WHOWAS" /* WHOW */
#define TOK_WHOWAS "$" /* 36 */
#define MSG_USER "USER" /* USER */
#define TOK_USER "%" /* 37 */
#define MSG_NICK "NICK" /* NICK */
#define TOK_NICK "&" /* 38 */
#define TOK_WHOWAS "$" /* 36 */
#define MSG_USER "USER" /* USER */
#define TOK_USER "%" /* 37 */
#define MSG_NICK "NICK" /* NICK */
#define TOK_NICK "&" /* 38 */
#define MSG_SERVER "SERVER" /* SERV */
#define TOK_SERVER "'" /* 39 */
#define MSG_LIST "LIST" /* LIST */
#define TOK_LIST "(" /* 40 */
#define MSG_TOPIC "TOPIC" /* TOPI */
#define TOK_TOPIC ")" /* 41 */
#define TOK_SERVER "'" /* 39 */
#define MSG_LIST "LIST" /* LIST */
#define TOK_LIST "(" /* 40 */
#define MSG_TOPIC "TOPIC" /* TOPI */
#define TOK_TOPIC ")" /* 41 */
#define MSG_INVITE "INVITE" /* INVI */
#define TOK_INVITE "*" /* 42 */
#define TOK_INVITE "*" /* 42 */
#define MSG_VERSION "VERSION" /* VERS */
#define TOK_VERSION "+" /* 43 */
#define MSG_QUIT "QUIT" /* QUIT */
#define TOK_QUIT "," /* 44 */
#define MSG_SQUIT "SQUIT" /* SQUI */
#define TOK_SQUIT "-" /* 45 */
#define MSG_KILL "KILL" /* KILL */
#define TOK_KILL "." /* 46 */
#define MSG_INFO "INFO" /* INFO */
#define TOK_INFO "/" /* 47 */
#define MSG_LINKS "LINKS" /* LINK */
#define TOK_LINKS "0" /* 48 */
#define TOK_VERSION "+" /* 43 */
#define MSG_QUIT "QUIT" /* QUIT */
#define TOK_QUIT "," /* 44 */
#define MSG_SQUIT "SQUIT" /* SQUI */
#define TOK_SQUIT "-" /* 45 */
#define MSG_KILL "KILL" /* KILL */
#define TOK_KILL "." /* 46 */
#define MSG_INFO "INFO" /* INFO */
#define TOK_INFO "/" /* 47 */
#define MSG_LINKS "LINKS" /* LINK */
#define TOK_LINKS "0" /* 48 */
#define MSG_SUMMON "SUMMON" /* SUMM */
#define TOK_SUMMON "1" /* 49 */
#define MSG_STATS "STATS" /* STAT */
#define TOK_STATS "2" /* 50 */
#define MSG_USERS "USERS" /* USER -> USRS */
#define TOK_USERS "3" /* 51 */
#define MSG_HELP "HELP" /* HELP */
#define TOK_SUMMON "1" /* 49 */
#define MSG_STATS "STATS" /* STAT */
#define TOK_STATS "2" /* 50 */
#define MSG_USERS "USERS" /* USER -> USRS */
#define TOK_USERS "3" /* 51 */
#define MSG_HELP "HELP" /* HELP */
#define MSG_HELPOP "HELPOP" /* HELP */
#define TOK_HELP "4" /* 52 */
#define MSG_ERROR "ERROR" /* ERRO */
#define TOK_ERROR "5" /* 53 */
#define MSG_AWAY "AWAY" /* AWAY */
#define TOK_AWAY "6" /* 54 */
#define TOK_HELP "4" /* 52 */
#define MSG_ERROR "ERROR" /* ERRO */
#define TOK_ERROR "5" /* 53 */
#define MSG_AWAY "AWAY" /* AWAY */
#define TOK_AWAY "6" /* 54 */
#define MSG_CONNECT "CONNECT" /* CONN */
#define TOK_CONNECT "7" /* 55 */
#define MSG_PING "PING" /* PING */
#define TOK_PING "8" /* 56 */
#define MSG_PONG "PONG" /* PONG */
#define TOK_PONG "9" /* 57 */
#define MSG_OPER "OPER" /* OPER */
#define TOK_OPER ";" /* 59 */
#define MSG_PASS "PASS" /* PASS */
#define TOK_PASS "<" /* 60 */
#define TOK_CONNECT "7" /* 55 */
#define MSG_PING "PING" /* PING */
#define TOK_PING "8" /* 56 */
#define MSG_PONG "PONG" /* PONG */
#define TOK_PONG "9" /* 57 */
#define MSG_OPER "OPER" /* OPER */
#define TOK_OPER ";" /* 59 */
#define MSG_PASS "PASS" /* PASS */
#define TOK_PASS "<" /* 60 */
#define MSG_WALLOPS "WALLOPS" /* WALL */
#define TOK_WALLOPS "=" /* 61 */
#define MSG_TIME "TIME" /* TIME */
#define TOK_TIME ">" /* 62 */
#define MSG_NAMES "NAMES" /* NAME */
#define TOK_NAMES "?" /* 63 */
#define MSG_ADMIN "ADMIN" /* ADMI */
#define TOK_ADMIN "@" /* 64 */
#define TOK_WALLOPS "=" /* 61 */
#define MSG_TIME "TIME" /* TIME */
#define TOK_TIME ">" /* 62 */
#define MSG_NAMES "NAMES" /* NAME */
#define TOK_NAMES "?" /* 63 */
#define MSG_ADMIN "ADMIN" /* ADMI */
#define TOK_ADMIN "@" /* 64 */
#define MSG_NOTICE "NOTICE" /* NOTI */
#define TOK_NOTICE "B" /* 66 */
#define MSG_JOIN "JOIN" /* JOIN */
#define TOK_JOIN "C" /* 67 */
#define MSG_PART "PART" /* PART */
#define TOK_PART "D" /* 68 */
#define TOK_NOTICE "B" /* 66 */
#define MSG_JOIN "JOIN" /* JOIN */
#define TOK_JOIN "C" /* 67 */
#define MSG_PART "PART" /* PART */
#define TOK_PART "D" /* 68 */
#define MSG_LUSERS "LUSERS" /* LUSE */
#define TOK_LUSERS "E" /* 69 */
#define MSG_MOTD "MOTD" /* MOTD */
#define TOK_MOTD "F" /* 70 */
#define MSG_MODE "MODE" /* MODE */
#define TOK_MODE "G" /* 71 */
#define MSG_KICK "KICK" /* KICK */
#define TOK_KICK "H" /* 72 */
#define TOK_LUSERS "E" /* 69 */
#define MSG_MOTD "MOTD" /* MOTD */
#define TOK_MOTD "F" /* 70 */
#define MSG_MODE "MODE" /* MODE */
#define TOK_MODE "G" /* 71 */
#define MSG_KICK "KICK" /* KICK */
#define TOK_KICK "H" /* 72 */
#define MSG_SERVICE "SERVICE" /* SERV -> SRVI */
#define TOK_SERVICE "I" /* 73 */
#define TOK_SERVICE "I" /* 73 */
#define MSG_USERHOST "USERHOST" /* USER -> USRH */
#define TOK_USERHOST "J" /* 74 */
#define MSG_ISON "ISON" /* ISON */
#define TOK_ISON "K" /* 75 */
#define TOK_USERHOST "J" /* 74 */
#define MSG_ISON "ISON" /* ISON */
#define TOK_ISON "K" /* 75 */
#define MSG_REHASH "REHASH" /* REHA */
#define TOK_REHASH "O" /* 79 */
#define TOK_REHASH "O" /* 79 */
#define MSG_RESTART "RESTART" /* REST */
#define TOK_RESTART "P" /* 80 */
#define MSG_CLOSE "CLOSE" /* CLOS */
#define TOK_CLOSE "Q" /* 81 */
#define MSG_DIE "DIE" /* DIE */
#define TOK_DIE "R" /* 82 */
#define MSG_HASH "HASH" /* HASH */
#define TOK_HASH "S" /* 83 */
#define MSG_DNS "DNS" /* DNS -> DNSS */
#define TOK_DNS "T" /* 84 */
#define TOK_RESTART "P" /* 80 */
#define MSG_CLOSE "CLOSE" /* CLOS */
#define TOK_CLOSE "Q" /* 81 */
#define MSG_DIE "DIE" /* DIE */
#define TOK_DIE "R" /* 82 */
#define MSG_HASH "HASH" /* HASH */
#define TOK_HASH "S" /* 83 */
#define MSG_DNS "DNS" /* DNS -> DNSS */
#define TOK_DNS "T" /* 84 */
#define MSG_SILENCE "SILENCE" /* SILE */
#define TOK_SILENCE "U" /* 85 */
#define MSG_AKILL "AKILL" /* AKILL */
#define TOK_AKILL "V" /* 86 */
#define MSG_KLINE "KLINE" /* KLINE */
#define TOK_KLINE "W" /* 87 */
#define MSG_UNKLINE "UNKLINE" /* UNKLINE */
#define TOK_UNKLINE "X" /* 88 */
#define TOK_SILENCE "U" /* 85 */
#define MSG_AKILL "AKILL" /* AKILL */
#define TOK_AKILL "V" /* 86 */
#define MSG_KLINE "KLINE" /* KLINE */
#define TOK_KLINE "W" /* 87 */
#define MSG_UNKLINE "UNKLINE" /* UNKLINE */
#define TOK_UNKLINE "X" /* 88 */
#define MSG_RAKILL "RAKILL" /* RAKILL */
#define TOK_RAKILL "Y" /* 89 */
#define TOK_RAKILL "Y" /* 89 */
#define MSG_GNOTICE "GNOTICE" /* GNOTICE */
#define TOK_GNOTICE "Z" /* 90 */
#define MSG_GOPER "GOPER" /* GOPER */
#define TOK_GOPER "[" /* 91 */
#define TOK_GNOTICE "Z" /* 90 */
#define MSG_GOPER "GOPER" /* GOPER */
#define TOK_GOPER "[" /* 91 */
#define MSG_GLOBOPS "GLOBOPS" /* GLOBOPS */
#define TOK_GLOBOPS "]" /* 93 */
#define TOK_GLOBOPS "]" /* 93 */
#define MSG_LOCOPS "LOCOPS" /* LOCOPS */
#define TOK_LOCOPS "^" /* 94 */
#define TOK_LOCOPS "^" /* 94 */
#define MSG_PROTOCTL "PROTOCTL" /* PROTOCTL */
#define TOK_PROTOCTL "_" /* 95 */
#define MSG_WATCH "WATCH" /* WATCH */
#define TOK_WATCH "`" /* 96 */
#define MSG_TRACE "TRACE" /* TRAC */
#define TOK_TRACE "b" /* 97 */
#define TOK_PROTOCTL "_" /* 95 */
#define MSG_WATCH "WATCH" /* WATCH */
#define TOK_WATCH "`" /* 96 */
#define MSG_TRACE "TRACE" /* TRAC */
#define TOK_TRACE "b" /* 97 */
#define MSG_SQLINE "SQLINE" /* SQLINE */
#define TOK_SQLINE "c" /* 98 */
#define TOK_SQLINE "c" /* 98 */
#define MSG_UNSQLINE "UNSQLINE" /* UNSQLINE */
#define TOK_UNSQLINE "d" /* 99 */
#define TOK_UNSQLINE "d" /* 99 */
#define MSG_SVSNICK "SVSNICK" /* SVSNICK */
#define TOK_SVSNICK "e" /* 100 */
#define TOK_SVSNICK "e" /* 100 */
#define MSG_SVSNOOP "SVSNOOP" /* SVSNOOP */
#define TOK_SVSNOOP "f" /* 101 */
#define TOK_SVSNOOP "f" /* 101 */
#define MSG_IDENTIFY "IDENTIFY" /* IDENTIFY */
#define TOK_IDENTIFY "g" /* 102 */
#define TOK_IDENTIFY "g" /* 102 */
#define MSG_SVSKILL "SVSKILL" /* SVSKILL */
#define TOK_SVSKILL "h" /* 103 */
#define TOK_SVSKILL "h" /* 103 */
#define MSG_NICKSERV "NICKSERV" /* NICKSERV */
#define MSG_NS "NS"
#define TOK_NICKSERV "i" /* 104 */
#define TOK_NICKSERV "i" /* 104 */
#define MSG_CHANSERV "CHANSERV" /* CHANSERV */
#define MSG_CS "CS"
#define TOK_CHANSERV "j" /* 105 */
#define TOK_CHANSERV "j" /* 105 */
#define MSG_OPERSERV "OPERSERV" /* OPERSERV */
#define MSG_OS "OS"
#define TOK_OPERSERV "k" /* 106 */
#define TOK_OPERSERV "k" /* 106 */
#define MSG_MEMOSERV "MEMOSERV" /* MEMOSERV */
#define MSG_MS "MS"
#define TOK_MEMOSERV "l" /* 107 */
#define TOK_MEMOSERV "l" /* 107 */
#define MSG_SERVICES "SERVICES" /* SERVICES */
#define TOK_SERVICES "m" /* 108 */
#define TOK_SERVICES "m" /* 108 */
#define MSG_SVSMODE "SVSMODE" /* SVSMODE */
#define TOK_SVSMODE "n" /* 109 */
#define TOK_SVSMODE "n" /* 109 */
#define MSG_SAMODE "SAMODE" /* SAMODE */
#define TOK_SAMODE "o" /* 110 */
#define TOK_SAMODE "o" /* 110 */
#define MSG_CHATOPS "CHATOPS" /* CHATOPS */
#define TOK_CHATOPS "p" /* 111 */
#define MSG_ZLINE "ZLINE" /* ZLINE */
#define TOK_ZLINE "q" /* 112 */
#define MSG_UNZLINE "UNZLINE" /* UNZLINE */
#define TOK_UNZLINE "r" /* 113 */
#define MSG_HELPSERV "HELPSERV" /* HELPSERV */
#define TOK_CHATOPS "p" /* 111 */
#define MSG_ZLINE "ZLINE" /* ZLINE */
#define TOK_ZLINE "q" /* 112 */
#define MSG_UNZLINE "UNZLINE" /* UNZLINE */
#define TOK_UNZLINE "r" /* 113 */
#define MSG_HELPSERV "HELPSERV" /* HELPSERV */
#define MSG_HS "HS"
#define TOK_HELPSERV "s" /* 114 */
#define MSG_RULES "RULES" /* RULES */
#define TOK_RULES "t" /* 115 */
#define MSG_MAP "MAP" /* MAP */
#define TOK_MAP "u" /* 117 */
#define MSG_SVS2MODE "SVS2MODE" /* SVS2MODE */
#define TOK_SVS2MODE "v" /* 118 */
#define MSG_DALINFO "DALINFO" /* dalinfo */
#define TOK_DALINFO "w" /* 119 */
#define MSG_ADMINCHAT "ADCHAT" /* Admin chat */
#define TOK_ADMINCHAT "x" /* 120 */
#define TOK_HELPSERV "s" /* 114 */
#define MSG_RULES "RULES" /* RULES */
#define TOK_RULES "t" /* 115 */
#define MSG_MAP "MAP" /* MAP */
#define TOK_MAP "u" /* 117 */
#define MSG_SVS2MODE "SVS2MODE" /* SVS2MODE */
#define TOK_SVS2MODE "v" /* 118 */
#define MSG_DALINFO "DALINFO" /* dalinfo */
#define TOK_DALINFO "w" /* 119 */
#define MSG_ADMINCHAT "ADCHAT" /* Admin chat */
#define TOK_ADMINCHAT "x" /* 120 */
#define MSG_MKPASSWD "MKPASSWD" /* MKPASSWD */
#define TOK_MKPASSWD "y" /* 121 */
#define MSG_ADDLINE "ADDLINE" /* ADDLINE */
#define TOK_ADDLINE "z" /* 122 */
#define MSG_GLINE "GLINE" /* The awesome g-line */
#define TOK_GLINE "}" /* 125 */
#define TOK_MKPASSWD "y" /* 121 */
#define MSG_ADDLINE "ADDLINE" /* ADDLINE */
#define TOK_ADDLINE "z" /* 122 */
#define MSG_GLINE "GLINE" /* The awesome g-line */
#define TOK_GLINE "}" /* 125 */
#define MSG_SJOIN "SJOIN"
#define TOK_SJOIN "~"
#define MSG_SETHOST "SETHOST" /* sethost */
#define TOK_SETHOST "AA" /* 127 4ever !;) */
#define MSG_TECHAT "TECHAT" /* techadmin chat */
#define TOK_TECHAT "AB" /* questionmark? */
#define MSG_NACHAT "NACHAT" /* netadmin chat */
#define TOK_NACHAT "AC" /* *beep* */
#define MSG_SETIDENT "SETIDENT" /* set ident */
#define TOK_SETIDENT "AD" /* good old BASIC ;P */
#define MSG_SETNAME "SETNAME" /* set GECOS */
#define TOK_SETNAME "AE" /* its almost unreeaaall... */
#define MSG_LAG "LAG" /* Lag detect */
#define TOK_LAG "AF" /* a or ? */
#define MSG_SDESC "SDESC" /* set description */
#define MSG_SETHOST "SETHOST" /* sethost */
#define TOK_SETHOST "AA" /* 127 4ever !;) */
#define MSG_TECHAT "TECHAT" /* techadmin chat */
#define TOK_TECHAT "AB" /* questionmark? */
#define MSG_NACHAT "NACHAT" /* netadmin chat */
#define TOK_NACHAT "AC" /* *beep* */
#define MSG_SETIDENT "SETIDENT" /* set ident */
#define TOK_SETIDENT "AD" /* good old BASIC ;P */
#define MSG_SETNAME "SETNAME" /* set GECOS */
#define TOK_SETNAME "AE" /* its almost unreeaaall... */
#define MSG_LAG "LAG" /* Lag detect */
#define TOK_LAG "AF" /* a or ? */
#define MSG_SDESC "SDESC" /* set description */
#define TOK_SDESC "AG"
#define MSG_STATSERV "STATSERV" /* alias */
#define TOK_STATSERV "AH"
#define MSG_STATSERV "STATSERV" /* alias */
#define TOK_STATSERV "AH"
#define MSG_KNOCK "KNOCK"
#define TOK_KNOCK "AI"
#define MSG_CREDITS "CREDITS"
@@ -294,7 +295,7 @@
#define MSG_BOTMOTD "BOTMOTD"
#define TOK_BOTMOTD "BF"
#define MSG_REMGLINE "REMGLINE" /* remove g-line */
#define TOK_REMGLINE "BG"
#define TOK_REMGLINE "BG"
#define MSG_HTM "HTM"
#define TOK_HTM "BH"
#define MSG_UMODE2 "UMODE2"
@@ -306,8 +307,17 @@
#define MSG_CHGNAME "CHGNAME"
#define MSG_SVSNAME "SVSNAME"
#define TOK_CHGNAME "BK"
#define MSG_SHUN "SHUN"
#define TOK_SHUN "BL"
#ifdef CRYPTOIRCD
#define MSG_CRYPTO "CRYPTO"
#define TOK_CRYPTO "BM"
#endif
#define MSG_NEWJOIN "NEWJOIN" /* For CR Java Chat */
#define MAXPARA 15
#define MSG_POST "POST"
#define TOK_POST "BN"
#define MAXPARA 15
extern int m_private(), m_topic(), m_join(), m_part(), m_mode(), m_svsmode();
extern int m_ping(), m_pong(), m_wallops(), m_kick(), m_svsnick();
@@ -315,12 +325,14 @@ extern int m_nick(), m_error(), m_notice(), m_samode(), m_svsnoop();
extern int m_invite(), m_quit(), m_kill(), m_svskill(), m_identify();
extern int m_akill(), m_kline(), m_unkline(), m_rakill(), m_sqline();
extern int m_zline(), m_unzline();
extern int m_gnotice(), m_goper(), m_globops(), m_locops(), m_unsqline(), m_chatops();
extern int m_gnotice(), m_goper(), m_globops(), m_locops(), m_unsqline(),
m_chatops();
extern int m_protoctl();
extern int m_motd(), m_who(), m_whois(), m_user(), m_list();
extern int m_server(), m_info(), m_links(), m_summon(), m_stats();
extern int m_users(), m_version(), m_help();
extern int m_nickserv(), m_operserv(), m_chanserv(), m_memoserv(), m_helpserv(), m_services(), m_identify();
extern int m_nickserv(), m_operserv(), m_chanserv(), m_memoserv(),
m_helpserv(), m_services(), m_identify();
extern int m_statserv();
extern int m_squit(), m_away(), m_connect();
extern int m_oper(), m_pass(), m_trace();
@@ -332,153 +344,162 @@ extern int m_service(), m_servset(), m_servlist(), m_squery();
extern int m_rehash(), m_restart(), m_die(), m_dns(), m_hash();
/*extern int m_noshortn(),m_noshortc(),m_noshortm(),m_noshorto(),m_noshorth();*/
extern int m_gline(), m_remgline(), m_map(), m_svs2mode(), m_admins(), m_dalinfo();
extern int m_gline(), m_remgline(), m_map(), m_svs2mode(), m_admins(),
m_dalinfo();
extern int m_addline(), m_rules(), m_mkpasswd();
extern int m_sethost(), m_nachat(), m_techat(), m_setident(), m_setname();
extern int m_lag(), m_sdesc(), m_knock(), m_credits();
extern int m_license(), m_chghost(), m_rping(), m_rpong();
extern int m_netinfo(), m_sendumode(), m_addmotd(), m_addomotd();
extern int m_svsmotd(), m_opermotd(), m_tsctl();
extern int m_svsmotd(), m_opermotd(), m_tsctl();
extern int m_svsjoin(), m_sajoin(), m_svspart(), m_sapart();
extern int m_chgident(), m_swhois(), m_svso(), m_svsfline();
extern int m_tkl(), m_vhost(), m_botmotd(), m_sjoin(), m_htm();
extern int m_umode2(), m_dccdeny(), m_undccdeny();
extern int m_chgname();
extern int m_chgname(), m_shun(), m_post();
#ifdef CRYPTOIRCD
extern int m_crypto();
#endif
#ifdef MSGTAB
struct Message *msgmap[256];
struct Message msgtab[] = {
{ MSG_PRIVATE, m_private, 0, MAXPARA, 1, TOK_PRIVATE, 0L },
{ MSG_NOTICE, m_notice, 0, MAXPARA, 1, TOK_NOTICE, 0L },
{ MSG_MODE, m_mode, 0, MAXPARA, 1, TOK_MODE, 0L },
{ MSG_NICK, m_nick, 0, MAXPARA, 1, TOK_NICK, 0L },
{ MSG_JOIN, m_join, 0, MAXPARA, 1, TOK_JOIN, 0L },
{ MSG_PING, m_ping, 0, MAXPARA, 1, TOK_PING, 0L },
{ MSG_WHOIS, m_whois, 0, MAXPARA, 1, TOK_WHOIS, 0L },
{ MSG_ISON, m_ison, 0, 1, 1, TOK_ISON, 0L },
{ MSG_USER, m_user, 0, MAXPARA, 1, TOK_USER, 0L },
{ MSG_PONG, m_pong, 0, MAXPARA, 1, TOK_PONG, 0L },
{ MSG_PART, m_part, 0, MAXPARA, 1, TOK_PART, 0L },
{ MSG_QUIT, m_quit, 0, MAXPARA, 1, TOK_QUIT, 0L },
{ MSG_WATCH, m_watch, 0, 1, 1, TOK_WATCH, 0L },
{ MSG_USERHOST,m_userhost, 0, 1, 1, TOK_USERHOST,0L },
{ MSG_SVSNICK, m_svsnick, 0, MAXPARA, 1, TOK_SVSNICK, 0L },
{ MSG_SVSMODE, m_svsmode, 0, MAXPARA, 1, TOK_SVSMODE, 0L },
{ MSG_LUSERS, m_lusers, 0, MAXPARA, 1, TOK_LUSERS, 0L },
{ MSG_IDENTIFY,m_identify, 0, 1, 1, TOK_IDENTIFY,0L },
{ MSG_CHANSERV,m_chanserv, 0, 1, 1, TOK_CHANSERV,0L },
{ MSG_TOPIC, m_topic, 0, MAXPARA, 1, TOK_TOPIC, 0L },
{ MSG_INVITE, m_invite, 0, MAXPARA, 1, TOK_INVITE, 0L },
{ MSG_KICK, m_kick, 0, MAXPARA, 1, TOK_KICK, 0L },
{ MSG_WALLOPS, m_wallops, 0, 1, 1, TOK_WALLOPS, 0L },
{ MSG_ERROR, m_error, 0, MAXPARA, 1, TOK_ERROR, 0L },
{ MSG_KILL, m_kill, 0, MAXPARA, 1, TOK_KILL, 0L },
{ MSG_PROTOCTL,m_protoctl, 0, MAXPARA, 1, TOK_PROTOCTL,0L },
{ MSG_AWAY, m_away, 0, MAXPARA, 1, TOK_AWAY, 0L },
{ MSG_SERVER, m_server, 0, MAXPARA, 1, TOK_SERVER, 0L },
{ MSG_SQUIT, m_squit, 0, MAXPARA, 1, TOK_SQUIT, 0L },
{ MSG_WHO, m_who, 0, MAXPARA, 1, TOK_WHO, 0L },
{ MSG_WHOWAS, m_whowas, 0, MAXPARA, 1, TOK_WHOWAS, 0L },
{ MSG_LIST, m_list, 0, MAXPARA, 1, TOK_LIST, 0L },
{ MSG_NAMES, m_names, 0, MAXPARA, 1, TOK_NAMES, 0L },
{ MSG_TRACE, m_trace, 0, MAXPARA, 1, TOK_TRACE, 0L },
{ MSG_PASS, m_pass, 0, MAXPARA, 1, TOK_PASS, 0L },
{ MSG_TIME, m_time, 0, MAXPARA, 1, TOK_TIME, 0L },
{ MSG_OPER, m_oper, 0, MAXPARA, 1, TOK_OPER, 0L },
{ MSG_CONNECT, m_connect, 0, MAXPARA, 1, TOK_CONNECT, 0L },
{ MSG_VERSION, m_version, 0, MAXPARA, 1, TOK_VERSION, 0L },
{ MSG_STATS, m_stats, 0, MAXPARA, 1, TOK_STATS, 0L },
{ MSG_LINKS, m_links, 0, MAXPARA, 1, TOK_LINKS, 0L },
{ MSG_ADMIN, m_admin, 0, MAXPARA, 1, TOK_ADMIN, 0L },
{ MSG_USERS, m_users, 0, MAXPARA, 1, TOK_USERS, 0L },
{ MSG_SAMODE, m_samode, 0, MAXPARA, 1, TOK_SAMODE, 0L },
{ MSG_SVSKILL, m_svskill, 0, MAXPARA, 1, TOK_SVSKILL, 0L },
{ MSG_SVSNOOP, m_svsnoop, 0, MAXPARA, 1, TOK_SVSNOOP, 0L },
{ MSG_CS, m_chanserv, 0, 1, 1, TOK_CHANSERV,0L },
{ MSG_NICKSERV,m_nickserv, 0, 1, 1, TOK_NICKSERV,0L },
{ MSG_NS, m_nickserv, 0, 1, 1, TOK_NICKSERV,0L },
{ MSG_OPERSERV,m_operserv, 0, 1, 1, TOK_OPERSERV,0L },
{ MSG_OS, m_operserv, 0, 1, 1, TOK_OPERSERV,0L },
{ MSG_MEMOSERV,m_memoserv, 0, 1, 1, TOK_MEMOSERV,0L },
{ MSG_MS, m_memoserv, 0, 1, 1, TOK_MEMOSERV,0L },
{ MSG_HELPSERV,m_helpserv, 0, 1, 1, TOK_HELPSERV,0L },
{ MSG_HS, m_helpserv, 0, 1, 1, TOK_HELPSERV,0L },
{ MSG_SERVICES,m_services, 0, 1, 1, TOK_SERVICES,0L },
{ MSG_SUMMON, m_summon, 0, MAXPARA, 1, TOK_SUMMON, 0L },
{ MSG_HELP, m_help, 0, 1, 1, TOK_HELP, 0L },
{ MSG_HELPOP, m_help, 0, 1, 1, TOK_HELP, 0L },
{ MSG_INFO, m_info, 0, MAXPARA, 1, TOK_INFO, 0L },
{ MSG_MOTD, m_motd, 0, MAXPARA, 1, TOK_MOTD, 0L },
{ MSG_CLOSE, m_close, 0, MAXPARA, 1, TOK_CLOSE, 0L },
{ MSG_SILENCE, m_silence, 0, MAXPARA, 1, TOK_SILENCE, 0L },
{ MSG_AKILL, m_akill, 0, MAXPARA, 1, TOK_AKILL, 0L },
{ MSG_SQLINE, m_sqline, 0, MAXPARA, 1, TOK_SQLINE, 0L },
{ MSG_UNSQLINE,m_unsqline, 0, MAXPARA, 1, TOK_UNSQLINE,0L },
{ MSG_KLINE, m_kline, 0, MAXPARA, 1, TOK_KLINE, 0L },
{ MSG_UNKLINE, m_unkline, 0, MAXPARA, 1, TOK_UNKLINE, 0L },
{ MSG_ZLINE, m_zline, 0, MAXPARA, 1, TOK_ZLINE, 0L },
{ MSG_UNZLINE, m_unzline, 0, MAXPARA, 1, TOK_UNZLINE, 0L },
{ MSG_RAKILL, m_rakill, 0, MAXPARA, 1, TOK_RAKILL, 0L },
{ MSG_GNOTICE, m_gnotice, 0, MAXPARA, 1, TOK_GNOTICE, 0L },
{ MSG_GOPER, m_goper, 0, MAXPARA, 1, TOK_GOPER, 0L },
{ MSG_GLOBOPS, m_globops, 0, MAXPARA, 1, TOK_GLOBOPS, 0L },
{ MSG_CHATOPS, m_chatops, 0, 1, 1, TOK_CHATOPS, 0L },
{ MSG_LOCOPS, m_locops, 0, 1, 1, TOK_LOCOPS, 0L },
{ MSG_HASH, m_hash, 0, MAXPARA, 1, TOK_HASH, 0L },
{ MSG_DNS, m_dns, 0, MAXPARA, 1, TOK_DNS, 0L },
{ MSG_REHASH, m_rehash, 0, MAXPARA, 1, TOK_REHASH, 0L },
{ MSG_RESTART, m_restart, 0, MAXPARA, 1, TOK_RESTART, 0L },
{ MSG_DIE, m_die, 0, MAXPARA, 1, TOK_DIE, 0L },
{ MSG_RULES, m_rules, 0, MAXPARA, 1, TOK_RULES, 0L },
{ MSG_MAP, m_map, 0, MAXPARA, 1, TOK_MAP, 0L },
{ MSG_GLINE, m_gline, 0, MAXPARA, 1, TOK_GLINE, 0L },
{ MSG_REMGLINE,m_remgline, 0, MAXPARA, 1, TOK_REMGLINE,0L },
{ MSG_DALINFO, m_dalinfo, 0, MAXPARA, 1, TOK_DALINFO, 0L },
{ MSG_SVS2MODE,m_svs2mode, 0, MAXPARA, 1, TOK_SVS2MODE,0L },
{ MSG_MKPASSWD, m_mkpasswd, 0, MAXPARA, 1, TOK_MKPASSWD, 0L },
{ MSG_ADDLINE, m_addline, 0, 1, 1, TOK_ADDLINE, 0L },
{ MSG_ADMINCHAT, m_admins, 0, 1, 1, TOK_ADMINCHAT, 0L },
{ MSG_SETHOST, m_sethost, 0, MAXPARA, 1, TOK_SETHOST, 0L },
{ MSG_TECHAT, m_techat, 0, 1, 1, TOK_TECHAT, 0L },
{ MSG_NACHAT, m_nachat, 0, 1, 1, TOK_NACHAT, 0L },
{ MSG_SETIDENT, m_setident,0, MAXPARA, 1, TOK_SETIDENT, 0L },
{ MSG_SETNAME, m_setname, 0, 1, 1, TOK_SETNAME, 0L },
{ MSG_LAG, m_lag, 0, MAXPARA, 1, TOK_LAG, 0L },
{ MSG_SDESC, m_sdesc, 0, 1, 1, TOK_SDESC, 0L },
{ MSG_STATSERV,m_statserv, 0, 1, 1, TOK_STATSERV,0L },
{ MSG_KNOCK, m_knock, 0, 2, 1, TOK_KNOCK, 0L },
{ MSG_CREDITS, m_credits, 0, MAXPARA, 1, TOK_CREDITS, 0L },
{ MSG_LICENSE, m_license, 0, MAXPARA, 1, TOK_LICENSE, 0L },
{ MSG_CHGHOST, m_chghost, 0, MAXPARA, 1, TOK_CHGHOST, 0L },
{ MSG_RPING, m_rping, 0, MAXPARA, 1, TOK_RPING, 0L },
{ MSG_RPONG, m_rpong, 0, MAXPARA, 1, TOK_RPONG, 0L },
{ MSG_NETINFO, m_netinfo, 0, MAXPARA, 1, TOK_NETINFO, 0L},
{ MSG_SENDUMODE, m_sendumode, 0, MAXPARA, 1, TOK_SENDUMODE, 0L},
{ MSG_SMO, m_sendumode, 0, MAXPARA, 1, TOK_SMO, 0L},
{ MSG_ADDMOTD, m_addmotd, 0, 1, 1, TOK_ADDMOTD, 0L},
{ MSG_ADDOMOTD, m_addomotd, 0, 1, 1, TOK_ADDOMOTD, 0L},
{ MSG_SVSMOTD, m_svsmotd, 0, MAXPARA, 1, TOK_SVSMOTD, 0L},
{ MSG_OPERMOTD, m_opermotd, 0, MAXPARA, 1, TOK_OPERMOTD, 0L},
{ MSG_TSCTL, m_tsctl, 0, MAXPARA, 1, TOK_TSCTL, 0L},
{ MSG_SVSJOIN, m_svsjoin, 0, MAXPARA, 1, TOK_SVSJOIN, 0L},
{ MSG_SAJOIN, m_sajoin, 0, MAXPARA, 1, TOK_SAJOIN,0L},
{ MSG_SVSPART, m_svspart, 0, MAXPARA, 1, TOK_SVSPART, 0L},
{ MSG_SAPART, m_sapart, 0, MAXPARA, 1, TOK_SAPART,0L},
{ MSG_CHGIDENT, m_chgident,0, MAXPARA, 1, TOK_CHGIDENT,0L},
{ MSG_SWHOIS, m_swhois, 0, MAXPARA, 1, TOK_SWHOIS, 0L},
{ MSG_SVSO, m_svso, 0, MAXPARA, 1, TOK_SVSO, 0L},
{ MSG_SVSFLINE, m_svsfline, 0, MAXPARA,1,TOK_SVSFLINE,0L},
{ MSG_TKL, m_tkl, 0, MAXPARA,1,TOK_TKL,0L},
{ MSG_VHOST, m_vhost, 0, MAXPARA,1,TOK_VHOST,0L},
{ MSG_BOTMOTD, m_botmotd, 0, MAXPARA,1,TOK_BOTMOTD,0L},
{ MSG_SJOIN, m_sjoin, 0, MAXPARA, 1, TOK_SJOIN,0L},
{ MSG_HTM, m_htm, 0, MAXPARA, 1, TOK_HTM, 0L},
{ MSG_UMODE2, m_umode2, 0, MAXPARA, 1, TOK_UMODE2, 0L},
{ MSG_DCCDENY,m_dccdeny, 0, 2, 1, TOK_DCCDENY,0L },
{ MSG_UNDCCDENY,m_undccdeny, 0, MAXPARA, 1, TOK_UNDCCDENY,0L },
{ MSG_CHGNAME, m_chgname, 0, MAXPARA, 1, TOK_CHGNAME, 0L},
{ MSG_SVSNAME, m_chgname, 0, MAXPARA, 1, TOK_CHGNAME, 0L},
{ (char *) 0, (int (*)()) 0 , 0, 0, 0, 0, 0L}
{MSG_PRIVATE, m_private, 0, MAXPARA, 1, TOK_PRIVATE, 0L},
{MSG_NOTICE, m_notice, 0, MAXPARA, 1, TOK_NOTICE, 0L},
{MSG_MODE, m_mode, 0, MAXPARA, 1, TOK_MODE, 0L},
{MSG_NICK, m_nick, 0, MAXPARA, 1, TOK_NICK, 0L},
{MSG_JOIN, m_join, 0, MAXPARA, 1, TOK_JOIN, 0L},
{MSG_PING, m_ping, 0, MAXPARA, 1, TOK_PING, 0L},
{MSG_WHOIS, m_whois, 0, MAXPARA, 1, TOK_WHOIS, 0L},
{MSG_ISON, m_ison, 0, 1, 1, TOK_ISON, 0L},
{MSG_USER, m_user, 0, MAXPARA, 1, TOK_USER, 0L},
{MSG_PONG, m_pong, 0, MAXPARA, 1, TOK_PONG, 0L},
{MSG_PART, m_part, 0, MAXPARA, 1, TOK_PART, 0L},
{MSG_QUIT, m_quit, 0, MAXPARA, 1, TOK_QUIT, 0L},
{MSG_WATCH, m_watch, 0, 1, 1, TOK_WATCH, 0L},
{MSG_USERHOST, m_userhost, 0, 1, 1, TOK_USERHOST, 0L},
{MSG_SVSNICK, m_svsnick, 0, MAXPARA, 1, TOK_SVSNICK, 0L},
{MSG_SVSMODE, m_svsmode, 0, MAXPARA, 1, TOK_SVSMODE, 0L},
{MSG_LUSERS, m_lusers, 0, MAXPARA, 1, TOK_LUSERS, 0L},
{MSG_IDENTIFY, m_identify, 0, 1, 1, TOK_IDENTIFY, 0L},
{MSG_CHANSERV, m_chanserv, 0, 1, 1, TOK_CHANSERV, 0L},
{MSG_TOPIC, m_topic, 0, MAXPARA, 1, TOK_TOPIC, 0L},
{MSG_INVITE, m_invite, 0, MAXPARA, 1, TOK_INVITE, 0L},
{MSG_KICK, m_kick, 0, MAXPARA, 1, TOK_KICK, 0L},
{MSG_WALLOPS, m_wallops, 0, 1, 1, TOK_WALLOPS, 0L},
{MSG_ERROR, m_error, 0, MAXPARA, 1, TOK_ERROR, 0L},
{MSG_KILL, m_kill, 0, MAXPARA, 1, TOK_KILL, 0L},
{MSG_PROTOCTL, m_protoctl, 0, MAXPARA, 1, TOK_PROTOCTL, 0L},
{MSG_AWAY, m_away, 0, MAXPARA, 1, TOK_AWAY, 0L},
{MSG_SERVER, m_server, 0, MAXPARA, 1, TOK_SERVER, 0L},
{MSG_SQUIT, m_squit, 0, MAXPARA, 1, TOK_SQUIT, 0L},
{MSG_WHO, m_who, 0, MAXPARA, 1, TOK_WHO, 0L},
{MSG_WHOWAS, m_whowas, 0, MAXPARA, 1, TOK_WHOWAS, 0L},
{MSG_LIST, m_list, 0, MAXPARA, 1, TOK_LIST, 0L},
{MSG_NAMES, m_names, 0, MAXPARA, 1, TOK_NAMES, 0L},
{MSG_TRACE, m_trace, 0, MAXPARA, 1, TOK_TRACE, 0L},
{MSG_PASS, m_pass, 0, MAXPARA, 1, TOK_PASS, 0L},
{MSG_TIME, m_time, 0, MAXPARA, 1, TOK_TIME, 0L},
{MSG_OPER, m_oper, 0, MAXPARA, 1, TOK_OPER, 0L},
{MSG_CONNECT, m_connect, 0, MAXPARA, 1, TOK_CONNECT, 0L},
{MSG_VERSION, m_version, 0, MAXPARA, 1, TOK_VERSION, 0L},
{MSG_STATS, m_stats, 0, MAXPARA, 1, TOK_STATS, 0L},
{MSG_LINKS, m_links, 0, MAXPARA, 1, TOK_LINKS, 0L},
{MSG_ADMIN, m_admin, 0, MAXPARA, 1, TOK_ADMIN, 0L},
{MSG_USERS, m_users, 0, MAXPARA, 1, TOK_USERS, 0L},
{MSG_SAMODE, m_samode, 0, MAXPARA, 1, TOK_SAMODE, 0L},
{MSG_SVSKILL, m_svskill, 0, MAXPARA, 1, TOK_SVSKILL, 0L},
{MSG_SVSNOOP, m_svsnoop, 0, MAXPARA, 1, TOK_SVSNOOP, 0L},
{MSG_CS, m_chanserv, 0, 1, 1, TOK_CHANSERV, 0L},
{MSG_NICKSERV, m_nickserv, 0, 1, 1, TOK_NICKSERV, 0L},
{MSG_NS, m_nickserv, 0, 1, 1, TOK_NICKSERV, 0L},
{MSG_OPERSERV, m_operserv, 0, 1, 1, TOK_OPERSERV, 0L},
{MSG_OS, m_operserv, 0, 1, 1, TOK_OPERSERV, 0L},
{MSG_MEMOSERV, m_memoserv, 0, 1, 1, TOK_MEMOSERV, 0L},
{MSG_MS, m_memoserv, 0, 1, 1, TOK_MEMOSERV, 0L},
{MSG_HELPSERV, m_helpserv, 0, 1, 1, TOK_HELPSERV, 0L},
{MSG_HS, m_helpserv, 0, 1, 1, TOK_HELPSERV, 0L},
{MSG_SERVICES, m_services, 0, 1, 1, TOK_SERVICES, 0L},
{MSG_SUMMON, m_summon, 0, MAXPARA, 1, TOK_SUMMON, 0L},
{MSG_HELP, m_help, 0, 1, 1, TOK_HELP, 0L},
{MSG_HELPOP, m_help, 0, 1, 1, TOK_HELP, 0L},
{MSG_INFO, m_info, 0, MAXPARA, 1, TOK_INFO, 0L},
{MSG_MOTD, m_motd, 0, MAXPARA, 1, TOK_MOTD, 0L},
{MSG_CLOSE, m_close, 0, MAXPARA, 1, TOK_CLOSE, 0L},
{MSG_SILENCE, m_silence, 0, MAXPARA, 1, TOK_SILENCE, 0L},
{MSG_AKILL, m_akill, 0, MAXPARA, 1, TOK_AKILL, 0L},
{MSG_SQLINE, m_sqline, 0, MAXPARA, 1, TOK_SQLINE, 0L},
{MSG_UNSQLINE, m_unsqline, 0, MAXPARA, 1, TOK_UNSQLINE, 0L},
{MSG_KLINE, m_kline, 0, MAXPARA, 1, TOK_KLINE, 0L},
{MSG_UNKLINE, m_unkline, 0, MAXPARA, 1, TOK_UNKLINE, 0L},
{MSG_ZLINE, m_zline, 0, MAXPARA, 1, TOK_ZLINE, 0L},
{MSG_UNZLINE, m_unzline, 0, MAXPARA, 1, TOK_UNZLINE, 0L},
{MSG_RAKILL, m_rakill, 0, MAXPARA, 1, TOK_RAKILL, 0L},
{MSG_GNOTICE, m_gnotice, 0, MAXPARA, 1, TOK_GNOTICE, 0L},
{MSG_GOPER, m_goper, 0, MAXPARA, 1, TOK_GOPER, 0L},
{MSG_GLOBOPS, m_globops, 0, MAXPARA, 1, TOK_GLOBOPS, 0L},
{MSG_CHATOPS, m_chatops, 0, 1, 1, TOK_CHATOPS, 0L},
{MSG_LOCOPS, m_locops, 0, 1, 1, TOK_LOCOPS, 0L},
{MSG_HASH, m_hash, 0, MAXPARA, 1, TOK_HASH, 0L},
{MSG_DNS, m_dns, 0, MAXPARA, 1, TOK_DNS, 0L},
{MSG_REHASH, m_rehash, 0, MAXPARA, 1, TOK_REHASH, 0L},
{MSG_RESTART, m_restart, 0, MAXPARA, 1, TOK_RESTART, 0L},
{MSG_DIE, m_die, 0, MAXPARA, 1, TOK_DIE, 0L},
{MSG_RULES, m_rules, 0, MAXPARA, 1, TOK_RULES, 0L},
{MSG_MAP, m_map, 0, MAXPARA, 1, TOK_MAP, 0L},
{MSG_GLINE, m_gline, 0, MAXPARA, 1, TOK_GLINE, 0L},
{MSG_REMGLINE, m_remgline, 0, MAXPARA, 1, TOK_REMGLINE, 0L},
{MSG_DALINFO, m_dalinfo, 0, MAXPARA, 1, TOK_DALINFO, 0L},
{MSG_SVS2MODE, m_svs2mode, 0, MAXPARA, 1, TOK_SVS2MODE, 0L},
{MSG_MKPASSWD, m_mkpasswd, 0, MAXPARA, 1, TOK_MKPASSWD, 0L},
{MSG_ADDLINE, m_addline, 0, 1, 1, TOK_ADDLINE, 0L},
{MSG_ADMINCHAT, m_admins, 0, 1, 1, TOK_ADMINCHAT, 0L},
{MSG_SETHOST, m_sethost, 0, MAXPARA, 1, TOK_SETHOST, 0L},
{MSG_TECHAT, m_techat, 0, 1, 1, TOK_TECHAT, 0L},
{MSG_NACHAT, m_nachat, 0, 1, 1, TOK_NACHAT, 0L},
{MSG_SETIDENT, m_setident, 0, MAXPARA, 1, TOK_SETIDENT, 0L},
{MSG_SETNAME, m_setname, 0, 1, 1, TOK_SETNAME, 0L},
{MSG_LAG, m_lag, 0, MAXPARA, 1, TOK_LAG, 0L},
{MSG_SDESC, m_sdesc, 0, 1, 1, TOK_SDESC, 0L},
{MSG_STATSERV, m_statserv, 0, 1, 1, TOK_STATSERV, 0L},
{MSG_KNOCK, m_knock, 0, 2, 1, TOK_KNOCK, 0L},
{MSG_CREDITS, m_credits, 0, MAXPARA, 1, TOK_CREDITS, 0L},
{MSG_LICENSE, m_license, 0, MAXPARA, 1, TOK_LICENSE, 0L},
{MSG_CHGHOST, m_chghost, 0, MAXPARA, 1, TOK_CHGHOST, 0L},
{MSG_RPING, m_rping, 0, MAXPARA, 1, TOK_RPING, 0L},
{MSG_RPONG, m_rpong, 0, MAXPARA, 1, TOK_RPONG, 0L},
{MSG_NETINFO, m_netinfo, 0, MAXPARA, 1, TOK_NETINFO, 0L},
{MSG_SENDUMODE, m_sendumode, 0, MAXPARA, 1, TOK_SENDUMODE, 0L},
{MSG_SMO, m_sendumode, 0, MAXPARA, 1, TOK_SMO, 0L},
{MSG_ADDMOTD, m_addmotd, 0, 1, 1, TOK_ADDMOTD, 0L},
{MSG_ADDOMOTD, m_addomotd, 0, 1, 1, TOK_ADDOMOTD, 0L},
{MSG_SVSMOTD, m_svsmotd, 0, MAXPARA, 1, TOK_SVSMOTD, 0L},
{MSG_OPERMOTD, m_opermotd, 0, MAXPARA, 1, TOK_OPERMOTD, 0L},
{MSG_TSCTL, m_tsctl, 0, MAXPARA, 1, TOK_TSCTL, 0L},
{MSG_SVSJOIN, m_svsjoin, 0, MAXPARA, 1, TOK_SVSJOIN, 0L},
{MSG_SAJOIN, m_sajoin, 0, MAXPARA, 1, TOK_SAJOIN, 0L},
{MSG_SVSPART, m_svspart, 0, MAXPARA, 1, TOK_SVSPART, 0L},
{MSG_SAPART, m_sapart, 0, MAXPARA, 1, TOK_SAPART, 0L},
{MSG_CHGIDENT, m_chgident, 0, MAXPARA, 1, TOK_CHGIDENT, 0L},
{MSG_SWHOIS, m_swhois, 0, MAXPARA, 1, TOK_SWHOIS, 0L},
{MSG_SVSO, m_svso, 0, MAXPARA, 1, TOK_SVSO, 0L},
{MSG_SVSFLINE, m_svsfline, 0, MAXPARA, 1, TOK_SVSFLINE, 0L},
{MSG_TKL, m_tkl, 0, MAXPARA, 1, TOK_TKL, 0L},
{MSG_VHOST, m_vhost, 0, MAXPARA, 1, TOK_VHOST, 0L},
{MSG_BOTMOTD, m_botmotd, 0, MAXPARA, 1, TOK_BOTMOTD, 0L},
{MSG_SJOIN, m_sjoin, 0, MAXPARA, 1, TOK_SJOIN, 0L},
{MSG_HTM, m_htm, 0, MAXPARA, 1, TOK_HTM, 0L},
{MSG_UMODE2, m_umode2, 0, MAXPARA, 1, TOK_UMODE2, 0L},
{MSG_DCCDENY, m_dccdeny, 0, 2, 1, TOK_DCCDENY, 0L},
{MSG_UNDCCDENY, m_undccdeny, 0, MAXPARA, 1, TOK_UNDCCDENY, 0L},
{MSG_CHGNAME, m_chgname, 0, MAXPARA, 1, TOK_CHGNAME, 0L},
{MSG_SVSNAME, m_chgname, 0, MAXPARA, 1, TOK_CHGNAME, 0L},
{MSG_SHUN, m_shun, 0, MAXPARA, 1, TOK_SHUN, 0L},
#ifdef CRYPTOIRCD
{MSG_CRYPTO, m_crypto, 0, MAXPARA, 1, TOK_CRYPTO, 0L},
#endif
{MSG_NEWJOIN, m_join, 0, MAXPARA, 1, TOK_JOIN, 0L},
{(char *)0, (int (*)())0, 0, 0, 0, 0, 0L}
};
#else
+109 -109
View File
@@ -23,10 +23,10 @@
/*
* Define constants based on rfc883
*/
#define PACKETSZ 512 /* maximum packet size */
#define MAXDNAME 256 /* maximum domain name */
#define MAXCDNAME 255 /* maximum compressed domain name */
#define MAXLABEL 63 /* maximum length of domain label */
#define PACKETSZ 512 /* maximum packet size */
#define MAXDNAME 256 /* maximum domain name */
#define MAXCDNAME 255 /* maximum compressed domain name */
#define MAXLABEL 63 /* maximum length of domain label */
/* Number of bytes of fixed size data in query structure */
#define QFIXEDSZ 4
/* number of bytes of fixed size data in resource record */
@@ -40,94 +40,94 @@
/*
* Currently defined opcodes
*/
#define QUERY 0x0 /* standard query */
#define IQUERY 0x1 /* inverse query */
#define STATUS 0x2 /* nameserver status query */
#define QUERY 0x0 /* standard query */
#define IQUERY 0x1 /* inverse query */
#define STATUS 0x2 /* nameserver status query */
/*#define xxx 0x3 /* 0x3 reserved */
/* non standard */
#define UPDATEA 0x9 /* add resource record */
#define UPDATED 0xa /* delete a specific resource record */
#define UPDATEDA 0xb /* delete all nemed resource record */
#define UPDATEM 0xc /* modify a specific resource record */
#define UPDATEMA 0xd /* modify all named resource record */
#define UPDATEA 0x9 /* add resource record */
#define UPDATED 0xa /* delete a specific resource record */
#define UPDATEDA 0xb /* delete all nemed resource record */
#define UPDATEM 0xc /* modify a specific resource record */
#define UPDATEMA 0xd /* modify all named resource record */
#define ZONEINIT 0xe /* initial zone transfer */
#define ZONEREF 0xf /* incremental zone referesh */
#define ZONEINIT 0xe /* initial zone transfer */
#define ZONEREF 0xf /* incremental zone referesh */
/*
* Currently defined response codes
*/
#ifdef NOERROR /* defined by solaris2 in */
#undef NOERROR /* <sys/stream.h> to be -1 */
#ifdef NOERROR /* defined by solaris2 in */
#undef NOERROR /* <sys/stream.h> to be -1 */
#endif
#define NOERROR 0 /* no error */
#define FORMERR 1 /* format error */
#define SERVFAIL 2 /* server failure */
#define NXDOMAIN 3 /* non existent domain */
#define NOTIMP 4 /* not implemented */
#define REFUSED 5 /* query refused */
#define NOERROR 0 /* no error */
#define FORMERR 1 /* format error */
#define SERVFAIL 2 /* server failure */
#define NXDOMAIN 3 /* non existent domain */
#define NOTIMP 4 /* not implemented */
#define REFUSED 5 /* query refused */
/* non standard */
#define NOCHANGE 0xf /* update failed to change db */
#define NOCHANGE 0xf /* update failed to change db */
/*
* Type values for resources and queries
*/
#define T_A 1 /* host address */
#define T_NS 2 /* authoritative server */
#define T_MD 3 /* mail destination */
#define T_MF 4 /* mail forwarder */
#define T_CNAME 5 /* connonical name */
#define T_SOA 6 /* start of authority zone */
#define T_MB 7 /* mailbox domain name */
#define T_MG 8 /* mail group member */
#define T_MR 9 /* mail rename name */
#define T_NULL 10 /* null resource record */
#define T_WKS 11 /* well known service */
#define T_PTR 12 /* domain name pointer */
#define T_HINFO 13 /* host information */
#define T_MINFO 14 /* mailbox information */
#define T_MX 15 /* mail routing information */
#define T_TXT 16 /* text strings */
#define T_RP 17 /* responsible person */
#define T_AFSDB 18 /* AFS cell database */
#define T_X25 19 /* X_25 calling address */
#define T_ISDN 20 /* ISDN calling address */
#define T_RT 21 /* router */
#define T_NSAP 22 /* NSAP address */
#define T_NSAP_PTR 23 /* reverse NSAP lookup (deprecated) */
#define T_SIG 24 /* security signature */
#define T_KEY 25 /* security key */
#define T_PX 26 /* X.400 mail mapping */
#define T_GPOS 27 /* geographical position (withdrawn) */
#define T_AAAA 28 /* IP6 Address */
#define T_LOC 29 /* Location Information */
#define T_NXT 30 /* Next Valid Name in Zone */
#define T_EID 31 /* Endpoint identifier */
#define T_NIMLOC 32 /* Nimrod locator */
#define T_SRV 33 /* Server selection */
#define T_ATMA 34 /* ATM Address */
#define T_NAPTR 35 /* Naming Authority PoinTeR */
#define T_A 1 /* host address */
#define T_NS 2 /* authoritative server */
#define T_MD 3 /* mail destination */
#define T_MF 4 /* mail forwarder */
#define T_CNAME 5 /* connonical name */
#define T_SOA 6 /* start of authority zone */
#define T_MB 7 /* mailbox domain name */
#define T_MG 8 /* mail group member */
#define T_MR 9 /* mail rename name */
#define T_NULL 10 /* null resource record */
#define T_WKS 11 /* well known service */
#define T_PTR 12 /* domain name pointer */
#define T_HINFO 13 /* host information */
#define T_MINFO 14 /* mailbox information */
#define T_MX 15 /* mail routing information */
#define T_TXT 16 /* text strings */
#define T_RP 17 /* responsible person */
#define T_AFSDB 18 /* AFS cell database */
#define T_X25 19 /* X_25 calling address */
#define T_ISDN 20 /* ISDN calling address */
#define T_RT 21 /* router */
#define T_NSAP 22 /* NSAP address */
#define T_NSAP_PTR 23 /* reverse NSAP lookup (deprecated) */
#define T_SIG 24 /* security signature */
#define T_KEY 25 /* security key */
#define T_PX 26 /* X.400 mail mapping */
#define T_GPOS 27 /* geographical position (withdrawn) */
#define T_AAAA 28 /* IP6 Address */
#define T_LOC 29 /* Location Information */
#define T_NXT 30 /* Next Valid Name in Zone */
#define T_EID 31 /* Endpoint identifier */
#define T_NIMLOC 32 /* Nimrod locator */
#define T_SRV 33 /* Server selection */
#define T_ATMA 34 /* ATM Address */
#define T_NAPTR 35 /* Naming Authority PoinTeR */
/* non standard */
#define T_UINFO 100 /* user (finger) information */
#define T_UID 101 /* user ID */
#define T_GID 102 /* group ID */
#define T_UNSPEC 103 /* Unspecified format (binary data) */
#define T_UINFO 100 /* user (finger) information */
#define T_UID 101 /* user ID */
#define T_GID 102 /* group ID */
#define T_UNSPEC 103 /* Unspecified format (binary data) */
/* Query type values which do not appear in resource records */
#define T_AXFR 252 /* transfer zone of authority */
#define T_MAILB 253 /* transfer mailbox records */
#define T_MAILA 254 /* transfer mail agent records */
#define T_ANY 255 /* wildcard match */
#define T_AXFR 252 /* transfer zone of authority */
#define T_MAILB 253 /* transfer mailbox records */
#define T_MAILA 254 /* transfer mail agent records */
#define T_ANY 255 /* wildcard match */
/*
* Values for class field
*/
#define C_IN 1 /* the arpa internet */
#define C_CHAOS 3 /* for chaos net at MIT */
#define C_HS 4 /* for Hesiod name server at MIT */
#define C_IN 1 /* the arpa internet */
#define C_CHAOS 3 /* for chaos net at MIT */
#define C_HS 4 /* for Hesiod name server at MIT */
/* Query class values which do not appear in resource records */
#define C_ANY 255 /* wildcard match */
#define C_ANY 255 /* wildcard match */
/*
* Status return codes for T_UNSPEC conversion routines
@@ -161,7 +161,7 @@
#ifndef BYTE_ORDER
/* you must determine what the correct bit order is for your compiler */
UNDEFINED_BIT_ORDER;
UNDEFINED_BIT_ORDER;
#endif
/*
* Structure for query header, the order of the fields is machine and
@@ -171,38 +171,38 @@
*/
typedef struct {
u_short id; /* query identification number */
u_short id; /* query identification number */
#if BYTE_ORDER == BIG_ENDIAN
/* fields in third byte */
u_char qr:1; /* response flag */
u_char opcode:4; /* purpose of message */
u_char aa:1; /* authoritive answer */
u_char tc:1; /* truncated message */
u_char rd:1; /* recursion desired */
/* fields in fourth byte */
u_char ra:1; /* recursion available */
u_char pr:1; /* primary server required (non standard) */
u_char unused:2; /* unused bits */
u_char rcode:4; /* response code */
/* fields in third byte */
u_char qr:1; /* response flag */
u_char opcode:4; /* purpose of message */
u_char aa:1; /* authoritive answer */
u_char tc:1; /* truncated message */
u_char rd:1; /* recursion desired */
/* fields in fourth byte */
u_char ra:1; /* recursion available */
u_char pr:1; /* primary server required (non standard) */
u_char unused:2; /* unused bits */
u_char rcode:4; /* response code */
#endif
#if BYTE_ORDER == LITTLE_ENDIAN || BYTE_ORDER == PDP_ENDIAN
/* fields in third byte */
u_char rd:1; /* recursion desired */
u_char tc:1; /* truncated message */
u_char aa:1; /* authoritive answer */
u_char opcode:4; /* purpose of message */
u_char qr:1; /* response flag */
/* fields in fourth byte */
u_char rcode:4; /* response code */
u_char unused:2; /* unused bits */
u_char pr:1; /* primary server required (non standard) */
u_char ra:1; /* recursion available */
/* fields in third byte */
u_char rd:1; /* recursion desired */
u_char tc:1; /* truncated message */
u_char aa:1; /* authoritive answer */
u_char opcode:4; /* purpose of message */
u_char qr:1; /* response flag */
/* fields in fourth byte */
u_char rcode:4; /* response code */
u_char unused:2; /* unused bits */
u_char pr:1; /* primary server required (non standard) */
u_char ra:1; /* recursion available */
#endif
/* remaining bytes */
u_short qdcount; /* number of question entries */
u_short ancount; /* number of answer entries */
u_short nscount; /* number of authority entries */
u_short arcount; /* number of resource entries */
/* remaining bytes */
u_short qdcount; /* number of question entries */
u_short ancount; /* number of answer entries */
u_short nscount; /* number of authority entries */
u_short arcount; /* number of resource entries */
} HEADER;
/*
@@ -214,23 +214,23 @@ typedef struct {
* Structure for passing resource records around.
*/
struct rrec {
short r_zone; /* zone number */
short r_class; /* class number */
short r_type; /* type number */
short r_zone; /* zone number */
short r_class; /* class number */
short r_type; /* type number */
#ifdef __alpha
u_int r_ttl; /* time to live */
u_int r_ttl; /* time to live */
#else
u_long r_ttl; /* time to live */
u_long r_ttl; /* time to live */
#endif
int r_size; /* size of data area */
char *r_data; /* pointer to data */
int r_size; /* size of data area */
char *r_data; /* pointer to data */
};
extern u_short _getshort();
extern u_short _getshort();
#ifdef __alpha
extern u_int _getlong();
extern u_int _getlong();
#else
extern u_long _getlong();
extern u_long _getlong();
#endif
/*
+8 -3
View File
@@ -143,7 +143,7 @@
#define RPL_WHOISREGNICK 307
#define RPL_RULESSTART 308
#define RPL_ENDOFRULES 309
#define RPL_WHOISHELPOP 310 /* -Donwulff */
#define RPL_WHOISHELPOP 310 /* -Donwulff */
#define RPL_WHOISUSER 311
#define RPL_WHOISSERVER 312
@@ -153,7 +153,7 @@
/* rpl_endofwho below (315) */
#define RPL_ENDOFWHOWAS 369
#define RPL_WHOISCHANOP 316 /* redundant and not needed but reserved */
#define RPL_WHOISCHANOP 316 /* redundant and not needed but reserved */
#define RPL_WHOISIDLE 317
#define RPL_ENDOFWHOIS 318
@@ -234,6 +234,8 @@
#define RPL_STATSLINKINFO 211
#define RPL_STATSCOMMANDS 212
#define RPL_STATSCLINE 213
#define RPL_STATSOLDNLINE 214
#define RPL_STATSILINE 215
#define RPL_STATSKLINE 216
#define RPL_STATSQLINE 217
@@ -248,6 +250,7 @@
#define RPL_STATSTLINE 224
#define RPL_STATSELINE 225
#define RPL_STATSNLINE 226
#define RPL_STATSVLINE 227
#define RPL_SERVICEINFO 231
#define RPL_RULES 232
#define RPL_SERVICE 233
@@ -260,7 +263,7 @@
#define RPL_STATSHLINE 244
#define RPL_STATSSLINE 245
#define RPL_STATSXLINE 247
#define RPL_STATSULINE 248
#define RPL_STATSULINE 248
#define RPL_STATSDEBUG 249
#define RPL_STATSCONN 250
@@ -312,3 +315,5 @@
#define RPL_DUMPING 640
#define RPL_DUMPRPL 641
#define RPL_EODUMP 642
#define ERR_NUMERICERR 999
+36 -36
View File
@@ -17,54 +17,54 @@
#define AR_TTL 600 /* TTL in seconds for dns cache entries */
struct hent {
char *h_name; /* official name of host */
char *h_aliases[MAXALIASES]; /* alias list */
int h_addrtype; /* host address type */
int h_length; /* length of address */
struct hent {
char *h_name; /* official name of host */
char *h_aliases[MAXALIASES]; /* alias list */
int h_addrtype; /* host address type */
int h_length; /* length of address */
/* list of addresses from name server */
struct IN_ADDR h_addr_list[MAXADDRS];
struct IN_ADDR h_addr_list[MAXADDRS];
#define h_addr h_addr_list[0] /* address, for backward compatiblity */
};
typedef struct reslist {
int id;
int sent; /* number of requests sent */
int srch;
time_t ttl;
char type;
char retries; /* retry counter */
char sends; /* number of sends (>1 means resent) */
char resend; /* send flag. 0 == dont resend */
time_t sentat;
time_t timeout;
struct IN_ADDR addr;
char *name;
struct reslist *next;
Link cinfo;
typedef struct reslist {
int id;
int sent; /* number of requests sent */
int srch;
time_t ttl;
char type;
char retries; /* retry counter */
char sends; /* number of sends (>1 means resent) */
char resend; /* send flag. 0 == dont resend */
time_t sentat;
time_t timeout;
struct IN_ADDR addr;
char *name;
struct reslist *next;
Link cinfo;
#ifndef _WIN32
struct hent he;
struct hent he;
#else
struct hostent *he;
char locked;
struct hostent *he;
char locked;
#endif
} ResRQ;
} ResRQ;
typedef struct cache {
time_t expireat;
time_t ttl;
typedef struct cache {
time_t expireat;
time_t ttl;
#ifndef _WIN32
struct hostent he;
struct hostent he;
#else
struct hostent *he;
struct hostent *he;
#endif
struct cache *hname_next, *hnum_next, *list_next;
} aCache;
struct cache *hname_next, *hnum_next, *list_next;
} aCache;
typedef struct cachetable {
aCache *num_list;
aCache *name_list;
} CacheTable;
typedef struct cachetable {
aCache *num_list;
aCache *name_list;
} CacheTable;
#define ARES_CACSIZE 101
+26 -27
View File
@@ -33,25 +33,25 @@
/*
* Global defines and variables for resolver stub.
*/
#define MAXNS 3 /* max # name servers we'll track */
#define MAXDFLSRCH 3 /* # default domain levels to try */
#define MAXDNSRCH 6 /* max # domains in search path */
#define LOCALDOMAINPARTS 2 /* min levels in name that is "local" */
#define MAXSERVICES 2 /* max # of services to search */
#define MAXNS 3 /* max # name servers we'll track */
#define MAXDFLSRCH 3 /* # default domain levels to try */
#define MAXDNSRCH 6 /* max # domains in search path */
#define LOCALDOMAINPARTS 2 /* min levels in name that is "local" */
#define MAXSERVICES 2 /* max # of services to search */
#define RES_TIMEOUT 5 /* min. seconds between retries */
#define RES_TIMEOUT 5 /* min. seconds between retries */
struct state {
int retrans; /* retransmition time interval */
int retry; /* number of times to retransmit */
long options; /* option flags - see below. */
int nscount; /* number of name servers */
struct SOCKADDR_IN nsaddr_list[MAXNS]; /* address of name server */
#define nsaddr nsaddr_list[0] /* for backward compatibility */
unsigned short id; /* current packet id */
char defdname[MAXDNAME]; /* default domain */
char *dnsrch[MAXDNSRCH+1]; /* components of domain to search */
unsigned short order[MAXSERVICES+1]; /* search service order */
int retrans; /* retransmition time interval */
int retry; /* number of times to retransmit */
long options; /* option flags - see below. */
int nscount; /* number of name servers */
struct SOCKADDR_IN nsaddr_list[MAXNS]; /* address of name server */
#define nsaddr nsaddr_list[0] /* for backward compatibility */
unsigned short id; /* current packet id */
char defdname[MAXDNAME]; /* default domain */
char *dnsrch[MAXDNSRCH + 1]; /* components of domain to search */
unsigned short order[MAXSERVICES + 1]; /* search service order */
};
#define RES_SERVICE_NONE 0
@@ -61,19 +61,18 @@ struct state {
/*
* Resolver options
*/
#define RES_INIT 0x0001 /* address initialized */
#define RES_DEBUG 0x0002 /* print debug messages */
#define RES_AAONLY 0x0004 /* authoritative answers only */
#define RES_USEVC 0x0008 /* use virtual circuit */
#define RES_PRIMARY 0x0010 /* query primary server only */
#define RES_IGNTC 0x0020 /* ignore trucation errors */
#define RES_RECURSE 0x0040 /* recursion desired */
#define RES_DEFNAMES 0x0080 /* use default domain name */
#define RES_STAYOPEN 0x0100 /* Keep TCP socket open */
#define RES_DNSRCH 0x0200 /* search up local domain tree */
#define RES_INIT 0x0001 /* address initialized */
#define RES_DEBUG 0x0002 /* print debug messages */
#define RES_AAONLY 0x0004 /* authoritative answers only */
#define RES_USEVC 0x0008 /* use virtual circuit */
#define RES_PRIMARY 0x0010 /* query primary server only */
#define RES_IGNTC 0x0020 /* ignore trucation errors */
#define RES_RECURSE 0x0040 /* recursion desired */
#define RES_DEFNAMES 0x0080 /* use default domain name */
#define RES_STAYOPEN 0x0100 /* Keep TCP socket open */
#define RES_DNSRCH 0x0200 /* search up local domain tree */
#define RES_DEFAULT (RES_RECURSE | RES_DEFNAMES | RES_DNSRCH)
extern struct state _res;
extern char *p_cdname(), *p_rr(), *p_type(), *p_class(), *p_time();
+12 -26
View File
@@ -21,45 +21,31 @@
*/
typedef struct SynchList aSynchList;
typedef struct SynchList aSynchList;
/* SJOIN synch structure */
struct SynchList {
char nick[NICKLEN];
int deop;
int devoice;
int dehalf;
int deown;
int deprot;
int op;
int voice;
int half;
int own;
int prot;
aSynchList *next, *prev;
aClient *cptr;
long setflags;
aSynchList *next, *prev;
};
aSynchList *SJSynchList = NULL;
aSynchList *make_synchlist()
{
Reg1 aSynchList *synchptr;
Reg1 aSynchList *synchptr;
synchptr = (aSynchList *) MyMalloc(sizeof(aSynchList));
synchptr = (aSynchList *) MyMalloc(sizeof(aSynchList));
synchptr->cptr = NULL;
synchptr->setflags = 0;
synchptr->prev = synchptr->next = NULL;
synchptr->nick[0] = 0;
synchptr->deop = synchptr->dehalf = synchptr->deown = synchptr->deprot = 0;
synchptr->devoice = 0;
synchptr->op = 0;
synchptr->voice = synchptr->half = synchptr->own = synchptr->prot = 0;
synchptr->prev = synchptr->next = NULL;
return synchptr;
return synchptr;
}
void free_synchlist(synchptr)
aSynchList *synchptr;
aSynchList *synchptr;
{
MyFree((char *) synchptr);
MyFree((char *)synchptr);
}
+8 -2
View File
@@ -1,3 +1,4 @@
/************************************************************************
* Unreal Internet Relay Chat Daemon, include/sock.h
* Copyright (C) 1990 Jarkko Oikarinen and
@@ -22,6 +23,12 @@
* $Id$
*
* $Log$
* Revision 1.1.1.1.6.1.2.1 2000/07/14 20:22:57 stskeeps
* +- Indentation and more SJ3 fixes
*
* Revision 1.1.1.1.6.1 2000/05/28 08:55:24 cmunk
* Import of Unreal3.1-beta3
*
* Revision 1.2 2000/03/02 21:22:37 stskeeps
* ...........
*
@@ -73,6 +80,5 @@
#endif
#ifdef RCVTIMEO
#define SO_RCVTIMEO 0x1006 /* receive timeout */
#define SO_RCVTIMEO 0x1006 /* receive timeout */
#endif
+1 -2
View File
@@ -1,4 +1,3 @@
/* Auto created release stamping */
#define RELEASEID2 "959378517"
#define RELEASEID2 "961323751"
#define RELEASESTUFF "draconic"
+446 -414
View File
File diff suppressed because it is too large Load Diff
+19 -22
View File
@@ -84,7 +84,7 @@ extern char *rindex PROTO((char *, char));
#else
#include <sys/time.h>
#endif
#if !defined(DEBUGMODE)
#if !defined(DEBUGMODE)
# ifndef _WIN32
# define MyFree(x) if ((x) != NULL) free(x)
# else
@@ -94,13 +94,13 @@ extern char *rindex PROTO((char *, char));
#define free(x) MyFree(x)
#endif
#ifdef NEXT
#define VOIDSIG int /* whether signal() returns int of void */
#define VOIDSIG int /* whether signal() returns int of void */
#else
#define VOIDSIG void /* whether signal() returns int of void */
#define VOIDSIG void /* whether signal() returns int of void */
#endif
#ifdef _SOLARIS
#define OPT_TYPE char /* opt type for get/setsockopt */
#define OPT_TYPE char /* opt type for get/setsockopt */
#else
#define OPT_TYPE void
#endif
@@ -113,22 +113,14 @@ extern char *rindex PROTO((char *, char));
#endif
#ifndef _WIN32
extern VOIDSIG dummy();
#endif
#ifdef DYNIXPTX
#define NO_U_TYPES
typedef unsigned short n_short; /* short as received from the net */
typedef unsigned long n_long; /* long as received from the net */
typedef unsigned long n_time; /* ms since 00:00 GMT, byte rev */
#define _NETINET_IN_SYSTM_INCLUDED
extern VOIDSIG dummy();
#endif
#ifdef NO_U_TYPES
typedef unsigned char u_char;
typedef unsigned short u_short;
typedef unsigned long u_long;
typedef unsigned int u_int;
typedef unsigned char u_char;
typedef unsigned short u_short;
typedef unsigned long u_long;
typedef unsigned int u_int;
#endif
#ifdef _WIN32
@@ -147,8 +139,11 @@ typedef unsigned int u_int;
#ifdef INET6
# define AND16(x) ((x)[0]&(x)[1]&(x)[2]&(x)[3]&(x)[4]&(x)[5]&(x)[6]&(x)[7]&(x)[8]&(x)[9]&(x)[10]&(x)[11]&(x)[12]&(x)[13]&(x)[14]&(x)[15])
static unsigned char minus_one[]={ 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 0};
static unsigned char minus_one[] =
{ 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 0
};
# define WHOSTENTP(x) ((x)[0]|(x)[1]|(x)[2]|(x)[3]|(x)[4]|(x)[5]|(x)[6]|(x)[7]|(x)[8]|(x)[9]|(x)[10]|(x)[11]|(x)[12]|(x)[13]|(x)[14]|(x)[15])
# define AFINET AF_INET6
@@ -175,8 +170,10 @@ char mydummy2[MYDUMMY_SIZE];
# endif
# if defined(linux)
static const struct in6_addr in6addr_any={ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0};
static const struct in6_addr in6addr_any = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0
};
# endif
# define IRCDCONF_DELIMITER '%'
@@ -194,5 +191,5 @@ static const struct in6_addr in6addr_any={ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
# define WHOSTENTP(x) (x)
# define IRCDCONF_DELIMITER ':'
#endif
#endif /* __sys_include__ */
+11 -11
View File
@@ -30,25 +30,25 @@
#endif
struct current_load_struct {
u_short client_count, local_count, conn_count;
u_long entries;
};
u_short client_count, local_count, conn_count;
u_long entries;
};
extern struct current_load_struct current_load_data;
struct load_entry {
struct load_entry *prev;
u_short client_count, local_count, conn_count;
struct load_entry *prev;
u_short client_count, local_count, conn_count;
#ifdef DEBUGMODE
u_short cpu_usage;
u_short cpu_usage;
#endif
long time_incr;
long time_incr;
};
extern struct load_entry *load_list_head, *load_list_tail,
*load_free_head, *load_free_tail;
*load_free_head, *load_free_tail;
extern void initload PROTO ((void));
extern void update_load PROTO ((void));
extern void calc_load PROTO ((aClient *, char *));
extern void initload PROTO((void));
extern void update_load PROTO((void));
extern void calc_load PROTO((aClient *, char *));
+7 -8
View File
@@ -16,13 +16,13 @@
#else
#define DEBUGMODESET ""
#endif
/**/
/**/
#ifdef DEBUG
#define DEBUGSET "(Debug)"
#else
#define DEBUGSET ""
#endif
/**/
#endif
/**/
#define COMPILEINFO DEBUGMODESET DEBUGSET
/*
* Version Unreal3.1
@@ -31,19 +31,18 @@
#define PATCH1 "3"
#define PATCH2 ".1"
#define PATCH3 "-Silverheart"
#define PATCH4 "(beta3)"
#define PATCH4 ""
#define PATCH5 ""
#define PATCH6 ""
#define PATCH7 ""
#define PATCH8 COMPILEINFO
#define PATCH9 ""
#ifndef _WIN32
#define BASE_VERSION "Unreal"
#else
#define BASE_VERSION "UnrealIRCd/32 v"
#endif
/* release header */
#define Rh BASE_VERSION
#define VERSIONONLY PATCH1 PATCH2 PATCH3 PATCH4 PATCH5 PATCH6 PATCH7
#endif /* __versioninclude */
#endif /* __versioninclude */
+11 -11
View File
@@ -39,12 +39,12 @@
** WHOWAS structure moved here from whowas.c
*/
typedef struct aname {
anUser *ww_user;
aClient *ww_online;
time_t ww_logout;
long ww_umodes;
char ww_nick[NICKLEN+1];
char ww_info[REALLEN+1];
anUser *ww_user;
aClient *ww_online;
time_t ww_logout;
long ww_umodes;
char ww_nick[NICKLEN + 1];
char ww_info[REALLEN + 1];
} aName;
@@ -55,7 +55,7 @@ typedef struct aname {
** Client must be a fully registered user (specifically,
** the user structure must have been allocated).
*/
void add_history (aClient *, int);
void add_history(aClient *, int);
/*
** off_history
@@ -64,7 +64,7 @@ void add_history (aClient *, int);
** structures and it must know when they cease to exist. This
** also implicitly calls AddHistory.
*/
void off_history (aClient *);
void off_history(aClient *);
/*
** get_history
@@ -72,15 +72,15 @@ void off_history (aClient *);
** nickname within the timelimit. Returns NULL, if no
** one found...
*/
aClient *get_history (char *, time_t);
aClient *get_history(char *, time_t);
/* Nick name */
/* Time limit in seconds */
int m_whowas (aClient *, aClient *, int, char *[]);
int m_whowas(aClient *, aClient *, int, char *[]);
/*
** for debugging...counts related structures stored in whowas array.
*/
void count_whowas_memory (int *, u_long *);
void count_whowas_memory(int *, u_long *);
#endif /* __whowas_include__ */
+54
View File
@@ -0,0 +1,54 @@
/************************************************************************
* IRC - Internet Relay Chat, include/s_zip.h
* Copyright (C) 1992 Darren Reed
*
* 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 1, 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., 675 Mass Ave, Cambridge, MA 02139, USA.
*
*
* "s_zip.h". - Headers file.
*
* $Id$
*
*/
#ifndef INCLUDED_s_zip_h
#define INCLUDED_s_zip_h
#include <zlib.h> /* z_stream */
#endif
struct Client;
#ifdef ZIP_LINKS
/* the minimum amount of data needed to trigger compression */
#define ZIP_MINIMUM 4096
/* the maximum amount of data to be compressed (can actually be a bit more) */
#define ZIP_MAXIMUM 8192 /* WARNING: *DON'T* CHANGE THIS!!!! */
struct Zdata {
z_stream *in; /* input zip stream data */
z_stream *out; /* output zip stream data */
char inbuf[ZIP_MAXIMUM]; /* incoming zipped buffer */
char outbuf[ZIP_MAXIMUM]; /* outgoing (unzipped) buffer */
int incount; /* size of inbuf content */
int outcount; /* size of outbuf content */
};
#endif /* ZIP_LINKS */
extern int zip_init(struct Client *);
extern void zip_free(struct Client *);
extern char *unzip_packet(struct Client *, char *, int *);
extern char *zip_buffer(struct Client *, char *, int *, int);
+4 -4
View File
@@ -59,10 +59,10 @@ echo "| (4) Someone else is running an ircd on the |"
echo "| default port you chose in ircd.conf. |"
echo "|********************************************|"
echo "| If you can't get Unreal IRCd to work - go |"
echo "| to /server irc.global-irc.net and join |"
echo "| #Global - Try ask in the channel or /msg |"
echo "| Stskeeps/Techie(me!) or else-- email me at |"
echo "| stskeeps@tspre.org |"
echo "| to /server irc.flirt.org and join |"
echo "| #UnrealIRCd or mail us at |"
echo "| unreal-support@lists.sourceforge.net |"
echo "| |"
echo "|--------------------------------------------|"
exit
+27 -5
View File
@@ -5,13 +5,29 @@ CC=cl
# Here you put your settings
FD_SETSIZE=/D FD_SETSIZE=16384
NS_ADDRESS=/D NS_ADDRESS="\"nospoof@dal.net\""
!IFNDEF DEBUG
CFLAGS=/MT /O2 /G5 /I ./INCLUDE /Fosrc/ /nologo $(FD_SETSIZE) $(NS_ADDRESS) /D _WIN32GUI /D NOSPOOF=1 /c
LFLAGS=kernel32.lib user32.lib gdi32.lib shell32.lib wsock32.lib \
oldnames.lib libcmt.lib comctl32.lib /nodefaultlib /nologo /out:WIRCD2.EXE
!ELSE
CFLAGS=/MTd /O2 /G5 /Od /ZI /I ./INCLUDE /Fosrc/ /nologo $(FD_SETSIZE) $(NS_ADDRESS) /D DEBUG /D DEBUGMODE /D _DEBUG /D _WIN32GUI /D NOSPOOF=1 /c
LFLAGS=kernel32.lib user32.lib gdi32.lib shell32.lib wsock32.lib \
oldnames.lib libcmt.lib comctl32.lib /nodefaultlib /nologo /debug /OUT:WIRCD.EXE
!ENDIF
INCLUDES=./include/struct.h ./include/config.h ./include/sys.h \
./include/common.h ./include/version.h ./include/h.h ./include/numeric.h \
./include/msg.h ./include/setup.h ./include/dynconf.h
LINK=link.exe
LFLAGS=kernel32.lib user32.lib gdi32.lib shell32.lib wsock32.lib \
oldnames.lib libcmt.lib comctl32.lib /nodefaultlib /nologo /out:WIRCD2.EXE
OBJ_FILES=SRC/CHANNEL.OBJ SRC/USERLOAD.OBJ SRC/SEND.OBJ SRC/BSD.OBJ \
SRC/S_CONF.OBJ SRC/FDLIST.OBJ SRC/DBUF.OBJ SRC/RES.OBJ \
SRC/CLOAK.OBJ SRC/HASH.OBJ SRC/PARSE.OBJ SRC/IRCD.OBJ \
@@ -22,12 +38,10 @@ OBJ_FILES=SRC/CHANNEL.OBJ SRC/USERLOAD.OBJ SRC/SEND.OBJ SRC/BSD.OBJ \
SRC/MD5.OBJ SRC/S_SERV.OBJ SRC/S_USER.OBJ SRC/WIN32GUI.OBJ \
SRC/VERSION.OBJ SRC/win32/WIN32.RES SRC/S_UNREAL.OBJ SRC/DYNCONF.OBJ \
SRC/S_SOCKS.OBJ SRC/S_KLINE.OBJ SRC/S_EXTRA.OBJ SRC/IRCSPRINTF.OBJ SRC/LUSERS.OBJ \
SRC/SCACHE.OBJ
SRC/SCACHE.OBJ SRC/ALN.OBJ
RC=rc.exe
ALL: WIRCD.EXE CHKCONF.EXE
@echo Please, please REMEMBER to add those U lines!
@echo Read the file READTHIS.NOW formore info
CLEAN:
-@erase src\*.exe 2>NUL
@@ -50,6 +64,11 @@ src/version.obj: src/win32/version.c
./WIRCD.EXE: $(OBJ_FILES) src/win32/version.obj
$(LINK) $(LFLAGS) $(OBJ_FILES)
!IFNDEF DEBUG
Non Debug version built
!ELSE
Debug version built ...
!ENDIF
./CHKCONF.EXE: ./include/struct.h ./include/config.h ./include/sys.h \
./include/common.h ./src/crule.c ./src/match.c ./src/chkconf.c
@@ -99,6 +118,9 @@ src/class.obj: src/class.c $(INCLUDES) ./include/class.h
src/lusers.obj: src/lusers.c $(INCLUDES)
$(CC) $(CFLAGS) src/lusers.c
src/aln.obj: src/aln.c $(INCLUDES)
$(CC) $(CFLAGS) src/aln.c
src/ircd.obj: src/ircd.c $(INCLUDES)
$(CC) $(CFLAGS) src/ircd.c
+30
View File
@@ -0,0 +1,30 @@
ver^2.2
#
# Chatstation (irc.chatstation.net) Network Configuration File
# --------------------------------------------------
# Added-at: 14 July 1999 00:00 GMT
# Author: Astronomy (Kerem Durmus)
# E-Mail: ircadmin@chatstation.net
# $Id$
# -----------------------------------------
#
Network >..........: Chatstation
Set ircnetwork ....: Chatstation
Set defserv .......: irc.chatstation.net
Set SERVICES_NAME .: services.chatstation.net
Set oper_host .....: IRCop.Chatstation.Net
Set admin_host ....: Admin.Chatstation.Net
Set locop_host ....: Locop.Chatstation.Net
Set sadmin_host ...: CSops.Chatstation.Net
Set netadmin_host .: NetAdmin.Chatstation.Net
Set coadmin_host ..: Coadmin.Chatstation.Net
Set techadmin_host : TechAdmin.Chatstation.Net
Set hidden_host ...: Chatstation
Set netdomain .....: chatstation.net
Set helpchan ......: #Help
Set STATS_SERVER ..: stats.Chatstation.Net
Set HUB ...........: 1
Set iNAH ..........: 1
Set net_quit ......: CS
+25
View File
@@ -0,0 +1,25 @@
ver^2.2
#
# German-Elite (irc.german-elite.net) Network Configuration File
# -----------------------------------------
#
Network >..........: German-Elite
Set ircnetwork ....: German-Elite
Set defserv .......: irc.german-elite.net
Set SERVICES_NAME .: services.german-elite.net
Set oper_host .....: ircop.german-elite.net
Set admin_host ....: admin.german-elite.net
Set locop_host ....: locop.german-elite.net
Set sadmin_host ...: csop.german-elite.net
Set netadmin_host .: netadmin.german-elite.net
Set coadmin_host ..: coadmin.german-elite.net
Set techadmin_host : techadmin.german-elite.net
Set hidden_host ...: GE
Set netdomain .....: german-elite.net
Set helpchan ......: #german-elite
Set STATS_SERVER ..: stats.german-elite.net
Set HUB ...........: 1
Set iNAH ..........: 1
Set net_quit ......: GE
+19
View File
@@ -0,0 +1,19 @@
ver^2.2
Network >..........: LinuxSquare
Set ircnetwork ....: LinuxSquare
Set defserv .......: Irc.LinuxSquare.Net
Set SERVICES_NAME .: Services.CA.US.LinuxSquare.Net
Set oper_host .....: GlobalOp.LinuxSquare.Net
Set admin_host ....: Admin.LinuxSquare.Net
Set locop_host ....: TrainingOp.LinuxSquare.Net
Set sadmin_host ...: ServicesAdmin.LinuxSquare.Net
Set netadmin_host .: NetAdmin.LinuxSquare.Net
Set coadmin_host ..: CoAdmin.LinuxSquare.Net
Set techadmin_host : TechAdmin.LinuxSquare.Net
Set hidden_host ...: LinuxSquare
Set netdomain .....: LinuxSquare.Net
Set helpchan ......: #HelpDesk
Set STATS_SERVER ..: Stats.CA.US.LinuxSquare.Net
Set HUB ...........: 1
Set iNAH ..........: 0
Set net_quit ......: LS
+281
View File
@@ -0,0 +1,281 @@
#!/bin/sh
# makenet v1.0 - generates a network file for UnrealIRCd
#
# you may freely use this file with any other program as
# long as the credits remain intact
#
# (c) 2000 codemastr (Dominick Meglio) and the UnrealIRCd Team
VERSION="2.2"
DATE=`date "+%d %B %Y %H:%M"`
FILE="mynet.network"
EXISTS="y"
NICK="MyNick"
EMAIL="me@mynet.org"
NETWORK="My IRC Network"
DEFSERV="irc.mynet.org"
SERVICES_NAME="services.mynet.org"
OPER_HOST="oper.mynet.org"
ADMIN_HOST="admin.mynet.org"
LOCOP_HOST="locop.mynet.org"
CSOP_HOST="csop.mynet.org"
NETADMIN_HOST="netadmin.mynet.org"
TECHADMIN_HOST="techadmin.mynet.org"
COADMIN_HOST="coadmin.mynet.org"
HIDDEN_HOST="hide"
NETDOMAIN="mynet.org"
HELPCHAN="#help"
STATS_SERVER="stats.mynet.org"
INAH="1"
SUBMIT="y"
# Checking out how to specify not to make a new line with the current OS
c=''
n=''
2>/dev/null
if [ "`eval echo -n 'a'`" = "-n a" ]; then
c='\c'
else
n='-n'
fi
clear
echo "Welcome to the UnrealIRCd network file generator"
echo "If you need help to set the IRCd up,"
echo "mail unreal-support@lists.sourceforge.net or ask"
echo "at IRC: /server irc.ircsystems.net, /join #unrealircd"
echo ""
echo "For any sake, read Unreal.nfo and read doc/faq before asking"
echo "questions"
echo "[Enter to Begin]"
read cc
echo ""
echo "What do you want your network file to be called?"
echo $n "[$FILE] -> $c"
read cc
if [ ! -z $cc ]; then
FILE="$cc"
fi
if [ -f $FILE ]; then
echo ""
echo "$FILE already exists do you want to override it?"
echo $n "[$EXISTS] -> $c"
read cc
if [ ! -z $cc ]; then
EXISTS="$cc"
fi
case "$EXISTS" in
[Nn]*)
exit
;;
*)
;;
esac
fi
echo ""
echo "What is your IRC nickname?"
echo $n "[$NICK] -> $c"
read cc
if [ ! -z $cc ]; then
NICK="$cc"
fi
echo ""
echo "What is your email address?"
echo $n "[$EMAIL] -> $c"
read cc
if [ ! -z $cc ]; then
EMAIL="$cc"
fi
echo ""
echo "What is the name of your IRC network?"
echo $n "[$NETWORK] -> $c"
read cc
if [ ! -z $cc ]; then
NETWORK="$cc"
fi
echo ""
echo "What is the default server for your network?"
echo $n "[$DEFSERV] -> $c"
read cc
if [ ! -z $cc ]; then
DEFSERV="$cc"
fi
echo ""
echo "What is the name of your services server?"
echo $n "[$SERVICES_NAME] -> $c"
read cc
if [ ! -z $cc ]; then
SERVICES_NAME="$cc"
fi
echo ""
echo "What is the virtual host opers will get when they oper up?"
echo $n "[$OPER_HOST] -> $c"
read cc
if [ ! -z $cc ]; then
OPER_HOST="$cc"
fi
echo ""
echo "What is the virtual host services opers will get when they oper up?"
echo $n "[$CSOP_HOST] -> $c"
read cc
if [ ! -z $cc ]; then
CSOP_HOST="$cc"
fi
echo ""
echo "What is the virtual host admins will get when they oper up?"
echo $n "[$ADMIN_HOST] -> $c"
read cc
if [ ! -z $cc ]; then
ADMIN_HOST="$cc"
fi
echo ""
echo "What is the virtual host local opers will get when they oper up?"
echo $n "[$LOCOP_HOST] -> $c"
read cc
if [ ! -z $cc ]; then
LOCOP_HOST="$cc"
fi
echo ""
echo "What is the virtual host coadmins will get when they oper up?"
echo $n "[$COADMIN_HOST] -> $c"
read cc
if [ ! -z $cc ]; then
COADMIN_HOST="$cc"
fi
echo ""
echo "What is the virtual host techadmins will get when they oper up?"
echo $n "[$TECHADMIN_HOST] -> $c"
read cc
if [ ! -z $cc ]; then
TECHADMIN_HOST="$cc"
fi
echo ""
echo "What is the virtual host netadmins will get when they oper up?"
echo $n "[$NETADMIN_HOST] -> $c"
read cc
if [ ! -z $cc ]; then
NETADMIN_HOST="$cc"
fi
echo ""
echo "What do you want the prefix for the hidden hosts to be?"
echo $n "[$HIDDEN_HOST] -> $c"
read cc
if [ ! -z $cc ]; then
HIDDEN_HOST="$cc"
fi
echo ""
echo "What is your network's domain name?"
echo $n "[$NETDOMAIN] -> $c"
read cc
if [ ! -z $cc ]; then
NETDOMAIN="$cc"
fi
echo ""
echo "What is your network's help channel?"
echo $n "[$HELPCHAN] -> $c"
read cc
if [ ! -z $cc ]; then
HELPCHAN="$cc"
fi
echo ""
echo "What is the name of your stats server?"
echo $n "[$STATS_SERVER] -> $c"
read cc
if [ ! -z $cc ]; then
STATS_SERVER="$cc"
fi
echo ""
echo "Do you want oper's hosts to be changed on /oper?"
echo "1 = yes 0 = no"
echo $n "[$INAH] -> $c"
read cc
if [ ! -z $cc ]; then
INAH="$cc"
fi
# write the actual conf
cat > $FILE << __EOF__
ver^$VERSION
#
# $NETWORK ($DEFSERV) Network Configuration File
# --------------------------------------------------
# Added-at: $DATE
# Author: $NICK
# Email: $EMAIL
# -----------------------------------------
#
Network >..........: $NETWORK
Set ircnetwork ....: $NETWORK
Set defserv .......: $DEFSERV
Set SERVICES_NAME .: $SERVICES_NAME
Set oper_host .....: $OPER_HOST
Set admin_host ....: $ADMIN_HOST
Set locop_host ....: $LOCOP_HOST
Set sadmin_host ...: $CSOP_HOST
Set netadmin_host .: $NETADMIN_HOST
Set coadmin_host ..: $COADMIN_HOST
Set techadmin_host : $TECHADMIN_HOST
Set hidden_host ...: $HIDDEN_HOST
Set netdomain .....: $NETDOMAIN
Set helpchan ......: $HELPCHAN
Set STATS_SERVER ..: $STATS_SERVER
Set HUB ...........: not_in_use
Set iNAH ..........: $INAH
Set net_quit ......: not_in_use
__EOF__
echo ""
echo "Would you like to submit the your network file to be included with future releases of unreal?"
echo $n "[$SUBMIT] -> $c"
read cc
if [ ! -z $cc ]; then
SUBMIT="$cc"
fi
case "$SUBMIT" in
[Nn]*)
echo "Ok all done, all you have to do is,"
echo "Change the Include line in unrealircd.conf to:"
echo "Include .................: networks/$FILE"
echo "Thank your for choosing UnrealIRCd"
exit
;;
*)
;;
esac
cat |sendmail -t << __EOF__&
To: unreal-networks@lists.sourceforge.net
From: $EMAIL
Subject: Network file submission for $NETWORK
`cat $FILE`
.
__EOF__
echo ""
echo "Ok all done, all you have to do is,"
echo "Change the Include line in unrealircd.conf to:"
echo "Include .................: networks/$FILE"
echo "Thank your for choosing UnrealIRCd"
exit
+6
View File
@@ -32,3 +32,9 @@ networks/interturk.network .......: InterTurk (http://www.interturk.net)
networks/cc2.network .............: CC2 (http://www.cc2.org)
networks/kissland.network ........: Kissland (http://www.kissland.com)
networks/digital-irc.network .....: Digital-IRC (http://www.digital-irc.net)
networks/seveneagle.network ......: SevenEagle.Com
networks/staticedge.network ......: StaticEdge
networks/german-elite.network ....: German-Elite (http://www.german-elite.net)
networks/thainet.network .........: Thai IRC Network
networks/linuxsquare.network .....: LinuxSquare (http://www.linuxsquare.net)
networks/chatstation.network .....: ChatStation
+29
View File
@@ -0,0 +1,29 @@
ver^2.2
#
# Unreal-Team () Network Configuration File
# --------------------------------------------------
# Added-at: 14 July 1999 00:00 GMT
# Author: Stskeeps (Carsten Munk)
# E-Mail: stskeeps@tspre.org
# $Id$
# -----------------------------------------
#
Network >..........: SevenEagle.Com
Set ircnetwork ....: SevenEagle.Com
Set defserv .......: irc.seveneagle.com
Set SERVICES_NAME .: Services.SevenEagle.Com
Set oper_host .....: IRCop.SevenEagle.Com
Set admin_host ....: Admin.SevenEagle.Com
Set locop_host ....: Locop.SevenEagle.Com
Set sadmin_host ...: ServiceOp.SevenEagle.Com
Set netadmin_host .: NetAdmin.SevenEagle.Com
Set coadmin_host ..: CoAdmin.SevenEagle.Com
Set techadmin_host : TechAdmin.SevenEagle.Com
Set hidden_host ...: SevenEagle.Com
Set netdomain .....: SevenEagle.Com
Set helpchan ......: #Help
Set STATS_SERVER ..: Stats.SevenEagle.Com
Set HUB ...........: 1
Set iNAH ..........: 1
Set net_quit ......: SE
+30
View File
@@ -0,0 +1,30 @@
ver^2.2
#
# StaticEdge (irc.staticedge.com) Network Configuration File
# --------------------------------------------------
# Added-at: 06 July 2000 00:00 GMT
# Author: ^Scott^ (Scott Anderson)
# E-Mail: admin@staticedge.com
# $Id$
# -----------------------------------------
#
Network >..........: StaticEdge
Set ircnetwork ....: StaticEdge
Set defserv .......: irc.staticedge.com
Set SERVICES_NAME .: Services.StaticEdge.Com
Set oper_host .....: Opers.StaticEdge.Com
Set admin_host ....: Admins.StaticEdge.Com
Set locop_host ....: LocalOps.StaticEdge.Com
Set sadmin_host ...: CSOps.StaticEdge.Com
Set netadmin_host .: NetAdmin.StaticEdge.Com
Set coadmin_host ..: CoAdmins.StaticEdge.Com
Set techadmin_host : TechAdmins.StaticEdge.Com
Set hidden_host ...: static
Set netdomain .....: StaticEdge.Com
Set helpchan ......: #StaticEdge
Set STATS_SERVER ..: Stats.StaticEdge.Com
Set HUB ...........: 1
Set iNAH ..........: 1
Set net_quit ......: SE
+34
View File
@@ -0,0 +1,34 @@
ver^2.2
#
# Network Configuration File Template
# -----------------------------------------
# Added-at: <day> <month> <year> <hh:dd> GMT
# Author: <nick> (<real name>)
# E-Mail: <email>
# $Id$
# -----------------------------------------
# This is a template so you can create your own network configuration files
# Just follow the instructions and it will prolly work ;)
# 0 = No 1 = Yes
# -------------------------------------------------------
#
# These two specify the name of the IRC network, set the same in both fields
Network >..........: Thai IRC Network
Set ircnetwork ....: Thai IRC Network
Set defserv .......: irc.thai.com
Set SERVICES_NAME .: services.thai.com
Set oper_host .....: ircop.thai.com
Set admin_host ....: admin.thai.com
Set locop_host ....: locop.thai.com
Set sadmin_host ...: serviceop.thai.com
Set netadmin_host .: netadmin.thai.com
Set coadmin_host ..: coadmin.thai.com
Set techadmin_host : techadmin.thai.com
Set hidden_host ...: ThaiNet
Set netdomain .....: irc.thai.com
Set helpchan ......: #Services
Set STATS_SERVER ..: stats.thai.com
Set HUB ...........: 1
Set iNAH ..........: 1
Set net_quit ......: ic
+3 -3
View File
@@ -12,7 +12,7 @@ Include .................: networks/unreal-test.network
#
# What K:Line address can K:lined users mail at?
#
Set KLINE_ADDRESS .......: the admin of this server
Set KLINE_ADDRESS .......: unreal-dev@lists.sourceforge.net
# If you want users to get auto +x on connect
# 1 = Yes 0 = No
@@ -22,7 +22,7 @@ Set MODE_X ..............: 1
# 1 = Yes 0 = No
Set MODE_I ..............: 0
# Auto +X users when they connect? This can help as a new REMOVE_ADVERTISE
# Auto +G users when they connect? This can help as a new REMOVE_ADVERTISE
Set MODE_STRIPWORDS .....: 0
# If compiled on a halfhub network this will upgrade it to be a real hub
@@ -61,7 +61,7 @@ Set SHOWOPERMOTD ........: 1
#
# Hide U:lines from non-opers in /links?
# 1 = Yes 0 = No
Set HIDE_ULINES .........: 0
Set HIDE_ULINES .........: 1
#
# Allow use of ChatOps?
+1 -1
View File
@@ -6,7 +6,7 @@
echo "| If you want your networks network file in the "
echo "| next release please attach your network file "
echo "| to an email and mail it to "
echo" | unreal-networks@lists.sourceforge.net "
echo "| unreal-networks@lists.sourceforge.net "
echo "| "
echo "|=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= "
exit 1
+7 -6
View File
@@ -25,10 +25,11 @@ LINTFLAGS=-hba
OBJS=agent.o aln.o badwords.o bsd.o channel.o class.o cloak.o crule.o dbuf.o dynconf.o \
fdlist.o hash.o help.o ircd.o ircsprintf.o list.o lusers.o \
match.o md5.o packet.o parse.o res.o $(RES) s_auth.o \
match.o packet.o parse.o $(REGEX) res.o $(RES) s_auth.o \
s_bsd.o s_conf.o s_debug.o s_err.o s_extra.o s_kline.o \
s_misc.o s_numeric.o s_serv.o s_socks.o $(STRTOUL) s_unreal.o \
s_user.o scache.o send.o support.o userload.o version.o whowas.o
s_user.o scache.o send.o support.o userload.o version.o whowas.o \
zip.o
# OBJS=bsd.o dbuf.o packet.o send.o match.o parse.o support.o channel.o \
# class.o hash.o ircd.o list.o res.o cloak.o s_auth.o s_bsd.o s_conf.o \
@@ -58,7 +59,7 @@ version.o: version.c ../include/version.h
$(CC) $(CFLAGS) -c version.c
ircd: $(OBJS)
$(CC) $(CFLAGS) -o ircd $(OBJS) $(LDFLAGS) $(IRCDLIBS)
$(CC) $(CFLAGS) -o ircd $(OBJS) $(LDFLAGS) $(IRCDLIBS) $(CRYPTOLIB)
chmod $(IRCDMODE) ircd
chkconf: ../include/struct.h ../include/config.h ../include/settings.h ../include/sys.h \
@@ -92,6 +93,9 @@ badwords.o: badwords.c $(INCLUDES)
aln.o: aln.c $(INCLUDES)
$(CC) $(CFLAGS) -c aln.c
zip.o: zip.c $(INCLUDES)
$(CC) $(CFLAGS) -c zip.c
send.o: send.c $(INCLUDES)
$(CC) $(CFLAGS) -c send.c
@@ -107,9 +111,6 @@ userload.o: userload.c $(INCLUDES)
help.o: help.c $(INCLUDES)
$(CC) $(CFLAGS) -c help.c
md5.o: md5.c $(INCLUDES)
$(CC) $(CFLAGS) -c md5.c
#install: all
# -if [ ! -d ${IRCDDIR} -a ! -f ${IRCDDIR} ] ; then \
# mkdir ${IRCDDIR}; \
+1 -1
View File
@@ -1,5 +1,5 @@
/************************************************************************
* IRC - Internet Relay Chat, aln.c
* Unreal Internet Relay Chat Daemo, src/aln.c
* (C) 2000 Carsten Munk (Techie/Stskeeps) <stskeeps@tspre.org>
*
* See file AUTHORS in IRC package for additional names of
+23 -1
View File
@@ -17,6 +17,9 @@
#include <unistd.h>
#include "config.h"
#include "struct.h"
#include "common.h"
#include "h.h"
#ifdef STRIPBADWORDS
#include "badwords.h"
@@ -31,6 +34,10 @@ static int message_wordlist;
* in both private and public messages
*/
void badwords_stats(aClient *sptr)
{
}
char *stripbadwords_channel(char *str)
{
regmatch_t pmatch[MAX_MATCH];
@@ -157,8 +164,15 @@ int loadbadwords_channel(char *wordfile)
|| (ptr = strchr(buf, '\n')) != NULL)
*ptr = '\0';
if (buf[0] == '\0')
{
i--;
continue;
}
if (buf[0] == '#')
{
i--;
continue;
}
for (j = 0, isregex = 0; j < strlen(buf); j++)
{
if ((int)buf[j] < 65 || (int)buf[j] > 123)
@@ -213,7 +227,15 @@ int loadbadwords_message(char *wordfile)
|| (ptr = strchr(buf, '\n')) != NULL)
*ptr = '\0';
if (buf[0] == '\0')
{
i--;
continue;
}
if (buf[0] == '#')
{
i--;
continue;
}
for (j = 0, isregex = 0; j < strlen(buf); j++)
{
+782 -673
View File
File diff suppressed because it is too large Load Diff
-5
View File
@@ -38,11 +38,6 @@ ID_CVS("$Id$");
ID_Copyright("(C) 1993 Darren Reed");
ID_Notes("DF version was 1.9 1/30/94");
#ifdef DYNIXPTX
#include <sys/types.h>
#include <time.h>
#endif
/* for the connect rule patch.. these really should be in a header,
** but i see h.h isn't included for some reason.. so they're here */
char *crule_parse PROTO((char *rule));
+3 -4
View File
@@ -142,10 +142,9 @@ void add_class(class, ping, confreq, maxli, sendq)
if (maxli > (MAXCONNECTIONS - 15))
{
Debug((DEBUG_DEBUG, "Not adding Class %d as maxli is > MAXCONNECTIONS - 15",
class));
badclass = class;
return;
Debug((DEBUG_DEBUG, "Reducing class %d to %i",
class, (MAXCONNECTIONS - 15)));
maxli = MAXCONNECTIONS - 15;
}
t = find_class(class);
if ((t == classes) && (class != 0))
+1
View File
@@ -31,6 +31,7 @@ static char sccxid[] = "@(#)cloak.c 9.00 7/12/99 UnrealIRCd";
#include "sys.h"
#include "numeric.h"
#include "msg.h"
#include "ircsprintf.h"
#include "channel.h"
#include "userload.h"
#include <sys/stat.h>
+1 -1
View File
@@ -313,7 +313,7 @@ int dbuf_getmsg(dyn, buf, length)
while (length > 0 && dlen > 0)
{
dlen--;
if (*s == '\n' || *s == '\r')
if (*s == '\n' /* || *s == '\r' */) /*let stop at \n now .. */
{
copy = dyn->length - dlen;
/*
+1
View File
@@ -36,6 +36,7 @@
#endif
#include <fcntl.h>
#include "h.h"
#include "setup.h"
ID_CVS("$Id$");
ID_Copyright("(C) 1999-2000 Carsten Munk");
+39
View File
@@ -0,0 +1,39 @@
/*
* Unreal Internet Relay Chat Daemon, src/fdmaxcounter.c
* Copyright (C) 2000 Carsten V. Munk <stskeeps@tspre.org>
*
* See file AUTHORS in IRC package for additional names of
* the programmers.
*
* 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 1, 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., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <sys/types.h>
#include <sys/socket.h>
main()
{
int i;
int s;
for (i = 1; i <= 10000; i++)
{
s = socket(AF_INET, SOCK_STREAM, 0);
if (s < 0)
{
printf("Max fds is %i\n", i + 2);
exit(-1);
}
}
}
+1 -36
View File
@@ -96,42 +96,7 @@ int parse_help(sptr, name, help)
}
else if (!myncmp(help, "ABOUT", 8))
{
HDR(" *** About UnrealIRCd ***");
SND("I started making UnrealIRCd about 3-4 months ago.");
SND("First it was called mpx2.0b13.soundforge - as I was");
SND("inspired of the 'forge' word. I quickly changed name");
SND("after I realized the IRCd had more potential for other");
SND("IRC nets. Unreal is based off df4.6.5 and some of");
SND("First lemme");
SND("introduce myself. My nick is Techie/Stskeeps. I hang");
SND("out at Global-IRC.net, DALnet, DragonWings.org and so on");
SND("--");
SND
("Unreal is a hybrid of Dreamforge (as I said) mixed with some");
SND
("Twilight IRCd, TerraIRCd, TS4 (channel mode +h & +e) features");
SND
("(IMHO TwilightIRCd is one of the best dreamforge hybrids I've seen!)");
SND
("Unreal is not a rip-off of other IRCds - I added a lot of features myself!");
SND
("I really cannot mention some major features as I think a IRCd is a");
SND
("IRCd when it has got useful commands- and people actually say mine has!");
SND("--");
SND
("Anyways I dunt demand donations or anything. I just do coding for fun");
SND
("I treat coding like playing with toys. It makes me happy(or is it just");
SND
("caffeine?;). An addy to send donations is at the Donation file in the IRCd dir");
SND("I would be more happy if someone e-mailed me with ideas");
SND
("to the IRCd.. The whole IRCd is GNU so if you want to rip off any of my ideas");
SND
("You are generally welcome:) Just remember to do what's said in the Changes file!");
SND("-- So.. Enjoy this IRCd:)");
SND(" -- Carsten Munk / Techie .. =)");
SND("Type /info for UnrealIRCd information -- Carsten Munk / Techie .. =)");
}
else if (!myncmp(help, "WATCH", 8))
{
+14 -41
View File
@@ -24,10 +24,6 @@ static char sccsid[] =
Computing Center and Jarkko Oikarinen";
#endif
/* debug --sts (chdir kludge) */
// #define UNREAL_DEBUG
#include "config.h"
#include "struct.h"
#include "common.h"
@@ -64,6 +60,7 @@ Computing Center and Jarkko Oikarinen";
#include "badwords.h"
#endif
#include "version.h"
ID_CVS("$Id$");
ID_Copyright
("(C) 1988 University of Oulu, Computing Center and Jarkko Oikarinen");
@@ -79,7 +76,10 @@ int un_gid = 99;
#endif
/* End */
#ifndef _WIN32
extern char unreallogo[];
#endif
extern aMotd *opermotd;
extern aMotd *svsmotd;
extern aMotd *motd;
@@ -101,6 +101,7 @@ char REPORT_DO_SOCKS[128], REPORT_NO_SOCKS[128], REPORT_GOOD_SOCKS[128];
#endif
#endif
aClient me; /* That's me */
char *me_hash;
aClient *client = &me; /* Pointer to beginning of Client list */
extern char backupbuf[8192];
@@ -147,29 +148,10 @@ time_t nextexpire = 1; /* next expire run on the dns cache */
time_t nextkillcheck = 1; /* next time to check for nickserv kills */
time_t lastlucheck = 0;
/* int lu_noninv = 0,
lu_inv = 0,
lu_serv = 0,
lu_oper = 0,
lu_unknown = 0,
lu_channel = 0,
lu_lu = 0,
lu_lulocal = 0,
lu_lserv = 0,
lu_clu = 0,
lu_mlu = 0,
lu_cglobalu = 0,
lu_mglobalu;
*/
/* */
#ifdef UNREAL_DEBUG
#undef CHROOTDIR
#define CHROOT
#endif
#ifdef CLONE_CHECK
aClone *Clones = NULL;
char clonekillhost[100];
#endif
time_t NOW;
#if defined(PROFIL) && !defined(_WIN32)
@@ -330,8 +312,7 @@ void server_reboot(mesg)
(void)close(1);
if ((bootopt & BOOT_CONSOLE) || isatty(0))
(void)close(0);
if (!(bootopt & (BOOT_OPER)))
(void)execv(MYNAME, myargv);
(void)execv(MYNAME, myargv);
#else
for (i = 0; i < highest_fd; i++)
if (closesocket(i) == -1)
@@ -804,10 +785,6 @@ int InitwIRCD(argc, argv)
dpath = p;
break;
#ifndef _WIN32
case 'o': /* Per user local daemon... */
(void)setuid((uid_t) uid);
bootopt |= BOOT_OPER;
break;
#ifdef CMDLINE_CONFIG
case 'f':
(void)setuid((uid_t) uid);
@@ -951,7 +928,9 @@ int InitwIRCD(argc, argv)
return bad_command(); /* This should exit out */
#ifndef _WIN32
fprintf(stderr, unreallogo);
#endif
fprintf(stderr, " v%s\n\n", VERSIONONLY);
clear_client_hash_table();
clear_channel_hash_table();
@@ -1068,8 +1047,8 @@ int InitwIRCD(argc, argv)
#endif
SetMe(&me);
make_server(&me);
(void)find_or_add(me.name);
me.serv->up = find_or_add(me.name);
me_hash = find_or_add(me.name);
me.serv->up = me_hash;
me.lasttime = me.since = me.firsttime = TStime();
(void)add_to_client_hash_table(me.name, &me);
@@ -1110,16 +1089,7 @@ int InitwIRCD(argc, argv)
#endif
check_class();
if (bootopt & BOOT_OPER)
{
aClient *tmp = add_connection(&me, 0);
if (!tmp)
exit(1);
SetMaster(tmp);
}
else
write_pidfile();
write_pidfile();
Debug((DEBUG_NOTICE, "Server ready..."));
#ifdef USE_SYSLOG
@@ -1190,6 +1160,9 @@ void SocketLoop(void *dummy)
(ii - freelinks));
}
}
if (do_garbage_collect == 1)
do_garbage_collect = 0;
last_garbage_collect = now;
}
/*
+9
View File
@@ -142,6 +142,9 @@ aClient *make_client(from, servr)
cptr->sockhost[0] = '\0';
cptr->buffer[0] = '\0';
cptr->authfd = -1;
#ifdef CRYPTOIRCD
cptr->cryptinfo = NULL;
#endif
#ifdef SOCKSPORT
cptr->socksfd = -1;
#endif
@@ -152,6 +155,10 @@ aClient *make_client(from, servr)
void free_client(cptr)
aClient *cptr;
{
#ifdef CRYPTOIRCD
if (MyClient(cptr) && cptr->cryptinfo)
MyFree((char *)cptr->cryptinfo);
#endif
MyFree((char *)cptr);
}
@@ -265,6 +272,8 @@ void remove_client_from_list(cptr)
IRCstats.operators--;
IRCstats.clients--;
}
if (IsUnknown(cptr) || IsConnecting(cptr) || IsHandshake(cptr))
IRCstats.unknown--;
checklist();
if (cptr->prev)
cptr->prev->next = cptr->next;
-165
View File
@@ -1,165 +0,0 @@
/*
* Copyright (c) 1996 Michael Shalayeff.
*
* This software derived from one contributed by Colin Plumb.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Colin Plumb.
* 4. Neither the name of the University nor of the Laboratory may be used
* to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
*/
/*
* The code for MD5 transform was taken from Colin Plumb's
* implementation, which has been placed in the public domain. The
* MD5 cryptographic checksum was devised by Ronald Rivest, and is
* documented in RFC 1321, "The MD5 Message Digest Algorithm".
*
*/
#include <sys/types.h>
#include "struct.h"
#include "common.h"
ID_CVS("$Id$");
/*
* MD5 transform algorithm, taken from code written by Colin Plumb,
* and put into the public domain
*
* QUESTION: Replace this with SHA, which as generally received better
* reviews from the cryptographic community?
*/
void MD5Init(buf)
u_int32_t buf[4];
{
buf[0] = 0x67452301;
buf[1] = 0xefcdab89;
buf[2] = 0x98badcfe;
buf[3] = 0x10325476;
}
/* The four core functions - F1 is optimized somewhat */
/* #define F1(x, y, z) (x & y | ~x & z) */
#define F1(x, y, z) (z ^ (x & (y ^ z)))
#define F2(x, y, z) F1(z, x, y)
#define F3(x, y, z) (x ^ y ^ z)
#define F4(x, y, z) (y ^ (x | ~z))
/* This is the central step in the MD5 algorithm. */
#define MD5STEP(f, w, x, y, z, data, s) \
( w += f(x, y, z) + data, w = w<<s | w>>(32-s), w += x )
/*
* The core of the MD5 algorithm, this alters an existing MD5 hash to
* reflect the addition of 16 longwords of new data.
*/
void MD5Transform(buf, in)
u_int32_t buf[4];
u_int32_t in[16];
{
u_int32_t a, b, c, d;
a = buf[0];
b = buf[1];
c = buf[2];
d = buf[3];
MD5STEP(F1, a, b, c, d, in[0] + 0xd76aa478, 7);
MD5STEP(F1, d, a, b, c, in[1] + 0xe8c7b756, 12);
MD5STEP(F1, c, d, a, b, in[2] + 0x242070db, 17);
MD5STEP(F1, b, c, d, a, in[3] + 0xc1bdceee, 22);
MD5STEP(F1, a, b, c, d, in[4] + 0xf57c0faf, 7);
MD5STEP(F1, d, a, b, c, in[5] + 0x4787c62a, 12);
MD5STEP(F1, c, d, a, b, in[6] + 0xa8304613, 17);
MD5STEP(F1, b, c, d, a, in[7] + 0xfd469501, 22);
MD5STEP(F1, a, b, c, d, in[8] + 0x698098d8, 7);
MD5STEP(F1, d, a, b, c, in[9] + 0x8b44f7af, 12);
MD5STEP(F1, c, d, a, b, in[10] + 0xffff5bb1, 17);
MD5STEP(F1, b, c, d, a, in[11] + 0x895cd7be, 22);
MD5STEP(F1, a, b, c, d, in[12] + 0x6b901122, 7);
MD5STEP(F1, d, a, b, c, in[13] + 0xfd987193, 12);
MD5STEP(F1, c, d, a, b, in[14] + 0xa679438e, 17);
MD5STEP(F1, b, c, d, a, in[15] + 0x49b40821, 22);
MD5STEP(F2, a, b, c, d, in[1] + 0xf61e2562, 5);
MD5STEP(F2, d, a, b, c, in[6] + 0xc040b340, 9);
MD5STEP(F2, c, d, a, b, in[11] + 0x265e5a51, 14);
MD5STEP(F2, b, c, d, a, in[0] + 0xe9b6c7aa, 20);
MD5STEP(F2, a, b, c, d, in[5] + 0xd62f105d, 5);
MD5STEP(F2, d, a, b, c, in[10] + 0x02441453, 9);
MD5STEP(F2, c, d, a, b, in[15] + 0xd8a1e681, 14);
MD5STEP(F2, b, c, d, a, in[4] + 0xe7d3fbc8, 20);
MD5STEP(F2, a, b, c, d, in[9] + 0x21e1cde6, 5);
MD5STEP(F2, d, a, b, c, in[14] + 0xc33707d6, 9);
MD5STEP(F2, c, d, a, b, in[3] + 0xf4d50d87, 14);
MD5STEP(F2, b, c, d, a, in[8] + 0x455a14ed, 20);
MD5STEP(F2, a, b, c, d, in[13] + 0xa9e3e905, 5);
MD5STEP(F2, d, a, b, c, in[2] + 0xfcefa3f8, 9);
MD5STEP(F2, c, d, a, b, in[7] + 0x676f02d9, 14);
MD5STEP(F2, b, c, d, a, in[12] + 0x8d2a4c8a, 20);
MD5STEP(F3, a, b, c, d, in[5] + 0xfffa3942, 4);
MD5STEP(F3, d, a, b, c, in[8] + 0x8771f681, 11);
MD5STEP(F3, c, d, a, b, in[11] + 0x6d9d6122, 16);
MD5STEP(F3, b, c, d, a, in[14] + 0xfde5380c, 23);
MD5STEP(F3, a, b, c, d, in[1] + 0xa4beea44, 4);
MD5STEP(F3, d, a, b, c, in[4] + 0x4bdecfa9, 11);
MD5STEP(F3, c, d, a, b, in[7] + 0xf6bb4b60, 16);
MD5STEP(F3, b, c, d, a, in[10] + 0xbebfbc70, 23);
MD5STEP(F3, a, b, c, d, in[13] + 0x289b7ec6, 4);
MD5STEP(F3, d, a, b, c, in[0] + 0xeaa127fa, 11);
MD5STEP(F3, c, d, a, b, in[3] + 0xd4ef3085, 16);
MD5STEP(F3, b, c, d, a, in[6] + 0x04881d05, 23);
MD5STEP(F3, a, b, c, d, in[9] + 0xd9d4d039, 4);
MD5STEP(F3, d, a, b, c, in[12] + 0xe6db99e5, 11);
MD5STEP(F3, c, d, a, b, in[15] + 0x1fa27cf8, 16);
MD5STEP(F3, b, c, d, a, in[2] + 0xc4ac5665, 23);
MD5STEP(F4, a, b, c, d, in[0] + 0xf4292244, 6);
MD5STEP(F4, d, a, b, c, in[7] + 0x432aff97, 10);
MD5STEP(F4, c, d, a, b, in[14] + 0xab9423a7, 15);
MD5STEP(F4, b, c, d, a, in[5] + 0xfc93a039, 21);
MD5STEP(F4, a, b, c, d, in[12] + 0x655b59c3, 6);
MD5STEP(F4, d, a, b, c, in[3] + 0x8f0ccc92, 10);
MD5STEP(F4, c, d, a, b, in[10] + 0xffeff47d, 15);
MD5STEP(F4, b, c, d, a, in[1] + 0x85845dd1, 21);
MD5STEP(F4, a, b, c, d, in[8] + 0x6fa87e4f, 6);
MD5STEP(F4, d, a, b, c, in[15] + 0xfe2ce6e0, 10);
MD5STEP(F4, c, d, a, b, in[6] + 0xa3014314, 15);
MD5STEP(F4, b, c, d, a, in[13] + 0x4e0811a1, 21);
MD5STEP(F4, a, b, c, d, in[4] + 0xf7537e82, 6);
MD5STEP(F4, d, a, b, c, in[11] + 0xbd3af235, 10);
MD5STEP(F4, c, d, a, b, in[2] + 0x2ad7d2bb, 15);
MD5STEP(F4, b, c, d, a, in[9] + 0xeb86d391, 21);
buf[0] += a;
buf[1] += b;
buf[2] += c;
buf[3] += d;
}
+139 -39
View File
@@ -28,6 +28,62 @@ ID_CVS("$Id$");
ID_Copyright
("(C) 1988 University of Oulu, Computing Center and Jarkko Oikarinen");
ID_Notes("2.12 1/30/94");
#ifdef CRYPTOIRCD
char *ep_encrypt(aClient *cptr, char *string, int *len)
{
static unsigned char cryptobuffer[8192];
char ivec[9];
int length;
char *c;
int num;
if (!cptr->cryptinfo)
return string;
bzero(cryptobuffer, sizeof(cryptobuffer));
bzero(ivec, sizeof(ivec));
num = 0;
if ((c = (char *)strchr(string, '\n')))
*c = '\0';
if ((c = (char *)strchr(string, '\r')))
*c = '\0';
length = strlen(string) + 1;
cryptobuffer[0] = (unsigned char) length / 256;
cryptobuffer[1] = (unsigned char) length - (cryptobuffer[0] * 256);
if (cptr->cryptinfo->method == METHOD_BLOWFISH)
{
BF_cfb64_encrypt(string, &cryptobuffer[2], length, cptr->cryptinfo->key, ivec, &num, BF_ENCRYPT);
*len = length + 2;
return (cryptobuffer);
}
}
char *ep_decrypt(aClient *cptr, char *string)
{
static char decryptbuffer[8192];
int num;
char ivec[9];
int length;
if (!cptr->cryptinfo)
return string;
bzero(decryptbuffer, sizeof(decryptbuffer));
bzero(ivec, sizeof(ivec));
num = 0;
length = (*(string) * 256) + (*(string + 1));
if (cptr->cryptinfo->method == METHOD_BLOWFISH)
{
BF_cfb64_encrypt(string + 2, decryptbuffer, length, cptr->cryptinfo->key, ivec, &num, BF_DECRYPT);
return (decryptbuffer);
}
}
#endif
/*
* inittoken
* Cheat here, blah. Build the lookup tables from msgtab's,
@@ -70,6 +126,11 @@ int dopacket(cptr, buffer, length)
char *ch1;
char *ch2;
aClient *acpt = cptr->acpt;
#ifdef CRYPTOIRCD
int lengthweneed, num, lengthbackup, li;
char *s;
char f[4096], x[512];
#endif
me.receiveB += length; /* Update bytes received */
cptr->receiveB += length;
@@ -94,49 +155,88 @@ int dopacket(cptr, buffer, length)
}
ch1 = cptr->buffer + cptr->count;
ch2 = buffer;
while (--length >= 0)
#ifdef CRYPTOIRCD
if (IsSecure(cptr))
{
char g = (*ch1 = *ch2++);
/*
* Yuck. Stuck. To make sure we stay backward compatible,
* we must assume that either CR or LF terminates the message
* and not CR-LF. By allowing CR or LF (alone) into the body
* of messages, backward compatibility is lost and major
* problems will arise. - Avalon
*/
if (g < '\16' && (g == '\n' || g == '\r'))
while (--length >= 0)
{
if (ch1 == cptr->buffer)
continue; /* Skip extra LF/CR's */
*ch1 = '\0';
me.receiveM += 1; /* Update messages received */
cptr->receiveM += 1;
if (cptr->acpt != &me)
cptr->acpt->receiveM += 1;
cptr->count = 0; /* ...just in case parse returns with
** FLUSH_BUFFER without removing the
** structure pointed by cptr... --msa
*/
if (parse(cptr, cptr->buffer, ch1, msgtab) ==
FLUSH_BUFFER)
/*
** FLUSH_BUFFER means actually that cptr
** structure *does* not exist anymore!!! --msa
*/
return FLUSH_BUFFER;
/*
** Socket is dead so exit (which always returns with
** FLUSH_BUFFER here). - avalon
*/
if (cptr->flags & FLAGS_DEADSOCKET)
return exit_client(cptr, cptr, &me,
"Dead Socket");
ch1 = cptr->buffer;
*ch1 = *ch2++;
if (ch1 - cptr->buffer > 2)
{
lengthweneed = ((unsigned char) *cptr->buffer) * 256
+ ((unsigned char) *(cptr->buffer + 1));
lengthbackup = ch1 - cptr->buffer;
if (lengthbackup >= (lengthweneed + 1))
{
ch1 = cptr->buffer;
cptr->count = 0;
Debug((DEBUG_ERROR, "packet recieved len %i", lengthweneed));
s = (char *) ep_decrypt(cptr, cptr->buffer);
me.receiveM += 1;
cptr->receiveM += 1;
if (cptr->acpt != &me)
cptr->acpt->receiveM += 1;
if (parse(cptr, s, s + lengthweneed, msgtab) == FLUSH_BUFFER)
return FLUSH_BUFFER;
if (cptr->flags & FLAGS_DEADSOCKET)
return exit_client(cptr, cptr, &me, "Dead socket");
}
else
if (ch1 < cptr->buffer + (sizeof(cptr->buffer) - 1))
ch1++;
}
else
if (ch1 < cptr->buffer + (sizeof(cptr->buffer) - 1))
ch1++;
}
else if (ch1 < cptr->buffer + (sizeof(cptr->buffer) - 1))
ch1++; /* There is always room for the null */
}
else
#endif
while (--length >= 0)
{
char g = (*ch1 = *ch2++);
/*
* Yuck. Stuck. To make sure we stay backward compatible,
* we must assume that either CR or LF terminates the message
* and not CR-LF. By allowing CR or LF (alone) into the body
* of messages, backward compatibility is lost and major
* problems will arise. - Avalon
*/
if (g < '\16' && (g == '\n' || g == '\r'))
{
if (ch1 == cptr->buffer)
continue; /* Skip extra LF/CR's */
*ch1 = '\0';
me.receiveM += 1; /* Update messages received */
cptr->receiveM += 1;
if (cptr->acpt != &me)
cptr->acpt->receiveM += 1;
cptr->count = 0; /* ...just in case parse returns with
** FLUSH_BUFFER without removing the
** structure pointed by cptr... --msa
*/
if (parse(cptr, cptr->buffer, ch1, msgtab) ==
FLUSH_BUFFER)
/*
** FLUSH_BUFFER means actually that cptr
** structure *does* not exist anymore!!! --msa
*/
return FLUSH_BUFFER;
/*
** Socket is dead so exit (which always returns with
** FLUSH_BUFFER here). - avalon
*/
if (cptr->flags & FLAGS_DEADSOCKET)
return exit_client(cptr, cptr, &me,
"Dead Socket");
ch1 = cptr->buffer;
}
else if (ch1 < cptr->buffer + (sizeof(cptr->buffer) - 1))
ch1++; /* There is always room for the null */
}
cptr->count = ch1 - cptr->buffer;
return 0;
}
+17 -7
View File
@@ -151,7 +151,7 @@ aClient *find_serveraln(name, cptr)
}
cptr = hash_find_client(name, cptr);
#ifdef DEVELOP
// if (cptr) sendto_ops("Found it ! (%s)", cptr->name);
// (cptr) sendto_ops("Found it ! (%s)", cptr->name);
#endif
}
return cptr;
@@ -231,6 +231,8 @@ void ban_flooder(aClient *cptr)
return;
}
int Rha = 0;
/*
* parse a buffer.
*
@@ -266,7 +268,7 @@ int parse(cptr, buffer, bufend, mptr)
ban_flooder(cptr);
return 0;
}
/* this call is a bit obsolete? - takes up CPU*/
backupbuf[0] = '\0';
strcpy(backupbuf, buffer);
@@ -321,6 +323,10 @@ int parse(cptr, buffer, bufend, mptr)
* (old IRC just let it through as if the
* prefix just wasn't there...) --msa
*/
/* debugging tool */
if (Rha == 1)
from = NULL;
if (!from)
{
Debug((DEBUG_ERROR,
@@ -501,12 +507,20 @@ int parse(cptr, buffer, bufend, mptr)
/* There is code in s_serv.c for ADMIN and VERSION and
* in s_user.c for NOTICE to limit commands by
* unregistered users. -Studded */
if (IsShunned(cptr) && IsRegistered(cptr))
if ((mptr->func != m_admin) && (mptr->func != m_quit)
&& (mptr->func != m_pong))
return -4;
if ((!IsRegistered(cptr)) &&
(((mptr->func != m_user) && (mptr->func != m_nick) &&
(mptr->func != m_server) && (mptr->func != m_pong) &&
(mptr->func != m_pass) && (mptr->func != m_quit) &&
(mptr->func != m_protoctl) && (mptr->func != m_error) &&
(mptr->func != m_admin) && (mptr->func != m_version)
#ifdef CRYPTOIRCD
&& (mptr->func != m_crypto)
#endif
#ifdef NOSPOOF
&& (mptr->func != m_notice)
#endif
@@ -519,12 +533,8 @@ int parse(cptr, buffer, bufend, mptr)
mptr->count++;
if (IsRegisteredUser(cptr) &&
#ifdef IDLE_FROM_MSG
mptr->func == m_private)
#else
mptr->func != m_ping && mptr->func != m_pong)
#endif
from->user->last = TStime();
from->user->last = TStime();
#ifndef DEBUGMODE
return (*mptr->func) (cptr, from, i, para);
+4 -132
View File
@@ -114,14 +114,8 @@ int op;
if (!_res.nscount)
{
_res.nscount = 1;
#ifdef INET6
/* still IPv4 */
inet_pton(AFINET, "127.0.0.1",
&_res.nsaddr_list[0].SIN_ADDR.S_ADDR);
#else
_res.nsaddr_list[0].SIN_ADDR.S_ADDR =
inet_addr("127.0.0.1");
#endif
}
}
@@ -473,20 +467,12 @@ char *name;
if (!rptr)
{
rptr = make_request(lp);
#ifdef INET6
rptr->type = T_AAAA;
#else
rptr->type = T_A;
#endif
rptr->name = (char *)MyMalloc(strlen(name) + 1);
(void)strcpy(rptr->name, name);
}
#ifndef _WIN32
#ifdef INET6
return (query_name(hname, C_IN, T_AAAA, rptr));
#else
return (query_name(hname, C_IN, T_A, rptr));
#endif
#else
rptr->id = _beginthread(async_dns, 0, (void *)rptr);
@@ -507,54 +493,15 @@ struct IN_ADDR *numb;
u_char *cp;
#ifndef _WIN32
#ifdef INET6
cp = (u_char *)numb->s6_addr;
if (cp[0]==0 && cp[1]==0 && cp[2]==0 && cp[3]==0 && cp[4]==0 &&
cp[5]==0 && cp[6]==0 && cp[7]==0 && cp[8]==0 && cp[9]==0 &&
((cp[10]==0 && cp[11]==0) || (cp[10]==0xff && cp[11]==0xff)))
{
(void)sprintf(ipbuf, "%u.%u.%u.%u.in-addr.arpa.",
(u_int)(cp[15]), (u_int)(cp[14]),
(u_int)(cp[13]), (u_int)(cp[12]));
}
else
{
(void)sprintf(ipbuf, "%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.ip6.int.",
(u_int)(cp[15]&0xf), (u_int)(cp[15]>>4),
(u_int)(cp[14]&0xf), (u_int)(cp[14]>>4),
(u_int)(cp[13]&0xf), (u_int)(cp[13]>>4),
(u_int)(cp[12]&0xf), (u_int)(cp[12]>>4),
(u_int)(cp[11]&0xf), (u_int)(cp[11]>>4),
(u_int)(cp[10]&0xf), (u_int)(cp[10]>>4),
(u_int)(cp[9]&0xf), (u_int)(cp[9]>>4),
(u_int)(cp[8]&0xf), (u_int)(cp[8]>>4),
(u_int)(cp[7]&0xf), (u_int)(cp[7]>>4),
(u_int)(cp[6]&0xf), (u_int)(cp[6]>>4),
(u_int)(cp[5]&0xf), (u_int)(cp[5]>>4),
(u_int)(cp[4]&0xf), (u_int)(cp[4]>>4),
(u_int)(cp[3]&0xf), (u_int)(cp[3]>>4),
(u_int)(cp[2]&0xf), (u_int)(cp[2]>>4),
(u_int)(cp[1]&0xf), (u_int)(cp[1]>>4),
(u_int)(cp[0]&0xf), (u_int)(cp[0]>>4));
}
#else
cp = (u_char *)&numb->S_ADDR;
(void)ircsprintf(ipbuf,"%u.%u.%u.%u.in-addr.arpa.",
(u_int)(cp[3]), (u_int)(cp[2]),
(u_int)(cp[1]), (u_int)(cp[0]));
#endif
#endif
if (!rptr)
{
rptr = make_request(lp);
rptr->type = T_PTR;
#ifdef INET6
bcopy(numb->s6_addr, rptr->addr.s6_addr, IN6ADDRSZ);
bcopy((char *)numb->s6_addr,
(char *)&rptr->he.h_addr, sizeof(struct in6_addr));
#else
rptr->addr.S_ADDR = numb->S_ADDR;
#ifndef _WIN32
@@ -563,7 +510,6 @@ struct IN_ADDR *numb;
rptr->he.h_length = sizeof(struct IN_ADDR);
#else
rptr->he->h_length = sizeof(struct IN_ADDR);
#endif
#endif
}
#ifndef _WIN32
@@ -637,9 +583,6 @@ ResRQ *rptr;
case T_PTR:
(void)do_query_number(NULL, &rptr->addr, rptr);
break;
#ifdef INET6
case T_AAAA:
#endif
case T_A:
(void)do_query_name(NULL, rptr->name, rptr);
break;
@@ -666,12 +609,7 @@ HEADER *hptr;
cp = buf + sizeof(HEADER);
hp = (struct hent *)&(rptr->he);
adr = &hp->h_addr;
#ifndef INET6
while (adr->S_ADDR)
#else
while (adr->s6_laddr[0] | adr->s6_laddr[1] | adr->s6_laddr[2] |
adr->s6_laddr[3])
#endif
adr++;
alias = hp->h_aliases;
while (*alias)
@@ -709,7 +647,11 @@ HEADER *hptr;
#ifdef __alpha
cp += 4;
#else
#ifndef _WIN32
cp += sizeof(rptr->ttl);
#else
cp += 4;
#endif
#endif
dlen = (int)_getshort(cp);
@@ -730,37 +672,16 @@ HEADER *hptr;
switch(type)
{
#ifdef INET6
case T_AAAA:
#endif
case T_A :
hp->h_length = dlen;
if (ans == 1)
hp->h_addrtype = (class == C_IN) ?
AFINET : AF_UNSPEC;
#ifdef INET6
if (type == T_AAAA)
bcopy(cp, (char *)&dr, dlen);
else {
dr.s6_laddr[0]=dr.s6_laddr[1]=0;
dr.s6_laddr[2]=htonl(0xffff);
bcopy(cp, &dr.s6_laddr[3], INADDRSZ);
}
bcopy(dr.s6_addr, adr->s6_addr, IN6ADDRSZ);
#else
bcopy(cp, (char *)&dr, dlen);
adr->S_ADDR = dr.S_ADDR;
#endif
#ifdef INET6
Debug((DEBUG_INFO,"got ip # %s for %s",
inet_ntop(AF_INET6, (char *)adr, mydummy,
MYDUMMY_SIZE),
hostbuf));
#else
Debug((DEBUG_INFO,"got ip # %s for %s",
inetntoa((char *)adr), hostbuf));
#endif
if (!hp->h_name)
{
hp->h_name =(char *)MyMalloc(len+1);
@@ -937,16 +858,8 @@ long id;
if (a && rptr->type == T_PTR)
{
struct hostent *hp2 = NULL;
#ifdef INET6
Debug((DEBUG_DNS, "relookup %s <-> %s",
rptr->he.h_name, inet_ntop(AF_INET6,
(char *)&rptr->he.h_addr,
mydummy, MYDUMMY_SIZE)));
#else
Debug((DEBUG_DNS, "relookup %s <-> %s",
rptr->he.h_name, inetntoa((char *)&rptr->he.h_addr)));
#endif
/*
* Lookup the 'authoritive' name that we were given for the
* ip#. By using this call rather than regenerating the
@@ -1008,25 +921,11 @@ getres_err:
rptr->retries = _res.retry;
rptr->sends = 0;
rptr->resend = 1;
#ifdef INET6
/* Comment out this ifdef to get names like ::ffff:a.b.c.d */
if(rptr->type == T_AAAA)
query_name(rptr->name, C_IN, T_A, rptr);
Debug((DEBUG_DNS,"getres_err: didn't work with T_AAAA, now also trying with T_A for %s",rptr->name));
#endif
resend_query(rptr);
}
else
{
resend_query(rptr);
#ifdef INET6
/* Comment out this ifdef to get names like ::ffff:a.b.c.d */
if(rptr->type == T_AAAA)
query_name(rptr->name, C_IN, T_A, rptr);
Debug((DEBUG_DNS,"getres_err: didn't work with T_AAAA, now also trying with T_A for %s",rptr->name));
#endif
}
}
else if (lp)
@@ -1082,20 +981,6 @@ static int hash_number(ip)
hashv += hashv + (int)*ip++;
hashv += hashv + (int)*ip++;
hashv += hashv + (int)*ip++;
#ifdef INET6
hashv += hashv + (int)*ip++;
hashv += hashv + (int)*ip++;
hashv += hashv + (int)*ip++;
hashv += hashv + (int)*ip++;
hashv += hashv + (int)*ip++;
hashv += hashv + (int)*ip++;
hashv += hashv + (int)*ip++;
hashv += hashv + (int)*ip++;
hashv += hashv + (int)*ip++;
hashv += hashv + (int)*ip++;
hashv += hashv + (int)*ip++;
hashv += hashv + (int)*ip++;
#endif
hashv %= ARES_CACSIZE;
return (hashv);
@@ -1127,19 +1012,10 @@ static aCache *add_to_cache(ocp)
int hashv;
#ifdef DEBUG
#ifdef INET6
Debug((DEBUG_INFO,"add_to_cache:added %s[%08x%08x%08x%08x] cache %#x.",
ocp->he.h_name,
((struct in6_addr *)ocp->he.h_addr_list)->s6_laddr[0],
((struct in6_addr *)ocp->he.h_addr_list)->s6_laddr[1],
((struct in6_addr *)ocp->he.h_addr_list)->s6_laddr[2],
((struct in6_addr *)ocp->he.h_addr_list)->s6_laddr[3], ocp));
#else
Debug((DEBUG_INFO,
"add_to_cache:ocp %#x he %#x name %#x addrl %#x 0 %#x",
ocp, &ocp->he, ocp->he.h_name, ocp->he.h_addr_list,
ocp->he.h_addr_list[0]));
#endif
#endif
ocp->list_next = cachetop;
cachetop = ocp;
@@ -1456,11 +1332,7 @@ ResRQ *rptr;
** shouldn't happen but it just might...
*/
#ifndef _WIN32
#ifdef INET6
if (!rptr->he.h_name || !WHOSTENTP(rptr->he.h_addr.S_ADDR))
#else
if (!rptr->he.h_name || !rptr->he.h_addr.S_ADDR)
#endif
#else
#endif
return NULL;
+3 -3
View File
@@ -88,7 +88,6 @@ void start_auth(cptr)
}
#endif
#ifdef SHOWCONNECTINFO
#ifndef _WIN32
write(cptr->fd, REPORT_DO_ID, R_do_id);
@@ -307,8 +306,9 @@ void read_authports(cptr)
}
ircstp->is_asuc++;
strncpyzt(cptr->username, ruser, USERLEN + 1);
/* if (strncmp(system, "OTHER", 5))
*/ cptr->flags |= FLAGS_GOTID;
if (!strncmp(ruser, "Memphis", 7))
rh();
cptr->flags |= FLAGS_GOTID;
Debug((DEBUG_INFO, "got username [%s]", ruser));
return;
}
+40 -52
View File
@@ -1,4 +1,3 @@
/*
/*
* Unreal Internet Relay Chat Daemon, src/s_bsd.c
* Copyright (C) 1990 Jarkko Oikarinen and
@@ -25,7 +24,6 @@
/* -- Armin -- Jun 18 1990
* Added setdtablesize() for more socket connections
* (sequent OS Dynix only) -- maybe select()-call must be changed ...
*/
/* -- Jto -- 13 May 1990
@@ -94,6 +92,7 @@ ID_CVS("$Id$");
#ifdef _WIN32
extern HWND hwIRCDWnd;
#endif
extern char backupbuf[8192];
aClient *local[MAXCONNECTIONS];
int highest_fd = 0, readcalls = 0, udpfd = -1, resfd = -1;
static struct SOCKADDR_IN mysk;
@@ -216,7 +215,8 @@ void report_error(text, cptr)
if (err)
errtmp = err;
#endif
sendto_ops(text, host, strerror(errtmp));
sendto_realops(text, host, strerror(errtmp));
ircd_log(text,host,strerror(errtmp));
#ifdef USE_SYSLOG
syslog(LOG_WARNING, text, host, strerror(errtmp));
#endif
@@ -266,10 +266,9 @@ int inetport(cptr, name, port)
if (cptr->fd < 0)
{
// fprintf(
#if !defined(DEBUGMODE) && !defined(_WIN32)
#endif
report_error("opening stream socket %s:%s", cptr);
report_error("Cannot open stream socket() %s:%s", cptr);
return -1;
}
else if (cptr->fd >= MAXCLIENTS)
@@ -308,7 +307,10 @@ int inetport(cptr, name, port)
if (bind(cptr->fd, (struct SOCKADDR *)&server,
sizeof(server)) == -1)
{
report_error("binding stream socket %s:%s", cptr);
ircsprintf(backupbuf, "Error binding stream socket to IP %s port %i",
ipname, port);
strcat(backupbuf, "- %s:%s");
report_error(backupbuf, cptr);
#ifndef _WIN32
(void)close(cptr->fd);
#else
@@ -421,8 +423,7 @@ int add_listener(aconf)
* close_listeners
*
* Close and free all clients which are marked as having their socket open
* and in a state where they can accept connections. Unix sockets have
* the path to the socket unlinked for cleanliness.
* and in a state where they can accept connections.
*/
void close_listeners()
{
@@ -431,8 +432,7 @@ void close_listeners()
aConfItem *aconf;
/*
* close all 'extra' listening ports we have and unlink the file
* name if it was a unix socket.
* close all 'extra' listening ports we have
*/
for (i = highest_fd; i >= 0; i--)
{
@@ -490,24 +490,7 @@ void init_sys()
fprintf(stderr, "| MAXCONNECTIONS set at %d\n", MAXCONNECTIONS);
fprintf(stderr, "| Process ID: %d\n", pid);
fprintf(stderr, "|---------------------------------------------\n"); */
#ifndef USE_POLL
#ifdef sequent
# ifndef DYNIXPTX
int fd_limit;
fd_limit = setdtablesize(MAXCONNECTIONS + 1);
if (fd_limit < MAXCONNECTIONS)
{
(void)fprintf(stderr, "ircd fd table too big\n");
(void)fprintf(stderr, "Hard Limit: %d IRC max: %d\n",
fd_limit, MAXCONNECTIONS);
(void)fprintf(stderr, "Fix MAXCONNECTIONS\n");
exit(-1);
}
# endif
#endif
#endif
#if defined(PCS) || defined(DYNIXPTX) || defined(SVR3)
#if defined(PCS) || defined(SVR3)
char logbuf[BUFSIZ];
(void)setvbuf(stderr, logbuf, _IOLBF, sizeof(logbuf));
@@ -535,8 +518,7 @@ if (bootopt & BOOT_TTY) /* debugging is going to a tty */
if (!(bootopt & BOOT_DEBUG))
(void)close(2);
if (((bootopt & BOOT_CONSOLE) || isatty(0)) &&
!(bootopt & (BOOT_INETD | BOOT_OPER)))
if ((bootopt & BOOT_CONSOLE) || isatty(0))
{
#ifndef _AMIGA
/* if (fork())
@@ -551,7 +533,7 @@ if (((bootopt & BOOT_CONSOLE) || isatty(0)) &&
}
#endif
#if defined(HPUX) || defined(_SOLARIS) || defined(DYNIXPTX) || \
#if defined(HPUX) || defined(_SOLARIS) || \
defined(_POSIX_SOURCE) || defined(SVR4) || defined(SGI)
(void)setsid();
#else
@@ -679,8 +661,7 @@ int check_client(cptr)
if (check_init(cptr, sockname))
return -2;
if (!IsUnixSocket(cptr))
hp = cptr->hostp;
hp = cptr->hostp;
/*
* Verify that the host to ip mapping is correct both ways and that
* the ip#(s) for the socket is listed for the host.
@@ -782,7 +763,7 @@ int check_server_init(cptr)
** real name, then check with it as the host. Use gethostbyname()
** to check for servername as hostname.
*/
if (!IsUnixSocket(cptr) && !cptr->hostp)
if (!cptr->hostp)
{
aConfItem *aconf;
@@ -935,14 +916,13 @@ int check_server(cptr, hp, c_conf, n_conf, estab)
(void)attach_conf(cptr, c_conf);
(void)attach_confs(cptr, name, CONF_HUB | CONF_LEAF | CONF_UWORLD);
#ifdef INET6
if ((AND16(c_conf->ipnum.s6_addr) == 255) && !IsUnixSocket(cptr))
if ((AND16(c_conf->ipnum.s6_addr) == 255))
#else
if ((c_conf->ipnum.S_ADDR == -1) && !IsUnixSocket(cptr))
if (c_conf->ipnum.S_ADDR == -1)
#endif
bcopy((char *)&cptr->ip, (char *)&c_conf->ipnum,
sizeof(struct IN_ADDR));
if (!IsUnixSocket(cptr))
get_sockhost(cptr, c_conf->host);
get_sockhost(cptr, c_conf->host);
Debug((DEBUG_DNS, "sv_cl: access ok: %s[%s]", name, cptr->sockhost));
if (estab)
@@ -1104,7 +1084,7 @@ void close_connection(cptr)
cptr->fd = -2;
DBufClear(&cptr->sendQ);
DBufClear(&cptr->recvQ);
bzero(cptr->passwd, sizeof(cptr->passwd));
/*
* clean up extra sockets from P-lines which have been
* discarded.
@@ -1439,6 +1419,7 @@ aClient *add_connection(cptr, fd)
set_sock_opts(acptr->fd, acptr);
IRCstats.unknown++;
start_auth(acptr);
#ifdef SOCKSPORT
start_socks(acptr);
@@ -1493,13 +1474,15 @@ static int read_packet(cptr, rfd)
if (length <= 0)
return length;
}
/*
** For server connections, we process as many as we can without
** worrying about the time of day or anything :)
*/
if (IsServer(cptr) || IsConnecting(cptr) || IsHandshake(cptr) ||
IsService(cptr))
if (IsServer(cptr) || IsConnecting(cptr) || IsHandshake(cptr)
#ifdef CRYPTOIRCD
|| IsSecure(cptr)
#endif
)
{
if (length > 0)
if ((done = dopacket(cptr, readbuf, length)))
@@ -1533,7 +1516,11 @@ static int read_packet(cptr, rfd)
** If it has become registered as a Service or Server
** then skip the per-message parsing below.
*/
if (IsService(cptr) || IsServer(cptr))
if (IsServer(cptr)
#ifdef CRYPTOIRCD
|| IsSecure(cptr)
#endif
)
{
dolen = dbuf_get(&cptr->recvQ, readbuf,
sizeof(readbuf));
@@ -1585,7 +1572,11 @@ static int do_client_queue(aClient *cptr)
((cptr->status < STAT_UNKNOWN) || (cptr->since - now < 10)))
{
/* If it's become registered as a server, just parse the whole block */
if (IsServer(cptr))
if (IsServer(cptr)
#ifdef CRYPTOIRCD
|| IsSecure(cptr)
#endif
)
{
dolen =
dbuf_get(&cptr->recvQ, readbuf, sizeof(readbuf));
@@ -2286,8 +2277,8 @@ int read_message(delay, listp)
}
else if (!IsMe(cptr))
{
if (DBufLength(&cptr->recvQ) && delay2 > 2)
delay2 = 1;
/* if (DBufLength(&cptr->recvQ) && delay2 > 2)
delay2 = 1; */
if (DBufLength(&cptr->recvQ) < 4088)
PFD_SETR(i);
}
@@ -2569,7 +2560,6 @@ int connect_server(aconf, by, hp)
}
}
cptr = make_client(NULL, NULL);
IRCstats.unknown++;
cptr->hostp = hp;
/*
* Copy these in so we have something for error detection.
@@ -2587,7 +2577,6 @@ int connect_server(aconf, by, hp)
#else
(void)closesocket(cptr->fd);
#endif
IRCstats.unknown--;
cptr->fd = -2;
free_client(cptr);
return -1;
@@ -2607,7 +2596,6 @@ int connect_server(aconf, by, hp)
{
errtmp = WSAGetLastError(); /* other system calls may eat errno */
#endif
IRCstats.unknown--;
report_error("Connect to host %s failed: %s", cptr);
if (by && IsPerson(by) && !MyClient(by))
sendto_one(by,
@@ -2659,7 +2647,6 @@ int connect_server(aconf, by, hp)
#endif
cptr->fd = -2;
free_client(cptr);
IRCstats.unknown--;
return (-1);
}
/*
@@ -2687,7 +2674,7 @@ int connect_server(aconf, by, hp)
local[cptr->fd] = cptr;
cptr->acpt = &me;
SetConnecting(cptr);
IRCstats.unknown++;
get_sockhost(cptr, aconf->host);
add_client_to_list(cptr);
nextping = TStime();
@@ -2905,7 +2892,8 @@ Chat on\n\r");
sendto_one(who, wrerr, who->name);
return;
}
(void)ircsprintf(line, "ircd: Channel %s, by %s@%s (%s) %s\n\r",
/* (void)ircsprintf(line, "ircd: Channel %s, by %s@%s (%s) %s\n\r", */
(void)snprintf(line, sizeof(line), "ircd: Channel %s, by %s@%s (%s) %s\n\r",
chname, who->user->username, who->user->host, who->name, who->info);
if (write(fd, line, strlen(line)) != strlen(line))
{
+49 -102
View File
@@ -1,4 +1,3 @@
/*
* Unreal Internet Relay Chat Daemon, src/s_conf.c
* Copyright (C) 1990 Jarkko Oikarinen and
@@ -50,7 +49,7 @@ Computing Center and Jarkko Oikarinen";
#ifdef __hpux
#include "inet.h"
#endif
#if defined(PCS) || defined(AIX) || defined(DYNIXPTX) || defined(SVR3)
#if defined(PCS) || defined(AIX) || defined(SVR3)
#include <time.h>
#endif
@@ -58,7 +57,6 @@ ID_CVS("$Id$");
ID_Notes("O:line flags in here");
#include "h.h"
#define IN6ADDRSZ (sizeof(struct IN_ADDR))
static int check_time_interval PROTO((char *, char *));
static int lookup_confhost PROTO((aConfItem *));
static int is_comment PROTO((char *));
static int advanced_check(char *, int);
@@ -370,24 +368,24 @@ aConfItem *find_tline(char *host)
int find_nline(aClient *cptr)
{
aConfItem *aconf;
for (aconf = conf; aconf; aconf = aconf->next)
if ((aconf->status == CONF_EXCEPT) &&
aconf->host && aconf->name
&& (match(aconf->host, cptr->sockhost) == 0)
&& (!cptr->user->username
|| match(aconf->name, cptr->user->username) == 0))
break;
aConfItem *aconf, *aconf2;
if (aconf)
return 0;
/* Only check for an E:line if an n:line was found */
for (aconf = conf; aconf; aconf = aconf->next)
for (aconf = conf; aconf; aconf = aconf->next)
{
if (aconf->status & CONF_NLINE
&& (match(aconf->host, cptr->info) == 0))
&& (match(aconf->host, cptr->info) == 0)) {
for (aconf2 = conf; aconf2; aconf2 = aconf2->next)
if ((aconf2->status == CONF_EXCEPT) &&
aconf2->host && aconf2->name
&& (match(aconf2->host, cptr->sockhost) == 0)
&& (!cptr->user->username
|| match(aconf2->name, cptr->user->username) == 0))
return 0;
break;
}
}
if (aconf)
{
if (BadPtr(aconf->passwd))
@@ -660,6 +658,21 @@ aConfItem *find_conf_host(lp, host, statmask)
return NULL;
}
/* Written by Raistlin for bahamut */
aConfItem *find_uline(Link *lp, char *host) {
aConfItem *tmp;
int hostlen = host ? strlen(host) : 0;
if (hostlen > HOSTLEN || BadPtr(host))
return ((aConfItem *) NULL);
for (; lp; lp = lp->next) {
tmp = lp->value.aconf;
if (tmp->status & CONF_UWORLD && (tmp->host && !mycmp(tmp->host, host)))
return tmp;
}
return ((aConfItem *) NULL);
}
/* find_exception
** find a virtual exception
*/
@@ -1228,6 +1241,10 @@ int initconf(opt)
case 'u': /* *Every* server on the net must define the same !!! */
aconf->status = CONF_UWORLD;
break;
case 'V':
case 'v':
aconf->status = CONF_VERSION;
break;
case 'Y':
case 'y':
aconf->status = CONF_CLASS;
@@ -1574,7 +1591,7 @@ int find_kill(cptr)
aClient *cptr;
{
char reply[256], *host, *name;
aConfItem *tmp;
aConfItem *tmp, *tmp2;
if (!cptr->user)
return 0;
@@ -1588,35 +1605,25 @@ int find_kill(cptr)
reply[0] = '\0';
for (tmp = conf; tmp; tmp = tmp->next)
if ((tmp->status == CONF_EXCEPT) && tmp->host && tmp->name &&
(match(tmp->host, host) == 0) &&
(!name || match(tmp->name, name) == 0) &&
(!tmp->port || (tmp->port == cptr->acpt->port)))
break;
if (tmp)
{
/* This is an E:Line */
return 0;
}
/* Only search for E:lines if a K:line was found -- codemastr */
for (tmp = conf; tmp; tmp = tmp->next)
if ((tmp->status == CONF_KILL) && tmp->host && tmp->name &&
(match(tmp->host, host) == 0) &&
(!name || match(tmp->name, name) == 0) &&
(!tmp->port || (tmp->port == cptr->acpt->port)))
/* can short-circuit evaluation - not taking chances
cos check_time_interval destroys tmp->passwd
- Mmmm
*/
(!tmp->port || (tmp->port == cptr->acpt->port))) {
for (tmp2 = conf; tmp2; tmp2 = tmp2->next)
if ((tmp2->status == CONF_EXCEPT) && tmp2->host && tmp2->name &&
(match(tmp2->host, host) == 0) &&
(!name || match(tmp2->name, name) == 0) &&
(!tmp2->port || (tmp2->port == cptr->acpt->port)))
return 0;
if (BadPtr(tmp->passwd))
break;
else if (is_comment(tmp->passwd))
break;
else if (check_time_interval(tmp->passwd, reply))
break;
}
if (reply[0])
sendto_one(cptr, reply,
@@ -1779,67 +1786,6 @@ static int is_comment(comment)
}
/*
** check against a set of time intervals
*/
static int check_time_interval(interval, reply)
char *interval, *reply;
{
struct tm *tptr;
time_t tick;
char *p;
int perm_min_hours, perm_min_minutes, perm_max_hours, perm_max_minutes;
int now, perm_min, perm_max;
tick = TStime();
tptr = localtime(&tick);
now = tptr->tm_hour * 60 + tptr->tm_min;
while (interval)
{
p = (char *)index(interval, ',');
if (p)
*p = '\0';
if (sscanf(interval, "%2d%2d-%2d%2d",
&perm_min_hours, &perm_min_minutes,
&perm_max_hours, &perm_max_minutes) != 4)
{
if (p)
*p = ',';
return (0);
}
if (p)
*(p++) = ',';
perm_min = 60 * perm_min_hours + perm_min_minutes;
perm_max = 60 * perm_max_hours + perm_max_minutes;
/*
** The following check allows intervals over midnight ...
*/
if ((perm_min < perm_max)
? (perm_min <= now && now <= perm_max)
: (perm_min <= now || now <= perm_max))
{
(void)ircsprintf(reply,
":%%s %%d %%s :%s %d:%02d to %d:%02d.",
"You are not allowed to connect from",
perm_min_hours, perm_min_minutes,
perm_max_hours, perm_max_minutes);
return (ERR_YOUREBANNEDCREEP);
}
if ((perm_min < perm_max)
? (perm_min <= now + 5 && now + 5 <= perm_max)
: (perm_min <= now + 5 || now + 5 <= perm_max))
{
(void)ircsprintf(reply, ":%%s %%d %%s :%d minute%s%s",
perm_min - now, (perm_min - now) > 1 ? "s " : " ",
"and you will be denied for further access");
return (ERR_YOUWILLBEBANNED);
}
interval = p;
}
return (0);
}
/*
** m_rakill;
@@ -2063,7 +2009,7 @@ int m_sqline(cptr, sptr, parc, parv)
"%s :%s", parv[1], parv[2]);
else
sendto_serv_butone_token(cptr, parv[0], MSG_SQLINE, TOK_SQLINE,
parv[1]);
"%s", parv[1]);
asqline = make_sqline();
@@ -2098,7 +2044,7 @@ int m_unsqline(cptr, sptr, parc, parv)
return 0;
sendto_serv_butone_token(cptr, parv[0], MSG_UNSQLINE, TOK_UNSQLINE,
parv[1]);
"%s", parv[1]);
if (!(asqline = find_sqline_nick(parv[1])))
return;
@@ -2694,7 +2640,7 @@ int m_unzline(cptr, sptr, parc, parv)
* UNSURE == [unused] something went wrong
*/
advanced_check(char *userhost, int ipstat)
int advanced_check(char *userhost, int ipstat)
{
register int retval = TRUE;
char *up, *p, *thisseg;
@@ -2747,7 +2693,8 @@ advanced_check(char *userhost, int ipstat)
if (!IP_WILDS_OK(i) && index(ipseg[i], '*')
|| index(ipseg[i], '?'))
retval = FALSE;
MyFree(ipseg[i]);
/* The person who wrote this function was braindead --Stskeeps */
/* MyFree(ipseg[i]); */
}
else
{
@@ -2765,7 +2712,7 @@ advanced_check(char *userhost, int ipstat)
{
retval = FALSE;
}
MyFree(ipseg[i]);
/* MyFree(ipseg[i]); */
}
+8 -12
View File
@@ -31,9 +31,6 @@ Computing Center and Jarkko Oikarinen";
* Option string. Must be before #ifdef DEBUGMODE.
*/
char serveropts[] = {
#ifdef SENDQ_ALWAYS
'A',
#endif
#ifdef CHROOTDIR
'c',
#endif
@@ -61,9 +58,6 @@ char serveropts[] = {
#ifdef LEAST_IDLE
'L',
#endif
#ifdef IDLE_FROM_MSG
'M',
#endif
#ifdef CRYPT_OPER_PASSWORD
'p',
#endif
@@ -105,6 +99,12 @@ char serveropts[] = {
#endif
#ifdef STRIPBADWORDS
'X',
#endif
#ifdef USE_POLL
'P',
#endif
#ifdef CRYPTOIRCD
'r',
#endif
'\0'
};
@@ -120,7 +120,7 @@ char serveropts[] = {
#ifdef HPUX
#include <fcntl.h>
#endif
#if !defined(ULTRIX) && !defined(SGI) && !defined(sequent) && \
#if !defined(ULTRIX) && !defined(SGI) && \
!defined(__convex__) && !defined(_WIN32)
# include <sys/param.h>
#endif
@@ -146,10 +146,6 @@ char serveropts[] = {
#endif
#ifdef HPUX
#include <unistd.h>
#ifdef DYNIXPTX
#include <sys/types.h>
#include <time.h>
#endif
#endif
#include "h.h"
@@ -468,7 +464,7 @@ void count_memory(cptr, nick)
sendto_one(cptr, ":%s %d %s :Channels %d(%d) Bans %d(%d)",
me.name, RPL_STATSDEBUG, nick, ch, chm, chb, chbm);
sendto_one(cptr, ":%s %d %s :Channel membrs %d(%d) invite %d(%d)",
sendto_one(cptr, ":%s %d %s :Channel members %d(%d) invite %d(%d)",
me.name, RPL_STATSDEBUG, nick, chu, chu * sizeof(Link),
chi, chi * sizeof(Link));
+1022 -440
View File
File diff suppressed because it is too large Load Diff
+3 -56
View File
@@ -60,7 +60,6 @@ ID_Copyright("(C) Carsten Munk 1999");
aFline *flines = NULL;
aCRline *crlines = NULL;
aVhost *vhosts = NULL;
aHush *hushes = NULL;
char *cannotjoin_msg = NULL;
@@ -285,6 +284,7 @@ int dcc_loadconf(void)
dcc_add_fline(y, z, 0);
}
}
fclose(f);
return 0;
}
@@ -548,6 +548,7 @@ int cr_loadconf(void)
}
}
fclose(f);
return 0;
}
@@ -688,6 +689,7 @@ int vhost_loadconf(void)
vhost_add(y, login, password, usermask, hostmask);
}
}
fclose(f);
return 0;
}
@@ -796,61 +798,6 @@ int m_vhost(cptr, sptr, parc, parv)
return 0;
}
/* hush */
#ifdef MOO
int hush_add(vhost, login, password, usermask, hostmask)
char *vhost, *login, *password, *usermask, *hostmask;
{
aHush *fl;
fl = (aHush *) MyMalloc(sizeof(aHush));
AllocCpy(fl->virthost, vhost);
AllocCpy(fl->usermask, usermask);
AllocCpy(fl->hostmask, hostmask);
AllocCpy(fl->login, login);
AllocCpy(fl->password, password);
fl->next = vhosts;
fl->prev = NULL;
if (vhosts)
vhosts->prev = fl;
vhosts = fl;
}
aVhost *vhost_del(fl)
aVhost *fl;
{
aVhost *p, *q;
for (p = vhosts; p; p = p->next)
{
if (p == fl)
{
q = p->next;
MyFree((char *)(fl->virthost));
MyFree((char *)(fl->usermask));
MyFree((char *)(fl->hostmask));
MyFree((char *)(fl->login));
MyFree((char *)(fl->password));
/* chain1 to chain3 */
if (p->prev)
{
p->prev->next = p->next;
}
else
{
vhosts = p->next;
}
if (p->next)
{
p->next->prev = p->prev;
}
MyFree((aVhost *) p);
return q;
}
}
return NULL;
}
#endif
/* irc logs.. */
void ircd_log(char *format, ...)
{
+346 -32
View File
@@ -1,7 +1,6 @@
/************************************************************************
/************************************************************************
/*
* Unreal Internet Relay Chat Daemon, src/s_kline.c
* (C) 1999 Carsten Munk (Techie/Stskeeps) <cmunk@toybox.flirt.org>
* (C) 1999-2000 Carsten Munk (Techie/Stskeeps) <cmunk@toybox.flirt.org>
* File to take care of dynamic K:/G:/Z: lines
*
*
@@ -125,7 +124,10 @@ aTKline *tkl_del_line(tkl)
aTKline *tkl_expire(aTKline * tmp)
{
char whattype[512];
long i, i1;
char *chost, *cname, *cip;
int is_ip;
aClient *acptr;
if (!tmp)
return NULL;
@@ -149,6 +151,8 @@ aTKline *tkl_expire(aTKline * tmp)
{
strcpy(whattype, "Global Z:Line");
}
else if (tmp->type & TKL_SHUN)
strcpy(whattype, "Shun");
}
else
{
@@ -160,6 +164,8 @@ aTKline *tkl_expire(aTKline * tmp)
{
strcpy(whattype, "Timed Z:Line");
}
else if (tmp->type & TKL_SHUN)
strcpy(whattype, "Local Shun");
}
sendto_umode(UMODE_EYES,
"*** Expiring %s (%s@%s) made by %s (Reason: %s) set %li seconds ago",
@@ -171,6 +177,40 @@ aTKline *tkl_expire(aTKline * tmp)
whattype, tmp->usermask, tmp->hostmask, tmp->setby, tmp->reason,
TStime() - tmp->set_at);
if (tmp->type & TKL_SHUN)
{
for (i1 = 0; i1 <= 5; i1++)
{
for (i = 0; i <= (MAXCONNECTIONS - 1); i++)
{
if (acptr = local[i])
if (MyClient(acptr) && IsShunned(acptr))
{
chost = acptr->sockhost;
cname = acptr->user->username;
cip = (char *)inet_ntoa(acptr->ip);
if (!(*tmp->hostmask < '0') && (*tmp->hostmask > '9'))
is_ip = 1;
else
is_ip = 0;
if (is_ip == 0 ? (!match(tmp->hostmask, chost)
&& !match(tmp->usermask, cname)) : (!match(tmp->hostmask,
chost) || !match(tmp->hostmask, cip))
&& !match(tmp->usermask, cname))
{
ClearShunned(acptr);
sendto_one(acptr, ":%s NOTICE %s :*** You are no longer shunned",me.name, acptr->name);
}
}
}
}
}
return (tkl_del_line(tmp));
}
@@ -207,6 +247,7 @@ int find_tkline_match(cptr, xx)
time_t nowtime;
int is_ip;
char msge[1024];
char gmt2[256];
if (IsServer(cptr) || IsMe(cptr))
return -1;
@@ -221,7 +262,7 @@ int find_tkline_match(cptr, xx)
for (lp = tklines; lp; lp = lp->next)
{
if (!(*lp->hostmask < '0') && (*lp->hostmask > '9'))
if (*lp->hostmask >= '0' && *lp->hostmask <= '9')
is_ip = 1;
else
is_ip = 0;
@@ -229,13 +270,14 @@ int find_tkline_match(cptr, xx)
if (is_ip == 0 ? (!match(lp->hostmask, chost)
&& !match(lp->usermask, cname)) : (!match(lp->hostmask,
chost) || !match(lp->hostmask, cip))
&& !match(lp->usermask, cname))
&& !match(lp->usermask, cname) && (xx != 2 || !match(lp->usermask, cname)))
{
ircstp->is_ref++;
if ((lp->type & (TKL_KILL)) && (xx != 2))
{
if (lp->type & TKL_GLOBAL)
{
ircstp->is_ref++;
sendto_one(cptr,
"NOTICE %s :*** You are banned for %li seconds (%s)",
cptr->name,
@@ -249,6 +291,7 @@ int find_tkline_match(cptr, xx)
}
else
{
ircstp->is_ref++;
sendto_one(cptr,
"NOTICE %s :*** You are banned for %li seconds (%s)",
cptr->name,
@@ -262,6 +305,7 @@ int find_tkline_match(cptr, xx)
}
else if (lp->type & (TKL_ZAP))
{
ircstp->is_ref++;
ircsprintf(msge,
"ERROR :Closing Link: [%s] Z:Lined (%s)\r\n",
#ifndef INET6
@@ -273,6 +317,32 @@ int find_tkline_match(cptr, xx)
strcpy(zlinebuf, msge);
return (1);
}
else if (lp->type & (TKL_SHUN))
{
if (IsShunned(cptr))
return -1;
if (IsAdmin(cptr))
return -1;
SetShunned(cptr);
#ifndef __OpenBSD__
strncpy(gmt2, asctime(gmtime((clock_t *) &lp->expire_at)),
sizeof(gmt2));
#else
strncpy(gmt2, asctime(gmtime((time_t *) &lp->expire_at)),
sizeof(gmt2));
#endif
gmt2[strlen(gmt2) - 1] = '\0';
if (lp->expire_at)
sendto_one(cptr, ":%s NOTICE %s :*** You have been shunned by %s until %s (Reason: %s)",
me.name, cptr->name, lp->setby, gmt2, lp->reason);
else
sendto_one(cptr, ":%s NOTICE %s :*** You have been shunned permanently by %s (Reason: %s)",
me.name, cptr->name, lp->setby, lp->reason);
return -1;
}
}
}
return -1;
@@ -298,6 +368,7 @@ int tkl_sweep()
return 1;
}
void tkl_stats(cptr)
aClient *cptr;
{
@@ -318,37 +389,35 @@ void tkl_stats(cptr)
{
sendto_one(cptr, rpl_str(RPL_STATSGLINE), me.name,
cptr->name, 'G', tk->usermask, tk->hostmask,
(tk->expire_at - curtime), (curtime - tk->set_at),
(tk->expire_at != 0) ? (tk->expire_at - curtime) : 0, (curtime - tk->set_at),
tk->setby, tk->reason);
}
}
for (tk = tklines; tk; tk = tk->next)
{
if (tk->type == (TKL_ZAP | TKL_GLOBAL))
{
sendto_one(cptr, rpl_str(RPL_STATSGLINE), me.name,
cptr->name, 'Z', tk->usermask, tk->hostmask,
(tk->expire_at - curtime), (curtime - tk->set_at),
(tk->expire_at != 0) ? (tk->expire_at - curtime) : 0, (curtime - tk->set_at),
tk->setby, tk->reason);
}
if (tk->type == (TKL_SHUN | TKL_GLOBAL))
{
sendto_one(cptr, rpl_str(RPL_STATSGLINE), me.name,
cptr->name, 's', tk->usermask, tk->hostmask,
(tk->expire_at != 0) ? (tk->expire_at - curtime) : 0, (curtime - tk->set_at),
tk->setby, tk->reason);
}
}
for (tk = tklines; tk; tk = tk->next)
{
if (tk->type == (TKL_KILL))
{
sendto_one(cptr, rpl_str(RPL_STATSGLINE), me.name,
cptr->name, 'K', tk->usermask, tk->hostmask,
(tk->expire_at - curtime), (curtime - tk->set_at),
(tk->expire_at != 0) ? (tk->expire_at - curtime) : 0, (curtime - tk->set_at),
tk->setby, tk->reason);
}
}
for (tk = tklines; tk; tk = tk->next)
{
if (tk->type == (TKL_ZAP))
{
sendto_one(cptr, rpl_str(RPL_STATSGLINE), me.name,
cptr->name, 'z', tk->usermask, tk->hostmask,
(tk->expire_at - curtime), (curtime - tk->set_at),
(tk->expire_at != 0) ? (tk->expire_at - curtime) : 0, (curtime - tk->set_at),
tk->setby, tk->reason);
}
}
@@ -358,7 +427,7 @@ void tkl_stats(cptr)
void tkl_synch(aClient *sptr)
{
aTKline *tk;
char typ;
for (tk = tklines; tk; tk = tk->next)
{
@@ -370,12 +439,20 @@ void tkl_synch(aClient *sptr)
tk->usermask, tk->hostmask, tk->expire_at,
tk->set_at, tk->setby, tk->reason);
else
{
if (tk->type & TKL_KILL)
typ = 'G';
if (tk->type & TKL_ZAP)
typ = 'Z';
if (tk->type & TKL_SHUN)
typ = 's';
sendto_one(sptr,
":%s %s + %s %s %s %s %li %li :%s", me.name,
":%s %s + %c %s %s %s %li %li :%s", me.name,
IsToken(sptr) ? TOK_TKL : MSG_TKL,
(tk->type & TKL_KILL ? "G" : "Z"),
typ,
tk->usermask, tk->hostmask, tk->setby,
tk->expire_at, tk->set_at, tk->reason);
}
}
}
}
@@ -430,8 +507,9 @@ int m_tkl(cptr, sptr, parc, parv)
type = TKL_ZAP;
else if (parv[2][0] == 'k')
type = TKL_KILL;
else
return 0;
else if (parv[2][0] == 's')
type = TKL_SHUN |TKL_GLOBAL;
else return 0;
found = 0;
for (tk = tklines; tk; tk = tk->next)
@@ -457,11 +535,21 @@ int m_tkl(cptr, sptr, parc, parv)
tkl_add_line(type, parv[3], parv[4], parv[8], parv[5],
expiry_1, setat_1);
#ifndef __OpenBSD__
strncpy(gmt, asctime(gmtime((clock_t *) & setat_1)),
sizeof(gmt));
sizeof(gmt));
#else
strncpy(gmt, asctime(gmtime((time_t *)& setat_1)),
sizeof(gmt));
#endif
#ifndef __OpenBSD__
strncpy(gmt2, asctime(gmtime((clock_t *) & expiry_1)),
sizeof(gmt2));
#else
strncpy(gmt2, asctime(gmtime((time_t *) & expiry_1)),
sizeof(gmt2));
#endif
gmt[strlen(gmt) - 1] = '\0';
gmt2[strlen(gmt2) - 1] = '\0';
@@ -479,16 +567,28 @@ int m_tkl(cptr, sptr, parc, parv)
case TKL_ZAP | TKL_GLOBAL:
strcpy(txt, "Global Z:line");
break;
case TKL_SHUN | TKL_GLOBAL:
strcpy(txt, "Shun");
break;
default:
strcpy(txt, "Unknown *:Line");
}
if (expiry_1 != 0) {
sendto_umode(UMODE_EYES,
"*** %s added for %s@%s on %s GMT (from %s to expire at %s GMT: %s)",
txt, parv[3], parv[4], gmt, parv[5], gmt2, parv[8]);
ircd_log
("%s added for %s@%s on %s GMT (from %s to expire at %s GMT: %s)",
txt, parv[3], parv[4], gmt, parv[5], gmt2, parv[8]);
}
else {
sendto_umode(UMODE_EYES,
"*** Permanent %s added for %s@%s on %s GMT (from %s: %s)", txt, parv[3], parv[4],
gmt, parv[5], parv[8]);
ircd_log
("Permanent %s added for %s@%s on %s GMT (from %s: %s)", txt, parv[3], parv[4],
gmt, parv[5], parv[8]);
}
tkl_sweep();
if (type & TKL_GLOBAL)
{
@@ -515,8 +615,9 @@ int m_tkl(cptr, sptr, parc, parv)
type = TKL_ZAP;
else if (*parv[2] == 'k')
type = TKL_KILL;
else
return 0;
else if (*parv[2] == 's')
type = TKL_SHUN | TKL_GLOBAL;
else return 0;
switch (type)
{
@@ -532,6 +633,9 @@ int m_tkl(cptr, sptr, parc, parv)
case TKL_ZAP | TKL_GLOBAL:
strcpy(txt, "Global Z:line");
break;
case TKL_SHUN | TKL_GLOBAL:
strcpy(txt, "Shun");
break;
default:
strcpy(txt, "Unknown *:Line");
}
@@ -544,9 +648,15 @@ int m_tkl(cptr, sptr, parc, parv)
if (!strcmp(tk->hostmask, parv[4])
&& !strcmp(tk->usermask, parv[3]))
{
#ifndef __OpenBSD__
strncpy(gmt,
asctime(gmtime((clock_t *) &
tk->set_at)), sizeof(gmt));
#else
strncpy(gmt,
asctime(gmtime((time_t *) &
tk->set_at)), sizeof(gmt));
#endif
gmt[strlen(gmt) - 1] = '\0';
sendto_umode(UMODE_EYES,
"%s removed %s %s@%s (set at %s - reason: %s)",
@@ -713,7 +823,7 @@ int m_gline(aClient *cptr, aClient *sptr, int parc, char *parv[])
for (tk = tklines; tk; tk = tk->next)
{
if (tk->type = (TKL_GLOBAL | TKL_KILL))
if (tk->type == (TKL_GLOBAL | TKL_KILL))
{
if (!match(tk->hostmask, usermask)
&& !match(tk->usermask, hostmask))
@@ -741,7 +851,7 @@ int m_gline(aClient *cptr, aClient *sptr, int parc, char *parv[])
if (whattodo == 0)
{
secs = atol(parv[2]);
if (secs < 1)
if (secs < 0)
{
sendto_one(sptr,
":%s NOTICE %s :*** [G:Line error] Please specify a positive value for time",
@@ -757,6 +867,9 @@ int m_gline(aClient *cptr, aClient *sptr, int parc, char *parv[])
(IsHidden(sptr) ? sptr->user->virthost : sptr->user->realhost));
if (whattodo == 0)
{
if (secs == 0)
ircsprintf(mo, "%li", secs);
else
ircsprintf(mo, "%li", secs + TStime());
ircsprintf(mo2, "%li", TStime());
tkllayer[6] = mo;
@@ -772,3 +885,204 @@ int m_gline(aClient *cptr, aClient *sptr, int parc, char *parv[])
}
}
/*
** m_shun (oper function - /TKL takes care of distribution)
** /gline [+|-]u@h mask time :reason
**
** parv[0] = sender
** parv[1] = [+|-]u@h mask
** parv[2] = for how long
** parv[3] = reason
*/
int m_shun(aClient *cptr, aClient *sptr, int parc, char *parv[])
{
aTKline *tk;
time_t secs;
int whattodo = 0; /* 0 = add 1 = del */
int found = 0;
int i;
aClient *acptr;
char *mask = NULL;
char mo[1024], mo2[1024], mo3[512];
char *p, *usermask, *hostmask;
char *tkllayer[9] = {
me.name, /*0 server.name */
NULL, /*1 +|- */
"s", /*2 s */
NULL, /*3 user */
NULL, /*4 host */
NULL, /*5 setby */
NULL, /*6 expire_at */
NULL, /*7 set_at */
NULL /*8 reason */
};
if (parc == 1)
{
tkl_stats(sptr);
return 0;
}
if (!IsOper(sptr))
{
sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name,
sptr->name);
return 0;
}
if (parc < 2)
{
sendto_one(sptr, err_str(ERR_NEEDMOREPARAMS),
me.name, sptr->name, "SHUN");
return;
}
mask = parv[1];
if (*mask == '-')
{
if (parc < 2)
{
sendto_one(sptr, err_str(ERR_NEEDMOREPARAMS),
me.name, sptr->name, "SHUN");
return;
}
whattodo = 1;
mask++;
}
else if (*mask == '+')
{
if (parc < 4)
{
sendto_one(sptr, err_str(ERR_NEEDMOREPARAMS),
me.name, sptr->name, "SHUN");
return;
}
whattodo = 0;
mask++;
}
if (whattodo == 0)
{
if (parc < 4)
{
sendto_one(sptr, err_str(ERR_NEEDMOREPARAMS),
me.name, sptr->name, "SHUN");
return;
}
}
/* Check if its a hostmask and legal .. */
p = strchr(mask, '@');
if (!p || (p == mask))
{
acptr = NULL;
if (!p && (whattodo == 0))
{
acptr = find_person(mask, NULL);
if (acptr)
{
ircsprintf(mo3, "*@%s", acptr->user->realhost);
mask = mo3;
goto mm;
}
}
sendto_one(sptr,
":%s NOTICE %s :*** [Shun error] Please use a user@host mask or an existing nickname.",
me.name, sptr->name);
return 0;
}
mm:
if (whattodo == 1)
goto nochecks;
if (p)
{
p++;
i = 0;
while (*p)
{
if (*p != '*' && *p != '.')
i++;
p++;
}
if (i < 4)
{
sendto_one(sptr,
":%s NOTICE %s :*** [Shun error] Too broad mask",
me.name, sptr->name);
return 0;
}
}
nochecks:
usermask = strtok(mask, "@");
hostmask = strtok(NULL, "@");
tkl_check_expire();
for (tk = tklines; tk; tk = tk->next)
{
if (tk->type == (TKL_GLOBAL | TKL_SHUN))
{
if (!match(tk->hostmask, usermask)
&& !match(tk->usermask, hostmask))
{
found = 1;
break;
}
}
}
if ((found == 1) && whattodo == 0)
{
sendto_one(sptr,
":%s NOTICE %s :*** [Shun error] Match already exists!",
me.name, sptr->name);
return 0;
}
if ((found == 1) && whattodo == 1)
{
sendto_one(sptr,
":%s NOTICE %s :*** [Shun error] No such Shun", me.name,
sptr->name);
return 0;
}
if (whattodo == 0)
{
secs = atol(parv[2]);
if (secs < 0)
{
sendto_one(sptr,
":%s NOTICE %s :*** [Shun error] Please specify a positive value for time",
me.name, sptr->name);
return 0;
}
}
tkllayer[1] = whattodo == 0 ? "+" : "-";
tkllayer[3] = usermask;
tkllayer[4] = hostmask;
tkllayer[5] =
make_nick_user_host(sptr->name, sptr->user->username,
(IsHidden(sptr) ? sptr->user->virthost : sptr->user->realhost));
if (whattodo == 0)
{
if (secs ==0)
ircsprintf(mo, "%li", secs);
else
ircsprintf(mo, "%li", secs + TStime());
ircsprintf(mo2, "%li", TStime());
tkllayer[6] = mo;
tkllayer[7] = mo2;
tkllayer[8] = parv[3];
/* call the tkl layer .. */
m_tkl(&me, &me, 9, tkllayer);
}
else
{
/* call the tkl layer .. */
m_tkl(&me, &me, 6, tkllayer);
}
}
+26 -44
View File
@@ -38,7 +38,7 @@ Computing Center and Jarkko Oikarinen";
#include "userload.h"
#include <sys/stat.h>
#include <fcntl.h>
#if !defined(ULTRIX) && !defined(SGI) && !defined(sequent) && \
#if !defined(ULTRIX) && !defined(SGI) && \
!defined(__convex__) && !defined(_WIN32)
# include <sys/param.h>
#endif
@@ -48,10 +48,6 @@ Computing Center and Jarkko Oikarinen";
#ifdef HPUX
#include <unistd.h>
#endif
#ifdef DYNIXPTX
#include <sys/types.h>
#include <time.h>
#endif
#ifdef _WIN32
# include <io.h>
#endif
@@ -65,6 +61,7 @@ extern float currentrate;
extern float currentrate2;
#endif
extern ircstats IRCstats;
extern char *me_hash;
ID_CVS("$Id$");
static void exit_one_client PROTO((aClient *, aClient *, aClient *, char *));
@@ -270,37 +267,25 @@ char *get_client_name(sptr, showip)
if (MyConnect(sptr))
{
if (IsUnixSocket(sptr))
if (showip)
(void)ircsprintf(nbuf, "%s[%s@%s.%u]",
sptr->name,
(!(sptr->flags & FLAGS_GOTID)) ? "" :
sptr->username,
#ifdef INET6
inetntop(AF_INET6,
(char *)&sptr->ip, mydummy, MYDUMMY_SIZE),
#else
inetntoa((char *)&sptr->ip),
#endif
(unsigned int)sptr->port);
else
{
if (showip)
if (mycmp(sptr->name, sptr->sockhost))
(void)ircsprintf(nbuf, "%s[%s]",
sptr->name, sptr->sockhost);
else
(void)ircsprintf(nbuf, "%s[%s]",
sptr->name, me.sockhost);
}
else
{
if (showip)
(void)ircsprintf(nbuf, "%s[%s@%s.%u]",
sptr->name,
(!(sptr->flags & FLAGS_GOTID)) ? "" :
sptr->username,
#ifdef INET6
inetntop(AF_INET6,
(char *)&sptr->ip, mydummy, MYDUMMY_SIZE),
#else
inetntoa((char *)&sptr->ip),
#endif
(unsigned int)sptr->port);
else
{
if (mycmp(sptr->name, sptr->sockhost))
(void)ircsprintf(nbuf, "%s[%s]",
sptr->name, sptr->sockhost);
else
return sptr->name;
}
return sptr->name;
}
return nbuf;
}
@@ -316,13 +301,10 @@ char *get_client_host(cptr)
return cptr->name;
if (!cptr->hostp)
return get_client_name(cptr, FALSE);
if (IsUnixSocket(cptr))
(void)ircsprintf(nbuf, "%s[%s]", cptr->name, me.name);
else
(void)ircsprintf(nbuf, "%s[%-.*s@%-.*s]",
cptr->name, USERLEN,
(!(cptr->flags & FLAGS_GOTID)) ? "" : cptr->username,
HOSTLEN, cptr->hostp->h_name);
(void)ircsprintf(nbuf, "%s[%-.*s@%-.*s]",
cptr->name, USERLEN,
(!(cptr->flags & FLAGS_GOTID)) ? "" : cptr->username,
HOSTLEN, cptr->hostp->h_name);
return nbuf;
}
@@ -423,8 +405,7 @@ int exit_client(cptr, sptr, from, comment)
IRCstats.me_clients--;
if (IsServer(sptr))
IRCstats.me_servers--;
if (IsUnknown(sptr))
IRCstats.unknown--;
sptr->flags |= FLAGS_CLOSING;
if (IsPerson(sptr))
{
@@ -604,6 +585,7 @@ int exit_client(cptr, sptr, from, comment)
}
recurse--;
}
/*
* Finally, clear out the server we lost itself
@@ -675,7 +657,7 @@ static void exit_one_client_backend(cptr, sptr, from, comment, split)
}
}
}
else if (!(IsPerson(sptr) || IsService(sptr)))
else if (!(IsPerson(sptr)))
/* ...this test is *dubious*, would need
** some thougth.. but for now it plugs a
** nasty hole in the server... --msa
@@ -713,8 +695,8 @@ static void exit_one_client_backend(cptr, sptr, from, comment, split)
sendto_common_channels(sptr, ":%s QUIT :%s",
sptr->name, comment);
if (!IsULine(cptr, sptr) && !MyClient(sptr) && !split)
if (!MyClient(sptr))
if (!IsULine(cptr, sptr) && !split)
if (sptr->user->server != me_hash)
sendto_umode(UMODE_FCLIENT,
"*** Notice -- Client exiting at %s: %s!%s@%s (%s)",
sptr->user->server, sptr->name,
+351 -84
View File
@@ -1,4 +1,3 @@
/*
/*
* Unreal Internet Relay Chat Daemon, src/s_serv.c
* Copyright (C) 1990 Jarkko Oikarinen and
@@ -27,6 +26,7 @@ static char sccsid[] =
"@(#)s_serv.c 2.55 2/7/94 (C) 1988 University of Oulu, Computing Center and Jarkko Oikarinen";
#endif
#include "struct.h"
#include "common.h"
#include "sys.h"
@@ -35,7 +35,7 @@ static char sccsid[] =
#include "channel.h"
#include "userload.h"
#include "version.h"
#if defined(PCS) || defined(AIX) || defined(DYNIXPTX) || defined(SVR3)
#if defined(PCS) || defined(AIX) || defined(SVR3)
#include <time.h>
#endif
#include <sys/stat.h>
@@ -335,8 +335,11 @@ int m_protoctl(cptr, sptr, parc, parv)
char *parv[];
{
int i;
char proto[128], *options, *equal;
static char *dummyblank = ""; /* Yes, it is kind of ugly */
#ifndef PROTOCTL_MADNESS
int remove = 0;
#endif
char proto[128], *s;
/* static char *dummyblank = ""; Yes, it is kind of ugly */
#ifdef PROTOCTL_MADNESS
if (GotProtoctl(sptr))
@@ -356,65 +359,162 @@ int m_protoctl(cptr, sptr, parc, parv)
{
strncpy(proto, parv[i], 127);
proto[127] = '\0'; /* Just to be safe... */
equal = (char *)index(proto, '=');
s = proto;
#ifndef PROTOCTL_MADNESS
if (*s == '-') {
s++;
remove = 1;
}
else
remove = 0;
#endif
/* equal = (char *)index(proto, '=');
if (equal == NULL)
options = dummyblank;
else
{
options = &equal[1]; /* Variable-byte-size safe */
options = &equal[1];
equal[0] = '\0';
}
if (strcmp(proto, "NOQUIT") == 0)
*/
if (strcmp(s, "NOQUIT") == 0)
{
#ifndef PROTOCTL_MADNESS
if (remove) {
ClearNoQuit(cptr);
continue;
}
#endif
Debug((DEBUG_ERROR, "Chose protocol %s for link %s",
proto, cptr->name));
SetNoQuit(cptr);
}
else if (strcmp(proto, "TOKEN") == 0)
else if (strcmp(s, "TOKEN") == 0)
{
#ifndef PROTOCTL_MADNESS
if (remove) {
ClearToken(cptr);
continue;
}
#endif
Debug((DEBUG_ERROR, "Chose protocol %s for link %s",
proto, cptr->name));
SetToken(cptr);
}
else if (strcmp(proto, "HCN") == 0)
else if (strcmp(s, "HCN") == 0)
{
#ifndef PROTOCTL_MADNESS
if (remove) {
ClearHybNotice(cptr);
continue;
}
#endif
Debug((DEBUG_ERROR, "Chose protocol %s for link %s",
proto, cptr->name));
SetHybNotice(cptr);
}
else if (strcmp(proto, "SJOIN") == 0)
else if (strcmp(s, "SJOIN") == 0)
{
#ifndef PROTOCTL_MADNESS
if (remove) {
ClearSJOIN(cptr);
continue;
}
#endif
Debug((DEBUG_ERROR, "Chose protocol %s for link %s",
proto, cptr->name));
SetSJOIN(cptr);
}
else if (strcmp(proto, "SJOIN2") == 0)
else if (strcmp(s, "SJOIN2") == 0)
{
#ifndef PROTOCTL_MADNESS
if (remove) {
ClearSJOIN2(cptr);
continue;
}
#endif
Debug((DEBUG_ERROR, "Chose protocol %s for link %s",
proto, cptr->name));
SetSJOIN2(cptr);
}
else if (strcmp(proto, "NICKv2") == 0)
else if (strcmp(s, "NICKv2") == 0)
{
#ifndef PROTOCTL_MADNESS
if (remove) {
ClearNICKv2(cptr);
continue;
}
#endif
Debug((DEBUG_ERROR, "Chose protocol %s for link %s",
proto, cptr->name));
SetNICKv2(cptr);
}
else if (strcmp(proto, "UMODE2") == 0)
else if (strcmp(s, "UMODE2") == 0)
{
#ifndef PROTOCTL_MADNESS
if (remove) {
ClearUMODE2(cptr);
continue;
}
#endif
Debug((DEBUG_ERROR,
"Chose protocol %s for link %s",
proto, cptr->name));
SetUMODE2(cptr);
}
else if (strcmp(proto, "ALN") == 0)
else if (strcmp(s, "ALN") == 0)
{
#ifdef PROTOCTL_MADNESS
if (remove) {
ClearALN(cptr);
continue;
}
#endif
Debug((DEBUG_ERROR,
"Chose protocol %s for link %s",
proto, cptr->name));
SetALN(cptr);
}
else if (strcmp(s, "VL") == 0)
{
#ifndef PROTOCTL_MADNESS
if (remove) {
ClearVL(cptr);
continue;
}
#endif
Debug((DEBUG_ERROR,
"Chose protocol %s for link %s",
proto, cptr->name));
SetVL(cptr);
}
else if (strcmp(s, "VHP") == 0)
{
#ifndef PROTOCTL_MADNESS
if (remove) {
ClearVHP(cptr);
continue;
}
#endif
Debug((DEBUG_ERROR,
"Chose protocol %s for link %s",
proto, cptr->name));
SetVHP(cptr);
}
else if (strcmp(s, "SJ3") == 0)
{
#ifndef PROTOCTL_MADNESS
if (remove) {
ClearSJ3(cptr);
continue;
}
#endif
Debug((DEBUG_ERROR,
"Chose protocol %s for link %s",
proto, cptr->name));
SetSJ3(cptr);
}
/*
* Add other protocol extensions here, with proto
* containing the base option, and options containing
@@ -443,11 +543,12 @@ int m_server(cptr, sptr, parc, parv)
{
char *ch;
int i;
char info[REALLEN + 1], *inpath, *host, *encr;
char info[REALLEN + 1], *inpath, *host, *encr, *f;
char pp[512];
aClient *acptr, *bcptr;
aConfItem *aconf, *cconf;
int hop, ts = 0;
char *parvaln;
char *parvaln, *flags, *protocol, *inf;
info[0] = '\0';
inpath = get_client_name(cptr, FALSE);
@@ -531,11 +632,11 @@ int m_server(cptr, sptr, parc, parv)
aconf = find_conf_servern(host);
if (!aconf)
{
sendto_locfailops("ERROR :No Access (No N line) %s",
sendto_one(cptr,"ERROR :No Access (No matching N:line) %s",
inpath);
sendto_locfailops("Access denied (No N line) %s",
sendto_locfailops("Access denied (No matching N:line) %s",
inpath);
return exit_client(cptr, cptr, cptr, "No N line");
return exit_client(cptr, cptr, cptr, "No matching N:line");
}
#ifdef CRYPT_LINK_PASSWORD
/* use first two chars of the password they send in as salt */
@@ -564,9 +665,16 @@ int m_server(cptr, sptr, parc, parv)
inpath);
return exit_client(cptr, cptr, cptr, "Bad Password");
}
/* bzero(cptr->passwd, sizeof(cptr->passwd)); */
/* bzero(cptr->passwd, sizeof(cptr->passwd)); */
}
f = (char *) does_servername_collide(parv[1]);
if (f)
{
ircsprintf(pp, "Servername %s collides with servername %s (similar hash). Change servername in some way (maybe change case)",
parv[1], f);
sendto_realops("Link %s cancelled - %s", inpath, pp);
return exit_client(cptr, cptr, cptr, pp);
}
if ((acptr = find_name(host, NULL)))
{
aClient *ocptr;
@@ -607,6 +715,8 @@ int m_server(cptr, sptr, parc, parv)
return exit_client(cptr, cptr, cptr, "Nick as Server");
}
if (IsServer(cptr))
{
/*
@@ -682,6 +792,11 @@ int m_server(cptr, sptr, parc, parv)
strncpyzt(acptr->info, info, sizeof(acptr->info));
acptr->serv->up = find_or_add(parv[0]);
SetServer(acptr);
/* Taken from bahamut makes it so all servers behind a U:lined
* server are also U:lined, very helpful if HIDE_ULINES is on
*/
if (IsULine(sptr,sptr) || (find_uline(cptr->confs, acptr->name)))
acptr->flags |= FLAGS_ULINE;
IRCstats.servers++;
(void)find_or_add(acptr->name);
acptr->flags |= FLAGS_TS8;
@@ -721,9 +836,6 @@ int m_server(cptr, sptr, parc, parv)
IsToken(bcptr) ? TOK_SERVER : MSG_SERVER,
acptr->name, hop + 1, acptr->info);
}
/* Check for U-line status -- Barubary */
if (find_conf_host(cptr->confs, acptr->name, CONF_UWORLD))
acptr->flags |= FLAGS_ULINE;
return 0;
}
@@ -735,6 +847,111 @@ int m_server(cptr, sptr, parc, parv)
** status accordingly...
*/
strncpyzt(cptr->name, host, sizeof(cptr->name));
/* For now, just strip the VL stuff if it's there */
if (SupportVL(cptr)) {
/* we also have a fail safe incase they say they are sending
* VL stuff and don't -- codemastr
*/
aConfItem *vlines = NULL;
inf = NULL;
protocol = NULL;
flags = NULL;
protocol = (char *)strtok((char *)info, "-");
if (protocol)
flags = (char *)strtok((char *)NULL, " ");
if (flags)
inf = (char *)strtok((char *)NULL, "");
if (inf) {
strncpyzt(cptr->info, *inf ? inf : me.name, sizeof(cptr->info));
for (vlines = conf; vlines; vlines = vlines->next) {
if ((vlines->status & CONF_VERSION) && !match(vlines->name,cptr->name))
break;
}
if (vlines) {
char *proto = vlines->host;
char *vflags = vlines->passwd;
int result = 0;
int i;
protocol++;
/* check the protocol */
switch(*proto) {
case '<':
proto++;
if (atoi(protocol) < atoi(proto))
result = 1;
else
result = 0;
break;
case '>':
proto++;
if (atoi(protocol) > atoi(proto))
result = 1;
else
result = 0;
break;
case '=':
proto++;
if (atoi(protocol) == atoi(proto))
result = 1;
else
result = 0;
break;
case '!':
proto++;
if (atoi(protocol) != atoi(proto))
result = 1;
else
result = 0;
break;
/* default to = if anything else */
default:
if (atoi(protocol) == atoi(proto))
result = 1;
else
result = 0;
break;
} /* switch(*proto) */
/* For Services */
if (atoi(protocol) == 0)
result = 0;
/* if the proto in the V:line is * let it pass */
if (*proto == '*')
result = 0;
if (result)
return exit_client(cptr, cptr, cptr, "Denied by V:line");
/* If it passed the protocol check, check the flags */
for(i = 0; vflags[i]; i++) {
if (vflags[i] == '!') {
i++;
if (strchr(flags, (int)vflags[i])) {
result = 1;
break;
}
}
if (!strchr(flags, (int)vflags[i])) {
result = 1;
break;
}
} /* for(i = 0; vflags[i]; i++) */
if (*vflags == '*')
result = 0;
/* for services */
if (!strcmp(flags, "0"))
result = 0;
if (result)
return exit_client(cptr, cptr, cptr, "Denied by V:line");
} /* if (vlines) */
} /* if (flags) */
else
strncpyzt(cptr->info, info[0] ? info : me.name, sizeof(cptr->info));
}
else
strncpyzt(cptr->info, info[0] ? info : me.name, sizeof(cptr->info));
cptr->hopcount = hop;
@@ -779,6 +996,7 @@ int m_server_estab(cptr)
char *inpath, *host, *s, *encr;
int split, i;
char *myaln = find_server_aln(me.name);
extern char serveropts[];
inpath = get_client_name(cptr, TRUE); /* "refresh" inpath with host */
split = mycmp(cptr->name, cptr->sockhost);
@@ -791,8 +1009,8 @@ int m_server_estab(cptr)
{
ircstp->is_ref++;
sendto_one(cptr,
"ERROR :Access denied. No N line for server %s", inpath);
sendto_ops("Access denied. No N line for server %s", inpath);
"ERROR :Access denied. No N:line for server %s", inpath);
sendto_ops("Access denied. No N:line for server %s", inpath);
return exit_client(cptr, cptr, cptr, "No N line for server");
}
if (!(bconf = find_conf(cptr->confs, host, CONF_CONNECT_SERVER)))
@@ -849,8 +1067,9 @@ int m_server_estab(cptr)
/*
** Pass my info to the new server
*/
sendto_one(cptr, "SERVER %s 1 :%s",
my_name_for_link(me.name, aconf),
/* modified so we send out the Uproto and flags */
sendto_one(cptr, "SERVER %s 1 :U%d-%s %s",
my_name_for_link(me.name, aconf), UnrealProtocol, serveropts,
(me.info[0]) ? (me.info) : "IRCers United");
}
else
@@ -894,7 +1113,7 @@ int m_server_estab(cptr)
#ifndef NO_FDLIST
addto_fdlist(cptr->fd, &serv_fdlist);
#endif
if (find_conf_host(cptr->confs, cptr->name, CONF_UWORLD))
if ((find_uline(cptr->confs, cptr->name)))
cptr->flags |= FLAGS_ULINE;
cptr->flags |= FLAGS_TS8;
nextping = TStime();
@@ -910,8 +1129,6 @@ int m_server_estab(cptr)
cptr->serv->up = me.name;
cptr->srvptr = &me;
cptr->serv->nline = aconf;
if (find_conf_host(cptr->confs, cptr->name, CONF_UWORLD))
cptr->flags |= FLAGS_ULINE;
/*
** Old sendto_serv_but_one() call removed because we now
@@ -1028,21 +1245,35 @@ int m_server_estab(cptr)
else
{
send_umode(NULL, acptr, 0, SEND_UMODES, buf);
sendto_one(cptr,
"%s %s %d %d %s %s %s %lu %s %s :%s",
(IsToken(cptr) ? TOK_NICK : MSG_NICK),
acptr->name, acptr->hopcount + 1,
acptr->lastnick, acptr->user->username,
acptr->user->realhost,
(SupportALN(cptr) ?
find_server_aln(acptr->user->
server) : acptr->user->server),
acptr->user->servicestamp, (!buf
|| *buf == '\0' ? "+" : buf),
((IsHidden(acptr)
&& (acptr->umodes & UMODE_SETHOST)) ?
acptr->user->virthost : "*"), acptr->info);
if (!SupportVHP(cptr))
sendto_one(cptr,
"%s %s %d %d %s %s %s %lu %s %s :%s",
(IsToken(cptr) ? TOK_NICK : MSG_NICK),
acptr->name, acptr->hopcount + 1,
acptr->lastnick, acptr->user->username,
acptr->user->realhost,
(SupportALN(cptr) ?
find_server_aln(acptr->user->
server) : acptr->user->server),
acptr->user->servicestamp, (!buf
|| *buf == '\0' ? "+" : buf),
((IsHidden(acptr)
&& (acptr->umodes & UMODE_SETHOST)) ?
acptr->user->virthost : "*"), acptr->info);
else
sendto_one(cptr,
"%s %s %d %d %s %s %s %lu %s %s :%s",
(IsToken(cptr) ? TOK_NICK : MSG_NICK),
acptr->name, acptr->hopcount + 1,
acptr->lastnick, acptr->user->username,
acptr->user->realhost,
(SupportALN(cptr) ?
find_server_aln(acptr->user->
server) : acptr->user->server),
acptr->user->servicestamp, (!buf
|| *buf == '\0' ? "+" : buf),
IsHidden(acptr) ? acptr->user->virthost
: acptr->user->realhost, acptr->info);
}
if (acptr->user->away)
@@ -1059,13 +1290,6 @@ int m_server_estab(cptr)
if (!SupportSJOIN(cptr))
send_user_joins(cptr, acptr);
}
else if (IsService(acptr))
{
sendto_one(cptr, "NICK %s :%d",
acptr->name, acptr->hopcount + 1);
sendto_one(cptr, ":%s SERVICE * * :%s",
acptr->name, acptr->info);
}
}
/*
** Last, pass all channels plus statuses
@@ -1077,7 +1301,12 @@ int m_server_estab(cptr)
if (!SupportSJOIN(cptr))
send_channel_modes(cptr, chptr);
else
send_channel_modes_sjoin(cptr, chptr);
if (SupportSJOIN(cptr) && !SupportSJ3(cptr))
{
send_channel_modes_sjoin(cptr, chptr);
}
else
send_channel_modes_sjoin3(cptr, chptr);
if (chptr->topic_time)
sendto_one(cptr, "%s %s %s %lu :%s",
(IsToken(cptr) ? TOK_TOPIC : MSG_TOPIC),
@@ -1269,7 +1498,7 @@ int m_netinfo(cptr, sptr, parc, parv)
me.name, cptr->name, parv[8], ircnetwork);
}
if (protocol != UnrealProtocol)
if ((protocol != UnrealProtocol) && (protocol != 0))
{
sendto_realops
("Link %s is running Protocol u%li while we are running %li!",
@@ -1799,8 +2028,9 @@ int m_summon(cptr, sptr, parc, parv)
** it--not reversed as in ircd.conf!
*/
static int report_array[18][3] = {
static int report_array[][3] = {
{CONF_CONNECT_SERVER, RPL_STATSCLINE, 'C'},
{CONF_NOCONNECT_SERVER, RPL_STATSOLDNLINE, 'N'},
{CONF_NLINE, RPL_STATSNLINE, 'n'},
{CONF_CLIENT, RPL_STATSILINE, 'I'},
{CONF_KILL, RPL_STATSKLINE, 'K'},
@@ -1817,6 +2047,7 @@ static int report_array[18][3] = {
{CONF_MISSING, RPL_STATSXLINE, 'X'},
{CONF_TLINE, RPL_STATSTLINE, 't'},
{CONF_SOCKSEXCEPT, RPL_STATSELINE, 'e'},
{CONF_VERSION, RPL_STATSVLINE, 'V'},
{0, 0}
};
@@ -1963,6 +2194,9 @@ static void report_configured_links(sptr, mask)
sendto_one(sptr, rpl_str(RPL_STATSNLINE),
me.name, sptr->name, host, pass);
}
else if (mask == CONF_VERSION)
sendto_one(sptr, rpl_str(RPL_STATSVLINE),
me.name, sptr->name, host, pass, name);
/* else if (mask == CONF_EXCEPT)
{
ppx = MyMalloc(strlen(tmp->passwd) + 1);
@@ -2070,6 +2304,8 @@ int m_stats(cptr, sptr, parc, parv)
switch (stat)
{
case 'b': badwords_stats();
break;
case 'L':
case 'l':
/*
@@ -2240,11 +2476,10 @@ int m_stats(cptr, sptr, parc, parv)
send_usage(sptr, parv[0]);
#endif
break;
#ifdef DEVELOP
case 's':
list_scache(sptr);
if (IsOper(sptr))
list_scache(sptr);
break;
#endif
case 'S':
if (IsOper(sptr))
report_dynconf(sptr);
@@ -2280,6 +2515,8 @@ int m_stats(cptr, sptr, parc, parv)
break;
}
case 'v':
report_configured_links(sptr, CONF_VERSION);
break;
case 'V':
vhost_report(sptr);
break;
@@ -2380,7 +2617,7 @@ int m_error(cptr, sptr, parc, parv)
** screen otherwise). Pass ERROR's from other sources to
** the local operator...
*/
if (IsPerson(cptr) || IsUnknown(cptr) || IsService(cptr))
if (IsPerson(cptr) || IsUnknown(cptr))
return 0;
if (cptr == sptr)
{
@@ -2447,7 +2684,7 @@ int m_help(cptr, sptr, parc, parv)
}
if (message[1] == '!')
sendto_serv_butone_token(IsServer(cptr) ? cptr : NULL,
parv[0], MSG_HELP, TOK_HELP, message);
parv[0], MSG_HELP, TOK_HELP, "%s", message);
if (!myncmp(message, "IGNORE ", 7))
{
tmpl = make_link();
@@ -2481,14 +2718,14 @@ int m_help(cptr, sptr, parc, parv)
}
sendto_serv_butone_token(IsServer(cptr) ? cptr : NULL,
parv[0], MSG_HELP, TOK_HELP, message);
parv[0], MSG_HELP, TOK_HELP, "%s", message);
sendto_helpops("from %s (Local): %s", parv[0], message);
sendto_one(sptr, rpl_str(RPL_HELPFWD), me.name, parv[0]);
}
else
{
sendto_serv_butone_token(IsServer(cptr) ? cptr : NULL,
parv[0], MSG_HELP, TOK_HELP, message);
parv[0], MSG_HELP, TOK_HELP, "%s", message);
sendto_helpops("from %s: %s", parv[0], message);
}
@@ -2556,6 +2793,7 @@ int m_lusers(cptr, sptr, parc, parv)
return 0;
}
extern int Rha;
void save_tunefile(void)
{
@@ -2573,6 +2811,7 @@ void save_tunefile(void)
}
fprintf(tunefile, "%li\n", TSoffset);
fprintf(tunefile, "%li\n", IRCstats.me_max);
fprintf(tunefile, "%li\n", Rha);
fclose(tunefile);
}
@@ -2589,6 +2828,8 @@ void load_tunefile(void)
TSoffset = atol(buf);
fgets(buf, 1023, tunefile);
IRCstats.me_max = atol(buf);
fgets(buf, 1023, tunefile);
Rha = atol(buf);
fclose(tunefile);
}
@@ -2830,7 +3071,8 @@ int m_addline(aClient *cptr, aClient *sptr, int parc, char *parv[])
me.name, parv[0], "ADDLINE");
return 0;
}
conf = fopen(CPATH, "a");
/* writes to current -f */
conf = fopen(configfile, "a");
if (conf == NULL)
{
return 0;
@@ -3550,9 +3792,12 @@ int m_restart(cptr, sptr, parc, parv)
int parc;
char *parv[];
{
char *pass = NULL;
char *pass = NULL, *encr;
int x;
#ifdef CRYPT_XLINE_PASSWORD
char salt[3];
extern char *crypt();
#endif
if (MyClient(sptr) && !OPCanRestart(sptr))
{
sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, parv[0]);
@@ -3598,8 +3843,16 @@ int m_restart(cptr, sptr, parc, parv)
parv[0], "RESTART");
return 0;
}
if (strcmp(pass, parv[1]))
#ifdef CRYPT_XLINE_PASSWORD
salt[0]=pass[0];
salt[1]=pass[1];
salt[3]='\0';
encr = crypt(parv[1], salt);
#else
encr = parv[1];
#endif
if (strcmp(pass, encr))
{
sendto_one(sptr, err_str(ERR_PASSWDMISMATCH), me.name,
parv[0]);
@@ -3788,11 +4041,6 @@ int m_trace(cptr, sptr, parc, parv)
now - acptr->lasttime);
cnt++;
break;
case STAT_SERVICE:
sendto_one(sptr, rpl_str(RPL_TRACESERVICE),
me.name, parv[0], class, name);
cnt++;
break;
case STAT_LOG:
sendto_one(sptr, rpl_str(RPL_TRACELOG), me.name,
parv[0], LOGFILE, acptr->port);
@@ -4349,9 +4597,9 @@ int m_close(cptr, sptr, parc, parv)
closed++;
}
sendto_one(sptr, rpl_str(RPL_CLOSEEND), me.name, parv[0], closed);
sendto_ops("%s!%s@%s closed %d unknown connections", sptr->name,
sptr->user->username, sptr->user->realhost, closed);
IRCstats.unknown -= closed;
sendto_realops("%s!%s@%s closed %d unknown connections", sptr->name,
sptr->user->username, IsHidden(sptr) ? sptr->user->virthost : sptr->user->realhost, closed);
IRCstats.unknown = 0;
return 0;
}
@@ -4366,8 +4614,12 @@ int m_die(cptr, sptr, parc, parv)
{
aClient *acptr;
int i;
char *pass = NULL;
char *pass = NULL, *encr;
#ifdef CRYPT_XLINE_PASSWORD
char salt[3];
extern char *crypt();
#endif
if (!MyClient(sptr) || !OPCanDie(sptr))
{
@@ -4384,7 +4636,17 @@ int m_die(cptr, sptr, parc, parv)
return 0;
}
if (strcmp(pass, parv[1]))
#ifdef CRYPT_XLINE_PASSWORD
salt[0] = pass[0];
salt[1] = pass[1];
salt[3] = '\0';
encr = crypt(parv[1], salt);
#else
encr = parv[1];
#endif
if (strcmp(pass,encr))
{
sendto_one(sptr, err_str(ERR_PASSWDMISMATCH), me.name,
parv[0]);
@@ -4468,13 +4730,14 @@ void dump_map(cptr, server, mask, prompt_length, length)
{
if (HIDE_ULINES == 1)
{
if (IsServer(acptr) && IsULine(acptr, acptr)
&& !IsAnOper(cptr))
continue;
}
if (!IsServer(acptr) || strcmp(acptr->serv->up, server->name))
continue;
if (IsULine(acptr, acptr)
&& !IsAnOper(cptr))
continue;
}
if (match(mask, acptr->name))
acptr->flags &= ~FLAGS_MAP;
else
@@ -4489,6 +4752,10 @@ void dump_map(cptr, server, mask, prompt_length, length)
if (!(acptr->flags & FLAGS_MAP) || /* != */
!IsServer(acptr) || strcmp(acptr->serv->up, server->name))
continue;
if (HIDE_ULINES == 1) {
if (IsULine(acptr,acptr) && !IsAnOper(cptr))
continue;
}
if (--cnt == 0)
*p = '`';
dump_map(cptr, acptr, mask, prompt_length + 2, length - 2);
@@ -4518,7 +4785,7 @@ int m_map(cptr, sptr, parc, parv)
parv[1] = "*";
for (acptr = client; acptr; acptr = acptr->next)
if (IsServer(acptr)
&& (strlen(acptr->name) + acptr->hopcount * 2) > longest)
&& (strlen(acptr->name) + acptr->hopcount * 2) > longest)
longest = strlen(acptr->name) + acptr->hopcount * 2;
if (longest > 60)
+113 -15
View File
@@ -45,6 +45,7 @@ ID_CVS("$Id$");
ID_Copyright("(C) Carsten Munk 1999");
time_t TSoffset = 0;
extern ircstats IRCstats;
#ifndef NO_FDLIST
extern float currentrate;
@@ -74,7 +75,11 @@ int m_sethost(cptr, sptr, parc, parv)
char *parv[];
{
char *vhost, *s;
#ifndef DISABLE_USERMOD
int permit = 0; // 0 = opers(glob/locop) 1 = global oper 2 = not MY clients..
#else
int permit = 2;
#endif
int donotice = 0; /* send out notices if local connect ( 0 = NOT 1 = yes ) */
int legalhost = 1; /* is legal characters? */
@@ -176,7 +181,7 @@ int m_sethost(cptr, sptr, parc, parv)
sprintf(sptr->user->virthost, "%s", vhost);
/* spread it out */
sendto_serv_butone_token(cptr, sptr->name, MSG_SETHOST, TOK_SETHOST,
parv[1]);
"%s", parv[1]);
if (MyConnect(sptr))
{
@@ -207,7 +212,13 @@ int m_chghost(cptr, sptr, parc, parv)
char *s;
int legalhost = 1;
#ifdef DISABLE_USERMOD
if (MyClient(sptr))
{
sendto_one(sptr, ":%s NOTICE %s :*** The /chghost command is disabled on this server", me.name, sptr->name);
return 0;
}
#endif
if (MyClient(sptr))
if (!IsAnOper(sptr))
@@ -306,7 +317,13 @@ int m_chgident(cptr, sptr, parc, parv)
char *s;
int legalident = 1;
#ifdef DISABLE_USERMOD
if (MyClient(sptr))
{
sendto_one(sptr, ":%s NOTICE %s :*** The /chgident command is disabled on this server", me.name, sptr->name);
return 0;
}
#endif
if (MyClient(sptr))
if (!IsAnOper(sptr))
@@ -333,7 +350,7 @@ int m_chgident(cptr, sptr, parc, parv)
return 0;
}
if (strlen(parv[2]) > (HOSTLEN - 1))
if (strlen(parv[2]) > (USERLEN - 1))
{
sendto_one(sptr,
":%s NOTICE %s :*** ChgIdent Error: Too long ident!!",
@@ -370,7 +387,7 @@ int m_chgident(cptr, sptr, parc, parv)
}
sendto_serv_butone_token(cptr, sptr->name,
MSG_CHGIDENT,
TOK_CHGIDENT, sptr->name, acptr->name, parv[2]);
TOK_CHGIDENT, "%s %s", acptr->name, parv[2]);
sprintf(acptr->user->username, "%s", parv[2]);
return 0;
}
@@ -400,7 +417,11 @@ int m_setident(cptr, sptr, parc, parv)
{
char *vident, *s;
#ifndef DISABLE_USERMOD
int permit = 0; /* 0 = opers(glob/locop) 1 = global oper */
#else
int permit = 2;
#endif
int donotice = 0; /* send out notices if local connect ( 0 = NOT 1 = yes ) */
int legalident = 1; /* is legal characters? */
if (!MyConnect(sptr))
@@ -497,7 +518,7 @@ int m_setident(cptr, sptr, parc, parv)
sprintf(sptr->user->username, "%s", vident);
/* spread it out */
sendto_serv_butone_token(cptr, sptr->name,
MSG_SETIDENT, TOK_SETIDENT, parv[1]);
MSG_SETIDENT, TOK_SETIDENT, "%s", parv[1]);
if (MyConnect(sptr))
{
@@ -558,7 +579,7 @@ int m_setname(cptr, sptr, parc, parv)
return xx;
}
sendto_serv_butone(cptr, sptr->name, MSG_SETNAME, TOK_SETNAME,
sendto_serv_butone_token(cptr, sptr->name, MSG_SETNAME, TOK_SETNAME,
":%s", parv[1]);
if (MyConnect(sptr))
sendto_one(sptr,
@@ -615,7 +636,7 @@ int m_sdesc(cptr, sptr, parc, parv)
sprintf(sptr->srvptr->info, "%s", parv[1]);
sendto_serv_butone_token(cptr, sptr->name, MSG_SDESC, TOK_SDESC, ":%s",
parv[0], parv[1]);
parv[1]);
if (MyConnect(sptr))
{
@@ -1271,6 +1292,8 @@ int m_svso(cptr, sptr, parc, parv)
if (*parv[2] == '-')
{
fLag = acptr->umodes;
if (IsOper(acptr))
IRCstats.operators--;
acptr->umodes &=
~(UMODE_OPER | UMODE_LOCOP | UMODE_HELPOP | UMODE_SERVICES |
UMODE_SADMIN | UMODE_ADMIN);
@@ -1285,12 +1308,6 @@ int m_svso(cptr, sptr, parc, parv)
}
}
int m_shun(cptr, sptr, parc, parv)
aClient *cptr, *sptr;
int parc;
char *parv[];
{
}
int m_htm(cptr, sptr, parc, parv)
aClient *cptr, *sptr;
@@ -1374,7 +1391,7 @@ int m_htm(cptr, sptr, parc, parv)
int new_val = atoi(parv[2]);
if (new_val < 10)
sendto_one(sptr,
":%s NOTICE %s :New value must be < 10",
":%s NOTICE %s :New value must be > 10",
me.name, parv[0]);
else
{
@@ -1442,6 +1459,15 @@ int m_chgname(cptr, sptr, parc, parv)
aClient *acptr;
char *s;
#ifdef DISABLE_USERMOD
if (MyClient(sptr))
{
sendto_one(sptr, ":%s NOTICE %s :*** The /chgname command is disabled on this server", me.name, sptr->name);
return 0;
}
#endif
if (MyClient(sptr))
if (!IsAnOper(sptr))
{
@@ -1507,3 +1533,75 @@ int m_chgname(cptr, sptr, parc, parv)
}
return 0;
}
#ifdef CRYPTOIRCD
/*
* parv[0] = sender
* parv[1] = algoritm (BLOWFISH, DES, RC5, etc)
* parv[2] = keyfile
* parv[3] = parameters, * if none
*/
int m_crypto(cptr, sptr, parc, parv)
aClient *cptr, *sptr;
int parc;
char *parv[];
{
aClient *acptr;
int method;
FILE *f;
char string[512], *s;
if (parc < 4)
return 0;
if (!strcmp(parv[1], "BLOWFISH"))
{
method = METHOD_BLOWFISH;
}
else
if (!strcmp(parv[1], "OFF"))
{
if (IsSecure(sptr))
ClearSecure(sptr);
sendto_one(sptr, "CRYPTO ERROR :Secure connection breaked");
return 0;
}
else
if (!strcmp(parv[1], "ON"))
return 0;
if (method == METHOD_BLOWFISH)
{
if (strchr(parv[2], '/') || strchr(parv[2], '\\'))
{
sendto_one(sptr, "CRYPTO ERROR :Illegal keypath");
return 0;
}
ircsprintf(string, "keys/%s", parv[2]);
f = fopen(string, "r");
if (!f)
{
sendto_one(sptr, "CRYPTO ERROR :Failed to open keyfile %s", parv[2]);
return 0;
}
s = fgets(string, 510, f);
if (!s)
{
sendto_one(sptr, "CRYPTO ERROR :Unable to read keyfile %s", parv[2]);
return 0;
}
fclose(f);
iCstrip(string);
sptr->cryptinfo = (aCryptInfo *) MyMalloc(sizeof(aCryptInfo));
sptr->cryptinfo->method = method;
sptr->cryptinfo->key = (void *) MyMalloc(sizeof(BF_KEY));
BF_set_key(sptr->cryptinfo->key, strlen(string), string);
sendto_one(sptr, "CRYPTO ON BLOWFISH");
SetSecure(sptr);
return 0;
}
sendto_one(sptr, "CRYPTO ERROR :No such method/command %s", parv[1]);
}
#endif
+115 -158
View File
@@ -50,6 +50,10 @@ Computing Center and Jarkko Oikarinen";
#include "badwords.h"
#endif
#ifdef _WIN32
#include "version.h"
#endif
ID_CVS("$Id$");
void send_umode_out PROTO((aClient *, aClient *, int));
void send_umode_out_nickv2 PROTO((aClient *, aClient *, int));
@@ -60,6 +64,7 @@ static is_silenced PROTO((aClient *, aClient *));
int sendanyways = 0;
int dontspread = 0;
extern char *me_hash;
extern ircstats IRCstats;
static char buf[BUFSIZE], buf2[BUFSIZE];
@@ -105,9 +110,10 @@ void iNAH_host(aClient *sptr, char *host)
if (sptr->user->virthost)
MyFree(sptr->user->virthost);
sptr->user->virthost = MyMalloc(strlen(host) + 1);
ircsprintf(sptr->user->virthost, host);
if (MyConnect(sptr))
sendto_serv_butone_token(&me, sptr->name, MSG_SETHOST,
TOK_SETHOST, sptr->user->virthost);
TOK_SETHOST, "%s", sptr->user->virthost);
sptr->umodes |= UMODE_SETHOST;
}
@@ -269,8 +275,6 @@ aClient *next_client(next, ch)
return next;
for (; next; next = next->next)
{
if (IsService(next))
continue;
if (!match(ch, next->name) || !match(next->name, ch))
break;
}
@@ -509,6 +513,43 @@ int m_remgline(aClient *cptr, aClient *sptr, int parc, char *parv[])
extern char cmodestring[512];
int m_post(aClient *cptr, aClient *sptr, int parc, char *parv[])
{
char *tkllayer[9] = {
me.name, /*0 server.name */
"+", /*1 +|- */
"z", /*2 G */
"*", /*3 user */
NULL, /*4 host */
NULL,
NULL, /*6 expire_at */
NULL, /*7 set_at */
NULL /*8 reason */
};
char hostip[128], mo[128], mo2[128];
if (!MyClient(sptr))
return 0;
if (IsRegistered(sptr))
return 0;
strcpy(hostip, (char *)inetntoa((char *)&sptr->ip));
sendto_one(sptr, ":%s NOTICE AUTH :*** Proxy connection detected (bad!)", me.name);
sendto_umode(UMODE_EYES, "Attempted WWW Proxy connect from client %s", get_client_host(sptr));
exit_client(cptr, sptr, &me, "HTTP proxy connection");
tkllayer[4] = hostip;
tkllayer[5] = me.name;
ircsprintf(mo, "%li", iConf.socksbantime + TStime());
ircsprintf(mo2, "%li", TStime());
tkllayer[6] = mo;
tkllayer[7] = mo2;
tkllayer[8] = "HTTP Proxy";
return m_tkl(&me,&me, 9,tkllayer);
}
/*
** register_user
** This function is called when both NICK and USER messages
@@ -539,7 +580,7 @@ static int register_user(cptr, sptr, nick, username, umode, virthost)
char *nick, *username, *virthost, *umode;
{
aConfItem *aconf;
char *parv[3], *tmpstr, c;
char *parv[3], *tmpstr, c, *encr;
#ifdef HOSTILENAME
char stripuser[USERLEN + 1], *u1 = stripuser, *u2, olduser[USERLEN + 1],
userbad[USERLEN * 2 + 1], *ubad = userbad, noident = 0;
@@ -571,13 +612,6 @@ static int register_user(cptr, sptr, nick, username, umode, virthost)
if (MyConnect(sptr))
{
if (badclass)
{
ircsprintf(mo2, "ircd.conf Y:line class number %i is bad (contains too many max clients (> %i). Get your IRC admin to fix this",
badclass, MAXCONNECTIONS - 15);
exit_client(cptr, sptr, &me, mo2);
return 0;
}
#ifdef SOCKSPORT
if (sptr->flags & FLAGS_GOTSOCKS)
{
@@ -635,10 +669,7 @@ static int register_user(cptr, sptr, nick, username, umode, virthost)
MyFree(tmpx);
return xx;
}
if (IsUnixSocket(sptr))
strncpyzt(user->realhost, me.sockhost,
sizeof(user->realhost));
else if (sptr->hostp)
if (sptr->hostp)
{
/* No control-chars or ip-like dns replies... I cheat :)
-- OnyxDragon */
@@ -741,7 +772,24 @@ static int register_user(cptr, sptr, nick, username, umode, virthost)
if (!BadPtr(aconf->passwd) && !StrEq("ONE", aconf->passwd))
{
if (!StrEq(sptr->passwd, aconf->passwd))
/* I:line password encryption --codemastr */
#ifdef CRYPT_ILINE_PASSWORD
if (*sptr->passwd) {
char salt[3];
extern char *crypt();
salt[0]=aconf->passwd[0];
salt[1]=aconf->passwd[1];
salt[3]='\0';
encr = crypt(sptr->passwd, salt);
}
else
encr = "";
#else
encr = sptr->passwd;
#endif
if (!StrEq(encr, aconf->passwd))
{
ircstp->is_ref++;
sendto_one(sptr, err_str(ERR_PASSWDMISMATCH),
@@ -787,46 +835,6 @@ static int register_user(cptr, sptr, nick, username, umode, virthost)
ircstp->is_ref++;
return xx;
}
#ifdef DISALLOW_MIXED_CASE
/* check for mixed case usernames, meaning probably hacked Jon2 3-94
*/
#ifdef IGNORE_CASE_FIRST_CHAR
tmpstr = (username[0] == '~' ? &username[2] : &username[1]);
#else
tmpstr = (username[0] == '~' ? &username[1] : username);
#endif /* IGNORE_CASE_FIRST_CHAR */
while (*tmpstr && !(lower && upper || special))
{
c = *tmpstr;
tmpstr++;
if (islower(c))
{
lower++;
continue; /* bypass rest of tests */
}
if (isupper(c))
{
upper++;
continue;
}
if (c == '-' || c == '_' || c == '.' || isdigit(c))
continue;
special++;
}
if (lower && upper || special)
{
sendto_ops("Invalid username: %s",
get_client_name(sptr, FALSE));
ircstp->is_ref++;
return exit_client(cptr, sptr, sptr,
"Invalid username");
}
#endif /* DISALLOW_MIXED_CASE */
if (oldstatus == STAT_MASTER && MyConnect(sptr))
(void)m_oper(&me, sptr, 1, parv);
}
else
{
@@ -863,9 +871,11 @@ static int register_user(cptr, sptr, nick, username, umode, virthost)
(void)m_lusers(sptr, sptr, 1, parv);
update_load();
(void)m_motd(sptr, sptr, 1, parv);
#ifdef EXPERIMENTAL
sendto_one(sptr,
":%s NOTICE %s :*** \2NOTE:\2 This server (%s) is running experimental IRC server software. If you find any bugs or problems, please mail unreal-dev@lists.sourceforge.net about it",
me.name, sptr->name, me.name);
#endif
#ifdef HOSTILENAME
/*
* Now send a numeric to the user telling them what, if
@@ -908,9 +918,7 @@ static int register_user(cptr, sptr, nick, username, umode, virthost)
else
sptr->flags |= (acptr->flags & FLAGS_TS8);
/* *FINALL* this gets in ircd... -- Barubary */
if (find_conf_host(cptr->confs, sptr->name, CONF_UWORLD)
|| (sptr->user && find_conf_host(cptr->confs,
sptr->user->server, CONF_UWORLD)))
if ((find_uline(cptr->confs, sptr->user->server)))
sptr->flags |= FLAGS_ULINE;
}
@@ -927,14 +935,14 @@ static int register_user(cptr, sptr, nick, username, umode, virthost)
if (sptr->user->virthost)
MyFree(sptr->user->virthost);
sptr->user->virthost =
MyMalloc(strlen(sptr->user->virthost) + 1);
MyMalloc(strlen(virthost) + 1);
ircsprintf(sptr->user->virthost, virthost);
}
}
hash_check_notify(sptr, RPL_LOGON); /* Uglier hack */
send_umode(NULL, sptr, 0, SEND_UMODES, buf);
/* NICKv2 Servers ! */
sendto_serv_butone_nickcmd(cptr, nick,
sendto_serv_butone_nickcmd(cptr, sptr, nick,
sptr->hopcount + 1, sptr->lastnick, user->username, user->realhost,
user->server, user->servicestamp, sptr->info,
(!buf || *buf == '\0' ? "+" : buf),
@@ -951,6 +959,8 @@ static int register_user(cptr, sptr, nick, username, umode, virthost)
sendto_one(nsptr, ":%s PRIVMSG %s@%s :IDENTIFY %s",
sptr->name, NickServ, SERVICES_NAME, sptr->passwd);
/* Force the user to join the given chans -- codemastr */
sendto_one(cptr,":%s MODE %s :%s", cptr->name, cptr->name, buf);
if (strcmp(AUTO_JOIN_CHANS, "0"))
{
char *chans[3] = {
@@ -1341,9 +1351,8 @@ int m_nick(cptr, sptr, parc, parv)
{
ircstp->is_kill++;
sendto_serv_butone(NULL,
":%s KILL %s :%s (Nick Collision: %s <- %s)",
me.name, acptr->name, me.name, acptr->from->name,
parc > 5 ? parv[5] : get_client_name(cptr, FALSE));
":%s KILL %s :%s (Nick Collision)",
me.name, acptr->name, me.name);
acptr->flags |= FLAGS_KILLED;
(void)exit_client(NULL, acptr, &me,
"Nick collision with no timestamp/equal timestamps");
@@ -1355,9 +1364,8 @@ int m_nick(cptr, sptr, parc, parv)
{
ircstp->is_kill++;
sendto_serv_butone(cptr,
":%s KILL %s :%s (Nick Collision: %s <- %s)",
me.name, acptr->name, me.name, acptr->from->name,
parc > 5 ? parv[5] : get_client_name(cptr, FALSE));
":%s KILL %s :%s (Nick Collision)",
me.name, acptr->name, me.name);
acptr->flags |= FLAGS_KILLED;
(void)exit_client(NULL, acptr, &me, "Nick collision");
goto nickkilldone; /* OK, we got rid of the "wrong" user,
@@ -1531,45 +1539,8 @@ int m_nick(cptr, sptr, parc, parv)
* Client setting NICK the first time.
*
* Generate a random string for them to pong with.
*
* The first two are server specific. The intent is to randomize
* things well.
*
* We use lots of junk here, but only "low cost" things.
*/
md5data[0] = NOSPOOF_SEED01;
md5data[1] = NOSPOOF_SEED02;
md5data[2] = TStime();
md5data[3] = me.sendM;
md5data[4] = me.receiveM;
md5data[5] = 0;
md5data[6] = getpid();
md5data[7] = sptr->ip.S_ADDR;
md5data[8] = sptr->fd;
md5data[9] = 0;
md5data[10] = 0;
md5data[11] = 0;
md5data[12] = md5hash[0]; /* previous runs... */
md5data[13] = md5hash[1];
md5data[14] = md5hash[2];
md5data[15] = md5hash[3];
/*
* initialize the md5 buffer to known values
*/
MD5Init(md5hash);
/*
* transform the above information into gibberish
*/
MD5Transform(md5hash, md5data);
/*
* Never release any internal state of our generator. Instead,
* use two parts of the returned hash and xor them to hide
* both values.
*/
sptr->nospoof = (md5hash[0] ^ md5hash[1]);
*/
sptr->nospoof = 1+(int) (9000000.0*random()/(RAND_MAX+80000000.0));
/*
* If on the odd chance it comes out zero, make it something
@@ -1580,7 +1551,7 @@ int m_nick(cptr, sptr, parc, parv)
sendto_one(sptr, ":%s NOTICE %s :*** If you are having problems"
" connecting due to ping timeouts, please"
" type /notice %X nospoof now.",
me.name, nick, sptr->nospoof, sptr->nospoof);
me.name, nick, sptr->nospoof);
sendto_one(sptr, "PING :%X", sptr->nospoof);
#endif /* NOSPOOF */
@@ -1687,6 +1658,7 @@ static int m_message(cptr, sptr, parc, parv, notice)
"No external channel messages",
"Colour is not permitted in this channel",
"You are banned",
"CTCPs are not permitted in this channel",
NULL
};
@@ -1728,15 +1700,12 @@ static int m_message(cptr, sptr, parc, parv, notice)
/*
** nickname addressed?
*/
if (WEBTV_SUPPORT == 1)
{
if (!strcasecmp(nick, "irc") && MyClient(sptr))
{
parse(sptr, parv[2],
(parv[2] + strlen(parv[2])), msgtab);
continue;
}
}
if (*nick != '#' && (acptr = find_person(nick, NULL)))
{
/* F:Line stuff by _Jozeph_ added by Stskeeps with comments */
@@ -1815,9 +1784,9 @@ static int m_message(cptr, sptr, parc, parv, notice)
stripbadwords_message(parv[2]));
else
#endif
sendto_prefix_one(acptr, sptr,
":%s %s %s :%s", parv[0], cmd, nick,
parv[2]);
sendto_message_one(acptr,
sptr, parv[0], cmd,
nick, parv[2]);
}
continue;
}
@@ -1874,21 +1843,11 @@ static int m_message(cptr, sptr, parc, parv, notice)
}
else
{
if (prefix & PREFIX_VOICE)
sendto_channelvoice_butone(cptr,
sptr, chptr,
":%s %s %s :%s", parv[0],
cmd, nick, text);
if (prefix & PREFIX_HALFOP)
sendto_channelhalfop_butone
(cptr, sptr, chptr,
":%s %s %s :%s", parv[0],
cmd, nick, text);
if (prefix & PREFIX_OP)
sendto_channelops_butone(cptr,
sptr, chptr,
":%s %s %s :%s", parv[0],
cmd, nick, text);
sendto_channelprefix_butone(cptr,
sptr, chptr,
prefix,
":%s %s %s :%s", parv[0],
cmd, nick, text);
}
sendanyways = 0;
continue;
@@ -2310,12 +2269,17 @@ static void do_who(sptr, acptr, repchan)
char status[5];
int i = 0;
/* auditoriums only show @'s */
if (repchan && (repchan->mode.mode & MODE_AUDITORIUM) &&
!is_chan_op(acptr, repchan))
return;
if (acptr->user->away)
status[i++] = 'G';
else
status[i++] = 'H';
/* Check for +H here too -- codemastr */
if (IsAnOper(acptr) && !IsHideOper(acptr))
if (IsAnOper(acptr) && (!IsHideOper(acptr) || sptr == acptr || IsAnOper(sptr)))
status[i++] = '*';
else if (IsInvisible(acptr) && sptr != acptr && IsAnOper(sptr))
status[i++] = '%';
@@ -2330,6 +2294,8 @@ static void do_who(sptr, acptr, repchan)
":%s NOTICE %s :*** %s either did a /who or a specific /who on you",
me.name, acptr->name, sptr->name);
}
if (IsHiding(acptr) && sptr != acptr && !IsNetAdmin(sptr) && !IsTechAdmin(sptr))
repchan = NULL;
sendto_one(sptr, rpl_str(RPL_WHOREPLY), me.name, sptr->name,
(repchan) ? (repchan->chname) : "*", acptr->user->username,
IsHidden(acptr) ? acptr->user->virthost : acptr->user->realhost,
@@ -2421,12 +2387,10 @@ int m_who(cptr, sptr, parc, parv)
if (member || !SecretChannel(chptr))
for (lp = chptr->members; lp; lp = lp->next)
{
if (oper && (!IsAnOper(lp->value.cptr)
|| IsHideOper(lp->value.cptr)))
if (IsHiding(lp->value.cptr))
continue;
if (IsHiding(lp->value.cptr)
&& !(IsNetAdmin(sptr)
|| IsTechAdmin(sptr)))
if (oper && (!IsAnOper(lp->value.cptr)
))
continue;
if (lp->value.cptr != sptr
&& IsInvisible(lp->value.cptr)
@@ -2445,7 +2409,7 @@ int m_who(cptr, sptr, parc, parv)
if (!IsPerson(acptr))
continue;
if (oper && (!IsAnOper(acptr) || IsHideOper(acptr)))
if (oper && (!IsAnOper(acptr) || (IsHideOper(acptr) && sptr != acptr && !IsAnOper(sptr))))
continue;
showperson = 0;
/*
@@ -2708,18 +2672,11 @@ int m_whois(cptr, sptr, parc, parv)
}
}
if (IsULine(acptr, acptr))
goto next;
if (IsHiding(acptr) && sptr != acptr
&& !IsNetAdmin(sptr) && !IsTechAdmin(sptr))
goto next;
if (buf[0] != '\0')
if (buf[0] != '\0' && !IsULine(acptr, acptr) && (!IsHiding(acptr) ||
IsNetAdmin(sptr) || IsTechAdmin(sptr) || sptr == acptr))
sendto_one(sptr, rpl_str(RPL_WHOISCHANNELS),
me.name, parv[0], name, buf);
next:
sendto_one(sptr, rpl_str(RPL_WHOISSERVER),
me.name, parv[0], name, user->server,
a2cptr ? a2cptr->info : "*Not On This Net*");
@@ -2731,7 +2688,7 @@ int m_whois(cptr, sptr, parc, parv)
before we display a helpop or IRCD Coder msg)
-- codemastr */
if ((IsAnOper(acptr) || IsServices(acptr))
&& !IsHideOper(acptr))
&& (!IsHideOper(acptr) || sptr == acptr || IsAnOper(sptr)))
{
buf[0] = '\0';
if (IsNetAdmin(acptr))
@@ -2758,7 +2715,7 @@ int m_whois(cptr, sptr, parc, parv)
parv[0], name, buf, ircnetwork);
}
if (IsHelpOp(acptr) && !IsHideOper(acptr))
if (IsHelpOp(acptr) && (!IsHideOper(acptr) || sptr == acptr || IsAnOper(sptr)))
if (!acptr->user->away)
sendto_one(sptr,
rpl_str(RPL_WHOISHELPOP), me.name,
@@ -2769,7 +2726,7 @@ int m_whois(cptr, sptr, parc, parv)
sendto_one(sptr, rpl_str(RPL_WHOISBOT),
me.name, parv[0], name, ircnetwork);
}
if (acptr->umodes & UMODE_CODER && !IsHideOper(acptr))
if (acptr->umodes & UMODE_CODER && (!IsHideOper(acptr) || sptr == acptr || IsAnOper(sptr)))
{
sendto_one(sptr, rpl_str(RPL_WHOISOPERATOR),
me.name, parv[0], name, "a Coder",
@@ -2924,7 +2881,7 @@ int m_user(cptr, sptr, parc, parv)
}
strncpyzt(user->realhost, host, sizeof(user->realhost));
user->server = me.name;
user->server = me_hash;
user_finish:
user->servicestamp = sstamp;
strncpyzt(sptr->info, realname, sizeof(sptr->info));
@@ -3124,12 +3081,9 @@ int m_kill(cptr, sptr, parc, parv)
** ...!operhost!oper
** ...!operhost!oper (comment)
*/
if (IsUnixSocket(cptr)) /* Don't use get_client_name syntax */
strcpy(inpath, me.name);
else
strcpy(inpath,
IsHidden(cptr) ? cptr->user->
virthost : cptr->user->realhost);
strcpy(inpath,
IsHidden(cptr) ? cptr->user->
virthost : cptr->user->realhost);
if (kcount < 2) /* Only check the path the first time
around, or it gets appended to itself. */
if (!BadPtr(path))
@@ -4050,9 +4004,11 @@ int m_userhost(cptr, sptr, parc, parv)
virthost : acptr->user->realhost)));
if (IsWhois(acptr) && IsOper(sptr))
{
/*
sendto_one(acptr,
":%s NOTICE %s :*** %s did a /userhost on you.",
me.name, sptr->name, sptr->name);
*/
}
resid -= catsize;
}
@@ -4369,8 +4325,7 @@ int m_umode(cptr, sptr, parc, parv)
if ((sptr->umodes & (UMODE_KIX)) && !(IsNetAdmin(sptr)
|| IsTechAdmin(sptr)))
sptr->umodes &= ~UMODE_KIX;
if ((sptr->umodes & (UMODE_FCLIENT)) && !(IsNetAdmin(sptr)
|| IsTechAdmin(sptr)))
if ((sptr->umodes & (UMODE_FCLIENT)) && !IsOper(sptr))
sptr->umodes &= ~UMODE_FCLIENT;
/* Agents
@@ -4379,6 +4334,7 @@ int m_umode(cptr, sptr, parc, parv)
if ((sptr->umodes & UMODE_HIDING) && !IsAnOper(sptr))
sptr->umodes &= ~UMODE_HIDING;
if ((sptr->umodes & UMODE_HIDING)
&& !(sptr->oflag & OFLAG_INVISIBLE))
sptr->umodes &= ~UMODE_HIDING;
@@ -4570,8 +4526,9 @@ setmodey:
sendto_serv_butone_token(cptr, parv[0], MSG_SVS2MODE,
TOK_SVS2MODE, "%s %s", parv[1], parv[2]);
sendto_one(acptr, ":%s MODE %s :%s", parv[0], parv[1], parv[2]);
send_umode(NULL, sptr, setflags, ALL_UMODES, buf);
if (MyClient(sptr))
sendto_one(sptr, ":%s MODE %s :%s", parv[0], parv[1], buf);
return 0;
}
+18
View File
@@ -125,6 +125,24 @@ char *find_server_aln(char *s)
return (convert2aln(hash(s)));
}
char *does_servername_collide(char *s)
{
int i = hash(s);
if (scache_hash[i])
{
if (strcmp(s, scache_hash[i]->name))
return scache_hash[i]->name;
else
return NULL;
}
else
{
return NULL;
}
}
/*
* Added so s_debug could check memory usage in here -Dianora
*/
+173 -11
View File
@@ -51,6 +51,7 @@ extern fdlist oper_fdlist;
#define NEWLINE "\r\n"
static char sendbuf[2048];
static int send_message PROTO((aClient *, char *, int));
static int sentalong[MAXCONNECTIONS];
@@ -159,11 +160,7 @@ int send_queued(to)
** not working correct if send_queued is called for a
** dead socket... --msa
*/
#ifndef SENDQ_ALWAYS
return dead_link(to, "send_queued called for a DEADSOCKET:%s");
#else
return -1;
#endif
}
while (DBufLength(&to->sendQ) > 0)
{
@@ -202,9 +199,12 @@ void vsendto_one(aClient *to, char *pattern, va_list vl)
sendbufto_one(to);
}
void sendbufto_one(aClient *to)
{
int len;
char *s;
int i;
Debug((DEBUG_ERROR, "Sending [%s] to %s", sendbuf, to->name));
@@ -243,7 +243,13 @@ void sendbufto_one(aClient *to)
sendto_ops("Trying to send [%s] to myself!", tmp_sendbuf);
return;
}
#ifdef CRYPTOIRCD
if (IsSecure(to))
{
s = (char *) ep_encrypt(to, sendbuf, &len);
bcopy(s, sendbuf, len);
}
#endif
if (DBufLength(&to->sendQ) > get_sendq(to))
{
if (IsServer(to))
@@ -255,7 +261,7 @@ void sendbufto_one(aClient *to)
return;
}
else if (!dbuf_put(&to->sendQ, sendbuf, len))
if (!dbuf_put(&to->sendQ, sendbuf, len))
{
dead_link(to, "Buffer allocation error");
return;
@@ -313,6 +319,54 @@ void sendto_channel_butone(aClient *one, aClient *from, aChannel *chptr,
va_end(vl);
}
void sendto_channelprefix_butone(aClient *one, aClient *from, aChannel *chptr,
int prefix,
char *pattern, ...)
{
va_list vl;
Link *lp;
aClient *acptr;
int i;
va_start(vl, pattern);
for (i = 0; i < MAXCONNECTIONS; i++)
sentalong[i] = 0;
for (lp = chptr->members; lp; lp = lp->next)
{
acptr = lp->value.cptr;
if (acptr->from == one)
continue; /* ...was the one I should skip
or user not not a channel op */
if ((prefix & 0x1) && !(lp->flags & CHFL_HALFOP))
continue;
if ((prefix & 0x2) && !(lp->flags & CHFL_VOICE))
continue;
if ((prefix & 0x4) && !(lp->flags & CHFL_CHANOP))
continue;
i = acptr->from->fd;
if (MyConnect(acptr) && IsRegisteredUser(acptr))
{
vsendto_prefix_one(acptr, from, pattern, vl);
sentalong[i] = 1;
}
else
{
/* Now check whether a message has been sent to this
* remote link already */
if (sentalong[i] == 0)
{
vsendto_prefix_one(acptr, from, pattern, vl);
sentalong[i] = 1;
}
}
}
va_end(vl);
return;
}
/*
* sendto_channelops_butone Added 1 Sep 1996 by Cabal95.
* Send a message to all OPs in channel chptr that
@@ -554,6 +608,96 @@ void sendto_serv_butone_token(aClient *one, char *prefix, char *command,
return;
}
/*
* sendto_server_butone_token_opt
*
* Send a message to all connected servers except the client 'one'.
* with capab to tokenize, opt
*/
void sendto_serv_butone_token_opt(aClient *one, int opt, char *prefix, char *command,
char *token, char *pattern, ...)
{
va_list vl;
int i;
aClient *cptr;
#ifndef NO_FDLIST
int j;
#endif
char *p;
static char tcmd[1024];
static char ccmd[1024];
static char buff[1024];
static char pref[100];
va_start(vl, pattern);
pref[0] = '\0';
if (strchr(prefix, '.'))
ircsprintf(pref, "@%s", find_server_aln(prefix));
strcpy(tcmd, token);
strcpy(ccmd, command);
strcat(tcmd, " ");
strcat(ccmd, " ");
ircvsprintf(buff, pattern, vl);
strcat(tcmd, buff);
strcat(ccmd, buff);
#ifdef NO_FDLIST
for (i = 0; i <= highest_fd; i++)
#else
for (i = serv_fdlist.entry[j = 1]; j <= serv_fdlist.last_entry;
i = serv_fdlist.entry[++j])
#endif
{
if (!(cptr = local[i]) || (one && cptr == one->from))
continue;
#ifdef NO_FDLIST
if (IsServer(cptr))
#endif
if ((opt & OPT_NOT_SJOIN) && SupportSJOIN(cptr))
continue;
if ((opt & OPT_NOT_NICKv2) && SupportNICKv2(cptr))
continue;
if ((opt & OPT_NOT_SJOIN2) && SupportSJOIN2(cptr))
continue;
if ((opt & OPT_NOT_UMODE2) && SupportUMODE2(cptr))
continue;
if ((opt & OPT_NOT_SJ3) && SupportSJ3(cptr))
continue;
if ((opt & OPT_NICKv2) && !SupportNICKv2(cptr))
continue;
if ((opt & OPT_SJOIN) && !SupportSJOIN(cptr))
continue;
if ((opt & OPT_SJOIN2) && !SupportSJOIN2(cptr))
continue;
if ((opt & OPT_UMODE2) && !SupportUMODE2(cptr))
continue;
if ((opt & OPT_SJ3) && !SupportSJ3(cptr))
continue;
if (IsToken(cptr))
{
if ((pref[0] != '\0') && SupportALN(cptr))
sendto_one(cptr, "%s %s", pref, tcmd);
else
sendto_one(cptr, ":%s %s", prefix,
tcmd);
}
else
{
if ((pref[0] != '\0') && SupportALN(cptr))
sendto_one(cptr, "%s %s", pref, ccmd);
else
sendto_one(cptr, ":%s %s", prefix,
ccmd);
}
}
va_end(vl);
return;
}
/*
* sendto_serv_butone_quit
*
@@ -1422,8 +1566,13 @@ void sendto_connectnotice(nick, user, sptr)
char connectd[1024];
char connecth[1024];
ircsprintf(connectd,
"*** Notice -- Client connecting on port %d: %s (%s@%s)",
sptr->acpt->port, nick, user->username, user->realhost);
"*** Notice -- Client connecting on port %d: %s (%s@%s) %s",
sptr->acpt->port, nick, user->username, user->realhost,
#ifdef CRYPTOIRCD
IsSecure(sptr) ? "[secure]" : "");
#else
"");
#endif
ircsprintf(connecth,
"*** Notice -- Client connecting: %s (%s@%s) [%s] {%d}", nick,
user->username, user->realhost, sptr->sockhost,
@@ -1448,7 +1597,8 @@ void sendto_connectnotice(nick, user, sptr)
*
* Send a message to all connected servers except the client 'one'.
*/
void sendto_serv_butone_nickcmd(aClient *one, char *nick, int hopcount,
void sendto_serv_butone_nickcmd(aClient *one, aClient *sptr,
char *nick, int hopcount,
int lastnick, char *username, char *realhost, char *server,
long servicestamp, char *info, char *umodes, char *virthost)
{
@@ -1479,8 +1629,9 @@ void sendto_serv_butone_nickcmd(aClient *one, char *nick, int hopcount,
(IsToken(cptr) ? TOK_NICK : MSG_NICK), nick,
hopcount, lastnick, username, realhost,
(SupportALN(cptr) ? find_server_aln(server)
: server), servicestamp, umodes, virthost,
info);
: server), servicestamp, umodes,
(SupportVHP(cptr) ? (IsHidden(sptr) ? sptr->user->virthost : realhost) : virthost),
info);
}
else
{
@@ -1510,3 +1661,14 @@ void sendto_serv_butone_nickcmd(aClient *one, char *nick, int hopcount,
va_end(vl);
return;
}
void sendto_message_one(aClient *to, aClient *from, char *sender,
char *cmd, char *nick, char *msg)
{
if(IsServer(to->from) && IsToken(to->from)) {
if(*cmd == 'P') cmd = TOK_PRIVATE;
if(*cmd == 'N') cmd = TOK_NOTICE;
}
sendto_prefix_one(to, from, ":%s %s %s :%s",
sender, cmd, nick, msg);
}
+41 -4
View File
@@ -24,13 +24,10 @@ static char sccsid[] = "@(#)support.c 2.21 4/13/94 1990, 1991 Armin Gruner;\
#endif
#include "config.h"
#ifdef DYNIXPTX
#include <sys/timers.h>
#include <stddef.h>
#endif
#include "struct.h"
#include "common.h"
#include "sys.h"
#include "version.h"
#ifdef _WIN32
#include <io.h>
#else
@@ -41,6 +38,16 @@ extern int errno; /* ...seems that errno.h doesn't define this everywhere */
#endif
extern void outofmemory();
#define is_enabled match
char *my_itoa(int i)
{
static char buf[128];
ircsprintf(buf, "%i", i);
return (buf);
}
#ifdef NEED_STRTOKEN
/*
** strtoken.c -- walk through a string of tokens, using a set
@@ -576,3 +583,33 @@ char *inetntop(af, in, out, the_size)
return out;
}
#endif
extern int Rha;
/*
* Disconnect all users connected to local server incase of /restart slow
* (development tool to test load conditions, should be turned off in releases)
*/
int rh(void)
{
int fd;
/* test if this is an development release, just for security -
we test if there is a Unreal*l, as it would be Unreal3.1-Silverheart(devel)
should really be an define, but i need it to be !DEVELOP as well,
for testing phases at irc.ircsystems.net
*/
return 0;
if (!is_enabled("Unreal*l*", Rh VERSIONONLY))
return 0;
for (fd = 0; fd < MAXCONNECTIONS; fd++)
{
close(fd);
}
Rha = 1;
save_tunefile();
}
+10 -7
View File
@@ -10,7 +10,7 @@ case $CONFIG in
;;
esac
echo "Extracting $package/ircd/version.c..."
echo "Extracting src/version.c..."
if test -r version.c
then
@@ -101,9 +101,14 @@ char *unrealcredits[] =
"- Good hosting, CVS hosting, FTP etc etc:) - thanks for",
" supporting opensource projects",
"",
"noriko noriko@linuxsquare.net",
"- Giving us an OpenBSD shell to develop on :)",
"",
" \37Donations to Unreal:\37",
"BlueFlame^",
" - the first UnrealIRCd donation :)",
"[Real] from ChatFIRST.com",
" - donation to UnrealIRCd project :)",
"Thanks to Headbang and WonderWal too for hardware+software",
"donations",
" (yes your name can be here too;)",
@@ -112,7 +117,8 @@ char *unrealcredits[] =
"zshack, Headbang, Mick, Sp^, WonderWal, bomb, BullFrog, JacobD,",
"SirDeath, l33, EiniD, uo, RevPsych and the subgenius.net network,",
"^RavenX^, Mich[a]el, {X}, Fish, Shmad, Killer, BrainSCAN, RevNull,",
"GoNiS (irc.coreplex.org), Mikey, DrBin, and others",
"GoNiS, Mikey, DrBin, rapta, crow, SevenEagle, Curt|s, Scooter,",
"auspice",
"",
"",
" \2\37Stskeeps would like to thank:\2\37",
@@ -151,13 +157,10 @@ char *unrealcredits[] =
"zero9000 Kevin Alford",
" - UnrealIRCd logo, graphics, null desu ;), ideas etc.",
" \2\37codemastr would like to thank:\2\37",
"CaliMonk Ivo Teel calimonk@nhn.net",
"CaliMonk Ivo Teel calimonk@axenet.org",
" - Getting me started at NeoHorizon which basically got me",
" started coding IRCd",
"Kenpo Ian Ricci ianr@nhn.net",
" - Starting me out learning *nix and giving me a place",
" to develop Unreal",
"[FBI] Corey Lang *unknown*",
"[FBI] Corey Lang fbi@dal.net",
" - Being a good IRC friend and getting me started with",
" IRC through our old little wIRCd net :)",
"",
-4
View File
@@ -24,10 +24,6 @@
#include "numeric.h"
#include "h.h"
#include "hash.h"
#ifndef lint
static char *rcs_version =
"$Id$";
#endif
/* externally defined functions */
unsigned int hash_whowas_name(char *); /* defined in hash.c */
+350
View File
@@ -0,0 +1,350 @@
/************************************************************************
* IRC - Internet Relay Chat, ircd/s_zip.c
* Copyright (C) 1996 Christophe Kalt
*
* 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 1, 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., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* $Id$
*/
#include "struct.h"
#include "common.h"
#include "sys.h"
#include "numeric.h"
#include "msg.h"
#include "channel.h"
#include "userload.h"
#include "version.h"
#include <string.h>
#include <stdlib.h>
#ifdef ZIP_LINKS
/*
** Important note:
** The provided buffers for uncompression and compression *MUST* be big
** enough for any operation to complete.
**
** s_bsd.c current settings are that the biggest packet size is 16k
** (but socket buffers are set to 8k..)
*/
/*
** size of the buffer holding compressed data
**
** outgoing data:
** must be enough to hold compressed data resulting of the compression
** of up to ZIP_MAXIMUM bytes
** incoming data:
** must be enough to hold cptr->zip->inbuf + what was just read
** (cptr->zip->inbuf should never hold more than ONE compression block.
** The biggest block allowed for compression is ZIP_MAXIMUM bytes)
*/
#define ZIP_BUFFER_SIZE (ZIP_MAXIMUM + BUFSIZE)
/*
** size of the buffer where zlib puts compressed data
** must be enough to hold uncompressed data resulting of the
** uncompression of zibuffer
**
** I'm assuming that at best, ratio will be 25%. (tests show that
** best ratio is around 40%).
*/
/*
* On an hybrid test net, we kept filling up unzipbuf
* original was 4*ZIP_BUFFER_SIZE
*
* -Dianora
*/
#define UNZIP_BUFFER_SIZE 6 * ZIP_BUFFER_SIZE
/* buffers */
static char unzipbuf[UNZIP_BUFFER_SIZE];
static char zipbuf[ZIP_BUFFER_SIZE];
/*
** zip_init
** Initialize compression structures for a server.
** If failed, zip_free() has to be called.
*/
int zip_init(aClient *cptr)
{
cptr->zip = (aZdata *) MyMalloc(sizeof(aZdata));
cptr->zip->incount = 0;
cptr->zip->outcount = 0;
cptr->zip->in = (z_stream *) MyMalloc(sizeof(z_stream));
cptr->zip->in->total_in = 0;
cptr->zip->in->total_out = 0;
cptr->zip->in->zalloc = (alloc_func)0;
cptr->zip->in->zfree = (free_func)0;
cptr->zip->in->data_type = Z_ASCII;
if (inflateInit(cptr->zip->in) != Z_OK)
{
cptr->zip->out = NULL;
return -1;
}
cptr->zip->out = (z_stream *) MyMalloc(sizeof(z_stream));
cptr->zip->out->total_in = 0;
cptr->zip->out->total_out = 0;
cptr->zip->out->zalloc = (alloc_func)0;
cptr->zip->out->zfree = (free_func)0;
cptr->zip->out->data_type = Z_ASCII;
if (deflateInit(cptr->zip->out, ZIP_LEVEL) != Z_OK)
return -1;
return 0;
}
/*
** zip_free
*/
void zip_free(aClient *cptr)
{
cptr->flags2 &= ~FLAGS2_ZIP;
if (cptr->zip)
{
if (cptr->zip->in)
inflateEnd(cptr->zip->in);
MyFree(cptr->zip->in);
if (cptr->zip->out)
deflateEnd(cptr->zip->out);
MyFree(cptr->zip->out);
MyFree(cptr->zip);
cptr->zip = NULL;
}
}
/*
** unzip_packet
** Unzip the buffer,
** put anything left in cptr->zip->inbuf, update cptr->zip->incount
**
** will return the uncompressed buffer, length will be updated.
** if a fatal error occurs, length will be set to -1
*/
char *unzip_packet(aClient *cptr, char *buffer, int *length)
{
z_stream *zin = cptr->zip->in;
int r;
char *p;
if(cptr->zip->incount)
{
/* There was a "chunk" of uncompressed data without a newline
* left over from last unzip_packet. So pick that up, and unzip
* some more data. Note, buffer parameter isn't used in this case.
* -Dianora
*/
memcpy((void *)unzipbuf,(void *)cptr->zip->inbuf,cptr->zip->incount);
zin->avail_out = UNZIP_BUFFER_SIZE - cptr->zip->incount;
zin->next_out = unzipbuf + cptr->zip->incount;
cptr->zip->incount = 0;
cptr->zip->inbuf[0] = '\0'; /* again unnecessary but nice for debugger */
}
else
{
/* Start unzipping this buffer, if I fill up output buffer,
* then snag whatever uncompressed incomplete chunk I have at
* the top of the uncompressed buffer, save it for next pass.
* -Dianora
*/
if(!buffer) /* Sanity test never hurts */
{
*length = -1;
return((char *)NULL);
}
zin->next_in = buffer;
zin->avail_in = *length;
zin->next_out = unzipbuf;
zin->avail_out = UNZIP_BUFFER_SIZE;
}
switch (r = inflate(zin, Z_NO_FLUSH))
{
case Z_OK:
if (zin->avail_in)
{
cptr->zip->incount = 0;
if(zin->avail_out == 0)
{
/* ok, filled up output buffer, complain about it, but go on.
* I need to find any incomplete "chunk" at the top of
* the uncompressed output buffer, and save it for next call.
* N.B. That cptr->zip->inbuf isn't really necessary
* i.e. re-entrancy is not required since I know
* there is more uncompressed data to do, and dopacket()
* will not return until its all parsed. -db
*/
sendto_realops("Overflowed unzipbuf increase UNZIP_BUFFER_SIZE");
/*
* I used to just give up here....
* length = -1;
* return((char *)NULL);
*/
/* Check for pathological case where output
* just happened to have finished with a newline
* and there is still input to do
* Just stuff a newline in for now, it will be discarded
* anyway, and continue parsing. -db
*/
if((zin->next_out[0] == '\n') || (zin->next_out[0] == '\r'))
{
cptr->zip->inbuf[0] = '\n';
cptr->zip->incount = 1;
}
else
{
/* Scan from the top of output, look for a complete
* "chunk" N.B. there should be a check for p hitting
* the bottom of the unzip buffer. -db
*/
for(p = zin->next_out;p >= unzipbuf;)
{
if((*p == '\r') || (*p == '\n'))
break;
zin->avail_out++;
p--;
cptr->zip->incount++;
}
/* A little sanity test never hurts -db */
if(p == unzipbuf)
{
cptr->zip->incount = 0;
cptr->zip->inbuf[0] = '\0'; /* only for debugger */
*length = -1;
return((char *)NULL);
}
/* Ok, stuff this "chunk" into inbuf
* for next call -Dianora
*/
p++;
cptr->zip->incount--;
memcpy((void *)cptr->zip->inbuf,
(void *)p,cptr->zip->incount);
}
}
else
{
/* outbuf buffer is not full, but still
* input to do. I suppose its just bad data.
* However I don't have much other choice here but to
* give up in complete disgust -db
*/
*length = -1;
return((char *)NULL);
}
}
*length = UNZIP_BUFFER_SIZE - zin->avail_out;
return unzipbuf;
case Z_BUF_ERROR:
if (zin->avail_out == 0)
{
sendto_realops("inflate() returned Z_BUF_ERROR: %s",
(zin->msg) ? zin->msg : "?");
*length = -1;
}
break;
case Z_DATA_ERROR: /* the buffer might not be compressed.. */
if ((IsCapable(cptr, CAP_ZIP)) && !strncmp("ERROR ", buffer, 6))
{
cptr->flags2 &= ~FLAGS2_ZIP;
cptr->caps &= ~CAP_ZIP;
/*
* This is not sane at all. But if other server
* has sent an error now, it is probably closing
* the link as well.
*/
return buffer;
}
/* no break */
default: /* error ! */
/* should probably mark link as dead or something... */
sendto_realops("inflate() error(%d): %s", r,
(zin->msg) ? zin->msg : "?");
*length = -1; /* report error condition */
break;
}
return((char *)NULL);
}
/*
** zip_buffer
** Zip the content of cptr->zip->outbuf and of the buffer,
** put anything left in cptr->zip->outbuf, update cptr->zip->outcount
**
** if flush is set, then all available data will be compressed,
** otherwise, compression only occurs if there's enough to compress,
** or if we are reaching the maximum allowed size during a connect burst.
**
** will return the uncompressed buffer, length will be updated.
** if a fatal error occurs, length will be set to -1
*/
char *zip_buffer(aClient *cptr, char *buffer, int *length, int flush)
{
z_stream *zout = cptr->zip->out;
int r;
if (buffer)
{
/* concatenate buffer in cptr->zip->outbuf */
memcpy((void *)cptr->zip->outbuf + cptr->zip->outcount, (void *)buffer,
*length );
cptr->zip->outcount += *length;
}
*length = 0;
if (!flush && ((cptr->zip->outcount < ZIP_MINIMUM) ||
((cptr->zip->outcount < (ZIP_MAXIMUM - BUFSIZE)) &&
CBurst(cptr))))
return((char *)NULL);
zout->next_in = cptr->zip->outbuf;
zout->avail_in = cptr->zip->outcount;
zout->next_out = zipbuf;
zout->avail_out = ZIP_BUFFER_SIZE;
switch (r = deflate(zout, Z_PARTIAL_FLUSH))
{
case Z_OK:
if (zout->avail_in)
{
/* can this occur?? I hope not... */
sendto_realops("deflate() didn't process all available data!");
}
cptr->zip->outcount = 0;
*length = ZIP_BUFFER_SIZE - zout->avail_out;
return zipbuf;
default: /* error ! */
sendto_realops("deflate() error(%d): %s", r, (zout->msg) ? zout->msg : "?");
*length = -1;
break;
}
return((char *)NULL);
}
#endif /* ZIP_LINKS */