diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2003-01-23 19:45:57 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2003-01-23 19:45:57 +0000 |
commit | 73b9d0c5cb02f0ea8350de28bc3687e0af70ea0f (patch) | |
tree | a5845579b1363762650f0e45c62a13890e1efa43 |
Initial revision
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@132 e03df62e-2008-0410-955e-edbf42e46eb7
105 files changed, 15935 insertions, 0 deletions
diff --git a/Makefile.FreeBSD b/Makefile.FreeBSD new file mode 100644 index 000000000..04484d56a --- /dev/null +++ b/Makefile.FreeBSD @@ -0,0 +1,32 @@ +# Insp Main Makefile +# +# +# +# + +CC = g++ +PROGS = inspircd +FLAGS = -fPIC -frtti -O3 +LDLIBS = -ldl +MODPATH = modules/ +MODULES = m_cloaking.so m_foobar.so m_randquote.so +MAKEARGS = 'PROGS=${PROGS}' 'FLAGS=${FLAGS}' 'CC=${CC}' 'LDLIBS=${LDLIBS}' 'MODULES=${MODULES}' + +all : ircd mods + +mods: + make -C src/modules DIRNAME="src/modules" $(MAKEARGS) + mv src/modules/*.so $(MODPATH) + +ircd: + make -C src DIRNAME="src" $(MAKEARGS) + cp src/inspircd bin/inspircd + +clean: + rm -rf src/*.o + rm -rf src/modules/*.o + +modclean: + rm -rf modules/*.so + +squeakyclean: modclean clean diff --git a/Makefile.Linux b/Makefile.Linux new file mode 100644 index 000000000..04484d56a --- /dev/null +++ b/Makefile.Linux @@ -0,0 +1,32 @@ +# Insp Main Makefile +# +# +# +# + +CC = g++ +PROGS = inspircd +FLAGS = -fPIC -frtti -O3 +LDLIBS = -ldl +MODPATH = modules/ +MODULES = m_cloaking.so m_foobar.so m_randquote.so +MAKEARGS = 'PROGS=${PROGS}' 'FLAGS=${FLAGS}' 'CC=${CC}' 'LDLIBS=${LDLIBS}' 'MODULES=${MODULES}' + +all : ircd mods + +mods: + make -C src/modules DIRNAME="src/modules" $(MAKEARGS) + mv src/modules/*.so $(MODPATH) + +ircd: + make -C src DIRNAME="src" $(MAKEARGS) + cp src/inspircd bin/inspircd + +clean: + rm -rf src/*.o + rm -rf src/modules/*.o + +modclean: + rm -rf modules/*.so + +squeakyclean: modclean clean diff --git a/conf/inspire.motd b/conf/inspire.motd new file mode 100644 index 000000000..67df9d3db --- /dev/null +++ b/conf/inspire.motd @@ -0,0 +1,12 @@ + + _____ _____ _____ _____ _ +|_ _| |_ _| | __ \ / ____| | | + | | _ __ ___ _ __ | | | |__) || | __| | + | | | '_ \ / __| | '_ \ | | | _ / | | / _` | + _| |_ | | | | \__ \ | |_) | _| |_ | | \ \ | |____ | (_| | +|_____| |_| |_| |___/ | .__/ |_____| |_| \_\ \_____| \__,_| + __________________| |_______________________________ + |__________________|_|_______________________________| + + Insert something funkeh here + diff --git a/conf/inspire.quotes b/conf/inspire.quotes new file mode 100644 index 000000000..ca406beee --- /dev/null +++ b/conf/inspire.quotes @@ -0,0 +1,174 @@ +Men are from Mars. Women are from Venus. Computers are from hell +Computer /nm./: a device designed to speed and automate errors +Hardware /nm./: the part of the computer that you can kick. +Maniac /n./ An early computer built by nuts. +RAM /abr./: Rarely Adequate Memory. +Programmer /n./ A red-eyed, mumbling mammal capable of conversing with inanimate objects +Multitasking /adj./ 3 PCs and a chair with wheels +Plonk /excl./: The sound a newbie makes as he falls to the bottom of a kill file +hURL /n./: a link to a web site that makes you want to puke +SUPERCOMPUTER: what it sounded like before you bought it. +If it's really a supercomputer, how come the bullets don't bounce off when I shoot it? . The Covert Comic. +A computer is like an Old Testament god, with a lot of rules and no mercy. . Joseph Campbell +I dropped my computer on my foot! That Megahurtz!! +A computer's attention span is as long as it's power cord +586: The average IQ needed to understand a PC +Memory is like an orgasm. It's a lot better if you don't have to fake it +If it jams, force it. If it breaks, it needed replacing anyway. +A bus station is where a bus stops. A train station is where a train stops. On my desk I have a workstation.. +Want to come see my HARD DRIVE ? I promise it isn't 3.5 inches and it ain't floppy. . Geek pick-up line. +If you torture the data enough, it will confess. . Ronald Coase +If you give someone a program, you will frustrate them for a day; if you teach them how to program, you will frustrate them for a lifetime +ASCII stupid question, get a stupid ANSI! +Use the source, Luke... +Programming is an art form that fights back +MacOS, Windows, BeOS: they're all just Xerox copies +Whenever you think you have a clever programming trick... forget it! +Managing senior programmers is like herding cats. . Dave Platt +Your program is sick ! Shoot it and put it out of its memory +/* You are not expected to understand this */ +To define recursion, we must first define recursion +ERROR: Computer possessed; Load EXOR.SYS ? [Y/N] +Linux is only free if your time is worthless +Linux: find out what you've been missing while you've been rebooting Windows NT +unzip; strip; touch; finger; mount; fsck; more; yes; unmount; sleep +Profanity is the one language all programmers know best +It's 5.50 a.m.... Do you know where your stack pointer is? +#define QUESTION ((bb) || !(bb)) . Shakespeare +The more I C, the less I see. +Confucius say: He who play in root, eventually kill tree. +Unix is the answer, but only if you phrase the question very carefully +C++: Hard to learn and built to stay that way +Java is, in many ways, C++-- . Michael Feldman. +They don't make bugs like Bunny anymore . Olav Mjelde +If debugging is the process of removing software bugs, then programming must be the process of putting them in +When the only tool you own is a hammer, every problem you encounter resembles a nail +System Error: press F13 to continue... +To err is human, but for a real disaster you need a computer +Computers make very fast, very accurate mistakes +Life would be so much easier if we only had the source code +Who is this 'General Failure' and why is he reading my disk? +hAS aNYONE sEEN MY cAPSLOCK kEY? +InspIRCd, now with excessive ammounts of Cheeze +I'm in the computer business, I make Out-Of-Order signs +Kevorkian Virus: helps your computer shut down whenever it wants to. + [OUT OF QUOTES, PLEASE ORDER MORE] +Error, no keyboard . press F1 to continue. +Cannot delete tmp150---3.tmp: There is not enough free disk space. Delete one or more files to free disk space, and then try again +File not found. Should I fake it ? (Y/N) +The definition of an upgrade: Take old bugs out, put new ones in +If it's not on fire, it's a software problem +My software never has bugs. It just develops random features +It's a little-known fact that the Y1K problem caused the Dark Ages +Artificial Intelligence usually beats natural stupidity +Making fun of AOL users is like making fun of the kid in the wheel chair +Daddy, why doesn't this magnet pick up this floppy disk? +Daddy, what does FORMATTING DRIVE C mean? +See daddy ? All the keys are in alphabetical order now. +If you can't beat your computer at chess, do what I did . try kick-boxing. +Enter any 11-digit prime number to continue... +ASCII and ye shall receive. +The web is a dominatrix. Every where I turn, I see little buttons ordering me to Submit. +<FrostyCoolSlug> NO, You cannot dial 999, I'm downloading my mail ;/ +640K ought to be enough for anybody. . Bill Gates, 1981 +Windows not found, [P]arty, [C]elebrate, [D]rink? +English, the Microsoft of languages... +It's been said that Bill Gates named his company after his dick... +Ever notice how fast Windows runs ? -- Neither did I +If at first you don't succeed, work for Microsoft +We are Microsoft. Resistance Is Futile. You Will Be Assimilated +"Microsoft Works." . Oxymoron +Windows isn't a virus, viruses do something +PANIC! buffer = :NickServ WRITE_DB(3). <-- JUST KIDDING! +It just keeps going and going and going and going and goi <BANG> +All that I know is that nukes are comming from 127.0.0.1 +I know all about the irc and the mirc cops. +M re ink n ed d, ple s r fil +Please refrain from feeding the IRC Operators. Thank you. +I know all about mirc stuff, hmm.. I think this channel is experiencing packet loss.. +MacDonalds claims Macintosh stole their next idea of the iMac +I can't hold her any longer, captain, she's gonna bl.. sorry, got caught up in the moment +I recommend purchasing a Cyrix CPU for testing nuclear meltdowns +Is it an international rule to have the worst picture possible on your driver license? +Have you hugged your services coder, today? +Ever wonder why they make the colon flash on alarm clocks? +Whats this?.. blue screen with a VXD error?!.. I'VE BEEN NUKED! +do-do-bop-doo-doo-do-do-doo.. For those of you who know that song, you have problems.. +be wery wery quiet... hunting wabbit... +I've been IRC Nuked"Great warrior? War does not make one great." - Yoda +"I find your lack of faith.....disturbing." - Darth Vader +"I have a bad feeling about this.."--All of the Star Wars characters. +Can I upgrade my Hard Drive to a WARP drive? +Canadian DOS prompt: EH?\> +Canadian DOS: "Yer sure, eh?" [y/n] +CONGRESS.SYS Corrupted: Re-boot Washington D.C (Y/n)? +I don't have a solution but I admire the problem. +Famous Last Words: Trust me. I know what I'm doing. +Hey Captain, I just created a black ho-÷p!%$û NO CARRIER +I like work ... I can sit and watch it for hours. +Access denied--nah nah na nah nah! +Bad command. Bad, bad command! Sit! Stay! Staaay.. +Error: Keyboard not attached. Press F1 to continue. +*grumble* "You're just supposed to sit here?" +"Hey, what's this button d..<BOOM>" -W. Crusher +"He has become One with Himself!" "He's passed out!" "That too."-B5 +For a funny quote, call back later. +Famous last words: 'You saw a WHAT around the corner?!' +I like work ... I can sit and watch it for hours. +If debugging is the process of removing bugs, then programming must be the process of putting them in. +Copywight 1994 Elmer Fudd. All wights wesewved. +Cannot find REALITY.SYS. Universe halted. +BUFFERS=20 FILES=15 2nd down, 4th quarter, 5 yards to go! +My software never has bugs. It just develops random features. +Why doesn't DOS ever say 'EXCELLENT command or filename!? +Who's General Failure & why's he reading my disk? +Shell to DOS... Come in DOS, do you copy? Shell to DOS... +Computing Definition - Network-Admin: Primary person who just got set up for the blame of the system crash. +An expert is a person who has made all the mistakes which can be made in a very narrow field. +Famous last words: This is the safe way to do it....... +Famous Last Words: Trust me. I know what I'm doing. +Clinton, "I didn't say that - er, well - yes, but I didn't mean..." +CLINTON LEGACY??...even Pharaoh had only ten plagues... +IBM I Bought McIntosh +IBM I Bring Manuals +IBM I've Been Moved +IBM Idolized By Management +IBM Impenetrable Brain Matter +IBM Imperialism By Marketing +IBM Incorrigible Boisterous Mammoth +IBM Inertia Breeds Mediocrity +IBM Ingenuity Becomes Mysterious +IBM Ingrained Batch Mentality +IBM Innovation By Management +IBM Insipid Belligerent Mossbacks +IBM Insipidly Bankrolling Millions +IBM Inspect Before Multiusing +IBM Install Bigger Memory +IBM Institution By Machiavelli +IBM Insultingly Boring Merchandisers +IBM Intellectuals Being Moronized +IBM Intelligence Belittling Meaning +IBM Intimidated, Buffaloed Management +IBM Into Building Money +IBM Intolerant of Beards & Moustaches +IBM Invest Before Multi-tasking +IBM Investigate Baffling Malodor +IBM Irresponsible Behave Multinational +IBM It Beats Mattel +IBM It's a Big Mess +IBM It's Better Manually +IBM Itty Bitty Machine +IBM Institute for Black Magic +100,000 lemmings can't be wrong. +Murphy's Eighth Law: If everything seems to be going well, you have obviously overlooked something. +Rules of the game: Do not believe in miracles - rely on them. +Rules of the game: Any given program, once running, is obsolete. +Computing Definition - Error: What someone else has made when they disagree with your computer output. +Backup not found: (A)bort (R)etry (P)anic +WinErr 653: Multitasking attempted - system confused. +Cannot join #real_life (invite only) +"Unfortunatly, no one can be told what the Matrix is. You have to see it for yourself." - Matrix +"Reality is a thing of the past" - Matrix +"The future will not be user friendly" - Matrix +"The general idea in chat is to make yourself understandable... ..." - Peer +"heh i am talkin to someone...she not dead...yet anyways" - Stinky diff --git a/conf/inspire.rules b/conf/inspire.rules new file mode 100644 index 000000000..e51f0afd9 --- /dev/null +++ b/conf/inspire.rules @@ -0,0 +1,3 @@ +This is the InspIRCd rules file. + +Place any network or server rules here :) diff --git a/configure b/configure new file mode 100755 index 000000000..d3e63a19e --- /dev/null +++ b/configure @@ -0,0 +1,333 @@ +#!/bin/sh +# InspIRCd Configuration Script +# +# Copyright 2003 The ChatSpike Development Team +# <brain@chatspike.net> +# <Craig@chatspike.net> +# +# $Id$ +# +# Some shell code based on the configure script of IRC Services. +# IRC Services is copyright (c) 1996-2002 Andrew Church. +# E-mail: <achurch@achurch.org> +# +# +######################################## + +# echo -e "\033[1;37mtest\033[0;37m" + +echo "Configuring default values..." +mkdir fdscount +echo "#include <sys/types.h>" >> fdscount/fdcounter.c +echo "#include <sys/socket.h>" >> fdscount/fdcounter.c +echo "main()" >> fdscount/fdcounter.c +echo "{" >> fdscount/fdcounter.c +echo " int i;" >> fdscount/fdcounter.c +echo " int s;" >> fdscount/fdcounter.c +echo "" >> fdscount/fdcounter.c +echo " for (i = 1; i <= 10000; i++)" >> fdscount/fdcounter.c +echo " {" >> fdscount/fdcounter.c +echo " s = socket(AF_INET, SOCK_STREAM, 0);" >> fdscount/fdcounter.c +echo " if (s < 0)" >> fdscount/fdcounter.c +echo " {" >> fdscount/fdcounter.c +echo " printf(\"%i\", i + 2);" >> fdscount/fdcounter.c +echo " exit(-1);" >> fdscount/fdcounter.c +echo " }" >> fdscount/fdcounter.c +echo " }" >> fdscount/fdcounter.c +echo "}" >> fdscount/fdcounter.c + +echo "PROGS = fdcounter" >> fdscount/Makefile +echo "OBJS = fdcounter.o" >> fdscount/Makefile +echo "" >> fdscount/Makefile +echo "CC = gcc" >> fdscount/Makefile +echo "CXXFLAGS = -fPIC -frtti -O" >> fdscount/Makefile +echo "" >> fdscount/Makefile +echo "all : \$(PROGS)" >> fdscount/Makefile +echo "" >> fdscount/Makefile +echo "\$(PROGS): \$(OBJS)" >> fdscount/Makefile +echo " \$(CXX) -rdynamic \$^ -o \$@" >> fdscount/Makefile +echo "" >> fdscount/Makefile +echo ".PHONY: clean" >> fdscount/Makefile +echo "clean:" >> fdscount/Makefile +echo " rm -f *.o core" >> fdscount/Makefile + +cd fdscount +make +cd .. + +ME=`pwd` +PERL=`which perl` +CONFIG_DIR=$ME/conf +MODULE_DIR=$ME/modules +MAX_CLIENT=`fdscount/fdcounter` +NICK_LENGT=32 +CHAN_LENGT=64 +MAX_CHANNE=20 +MAXI_MODES=20 + +rm -rf fdscount + +if [ "$PERL" = "" ] ; then + echo "You require perl to run this program." + exit; +fi + + +OSNAME=`(uname -s) 2>/dev/null` || OSNAME="unknown" + +c="" +n="" +if [ "`eval echo -n 'a'`" = "-n a" ] ; then + c="\c" +else + n="-n" +fi + +exists () { # because some shells don't have test -e + if [ -f $1 -o -d $1 -o -p $1 -o -c $1 -o -b $1 ] ; then + return 0 + else + return 1 + fi +} + +clear +echo -e "'\033[1;33m####\033[0;37m:'\033[1;33m##\033[0;37m::: \033[1;33m##\033[0;37m::'\033[1;33m######\033[0;37m::'\033[1;33m########\033[0;37m::'\033[1;33m####\033[0;37m:'\033[1;33m########\033[0;37m:::'\033[1;33m######\033[0;37m::'\033[1;33m########\033[0;37m::" +echo -e ". \033[1;33m##\033[0;37m:: \033[1;33m###\033[0;37m:: \033[1;33m##\033[0;37m:'\033[1;33m##\033[0;37m... \033[1;33m##\033[0;37m: \033[1;33m##\033[0;37m.... \033[1;33m##\033[0;37m:. \033[1;33m##\033[0;37m:: \033[1;33m##\033[0;37m.... \033[1;33m##\033[0;37m:'\033[1;33m##\033[0;37m... \033[1;33m##\033[0;37m: \033[1;33m##\033[0;37m.... \033[1;33m##\033[0;37m:" +echo -e ": \033[1;33m##\033[0;37m:: \033[1;33m####\033[0;37m: \033[1;33m##\033[0;37m: \033[1;33m##\033[0;37m:::..:: \033[1;33m##\033[0;37m:::: \033[1;33m##\033[0;37m:: \033[1;33m##\033[0;37m:: \033[1;33m##\033[0;37m:::: \033[1;33m##\033[0;37m: \033[1;33m##\033[0;37m:::..:: \033[1;33m##\033[0;37m:::: \033[1;33m##\033[0;37m:" +echo -e ": \033[1;33m##\033[0;37m:: \033[1;33m##\033[0;37m \033[1;33m##\033[0;37m \033[1;33m##\033[0;37m:. \033[1;33m######\033[0;37m:: \033[1;33m########\033[0;37m::: \033[1;33m##\033[0;37m:: \033[1;33m########\033[0;37m:: \033[1;33m##\033[0;37m::::::: \033[1;33m##\033[0;37m:::: \033[1;33m##\033[0;37m:" +echo -e ": \033[1;33m##\033[0;37m:: \033[1;33m##\033[0;37m. \033[1;33m####\033[0;37m::..... \033[1;33m##\033[0;37m: \033[1;33m##\033[0;37m.....:::: \033[1;33m##\033[0;37m:: \033[1;33m##\033[0;37m.. \033[1;33m##\033[0;37m::: \033[1;33m##\033[0;37m::::::: \033[1;33m##\033[0;37m:::: \033[1;33m##\033[0;37m:" +echo -e ": \033[1;33m##\033[0;37m:: \033[1;33m##\033[0;37m:. \033[1;33m###\033[0;37m:'\033[1;33m##\033[0;37m::: \033[1;33m##\033[0;37m: \033[1;33m##\033[0;37m::::::::: \033[1;33m##\033[0;37m:: \033[1;33m##\033[0;37m::. \033[1;33m##\033[0;37m:: \033[1;33m##\033[0;37m::: \033[1;33m##\033[0;37m: \033[1;33m##\033[0;37m:::: \033[1;33m##\033[0;37m:" +echo -e "'\033[1;33m####\033[0;37m: \033[1;33m##\033[0;37m::. \033[1;33m##\033[0;37m:. \033[1;33m######\033[0;37m:: \033[1;33m##\033[0;37m::::::::'\033[1;33m####\033[0;37m: \033[1;33m##\033[0;37m:::. \033[1;33m##\033[0;37m:. \033[1;33m######\033[0;37m:: \033[1;33m########\033[0;37m::" +echo -e "\033[0;37m\033[0;37m....::..::::..:::......:::..:::::::::....::..:::::..:::......:::........:::" +echo "" +echo -e "\033[1;37mWelcome to the InspIRCd Configuration program!" +echo "" +echo "*** If you are unsure of any of these values, leave it blank for ***" +echo "*** standard settings that will work, and your server will run ***" +echo "*** using them. If you are running this server as part of a ***" +echo "*** larger network, you must consult with your network admins ***" +echo "*** for the proper values to use, or server links will be unstable! ***" +echo -e "\033[0;37m" +echo -e "Press \033[1;37m<RETURN>\033[0;37m to accept the default for any option, or enter" +echo -e "a new value. Please note: You will \033[1;37mHAVE\033[0;37m to read the docs" +echo -e "dir, otherwise you won't have a config file!" +echo "" +echo -e "Your operating system is: \033[1;37m$OSNAME\033[0;37m (`uname -mnr`), fdmax: $MAX_CLIENT" +echo "" + +############################################################################# + + ok=0 + asked=1 + echo "In what directory are the configuration files?" + while [ $ok -eq 0 ] ; do + echo -e $n "[\033[1;32m$CONFIG_DIR\033[0;37m] -> $c" + if read INPUT ; then : ; else echo "" ; exit 1 ; fi + if [ ! "$INPUT" ] ; then + INPUT=$CONFIG_DIR + default=1 + fi + if echo "$INPUT" | grep -q \[\'\"\\\] ; then + echo 'Please use a pathname without the characters: '\'' " \' + elif [ ! "$NO_DIR_CHECK" -a ! -d "$INPUT" ] ; then + if exists "$INPUT" ; then + echo "$INPUT exists, but is not a directory!" + else + echo "$INPUT does not exist. Create it?" + echo -e $n "[\033[1;32my\033[0;37m] $c" + read YN + if [ "$YN" != "n" ] ; then + if mkdir -p "$INPUT" ; then + ok=1 + fi + fi + fi + else + ok=1 + fi + done + CONFIG_DIR=$INPUT + echo "" + + +############################################################################## + + ok=0 + asked=1 + echo "In What directory are the modules to be compiled to?" + while [ $ok -eq 0 ] ; do + echo -e $n "[\033[1;32m$MODULE_DIR\033[0;37m] -> $c" + if read INPUT ; then : ; else echo "" ; exit 1 ; fi + if [ ! "$INPUT" ] ; then + INPUT=$MODULE_DIR + default=1 + fi + if echo "$INPUT" | grep -q \[\'\"\\\] ; then + echo 'Please use a pathname without the characters: '\'' " \' + elif [ ! "$NO_DIR_CHECK" -a ! -d "$INPUT" ] ; then + if exists "$INPUT" ; then + echo "$INPUT exists, but is not a directory!" + else + echo "$INPUT does not exist. Create it?" + echo -e $n "[\033[1;32my\033[0;37m] $c" + read YN + if [ "$YN" != "n" ] ; then + if mkdir -p "$INPUT" ; then + ok=1 + fi + fi + fi + else + ok=1 + fi + done + MODULE_DIR=$INPUT + echo "" + + +############################################################################### + + echo -e "Maximum number of clients at any one time (\033[1;32m1-$MAX_CLIENT\033[0;37m)?" + echo -e $n "[\033[1;32m$MAX_CLIENT\033[0;37m] -> $c" + read cc + if [ "$cc" ] ; then + if [ "$cc" > "$MAX_CLIENT" ] ; then + echo -e "Number entered was above the maximum allowed by your OS." + echo -e "Max clients was set to the highest possible value, \033[1;32m$MAX_CLIENT\033[0;37m" + else + MAX_CLIENT=$cc + fi + fi + echo "" + +############################################################################### + + echo "What is the Maximum length of nicknames?" + echo -e $n "[\033[1;32m$NICK_LENGT\033[0;37m] -> $c" + read cc + if [ "$cc" ] ; then + NICK_LENGT=$cc + fi + echo "" + +############################################################################### + + echo "What is the Maximum length of channel names?" + echo -e $n "[\033[1;32m$CHAN_LENGT\033[0;37m] -> $c" + read cc + if [ "$cc" ] ; then + CHAN_LENGT=$cc + fi + echo "" + +############################################################################### + + echo "What is the Maximum Number of channels a user may Join?" + echo -e $n "[\033[1;32m$MAX_CHANNE\033[0;37m] -> $c" + read cc + if [ "$cc" ] ; then + MAX_CHANNE_LENGT=$cc + fi + echo "" + +############################################################################### + + echo "What is the Maximum number of mode changes in one line?" + echo -e $n "[\033[1;32m$MAXI_MODES\033[0;37m] -> $c" + read cc + if [ "$cc" ] ; then + MAXI_MODES=$cc + fi + echo "" + +############################################################################### + + +echo -e "\033[1;32mPre-build configuration is complete!\033[0;37m" +echo "" +echo -e "\033[0;37mConfig path:\033[1;32m\t\t\t$CONFIG_DIR" +echo -e "\033[0;37mModule path:\033[1;32m\t\t\t$MODULE_DIR" +echo -e "\033[0;37mMax connections:\033[1;32m\t\t$MAX_CLIENT" +echo -e "\033[0;37mMax User Channels\033[1;32m\t\t$MAX_CHANNE" +echo -e "\033[0;37mMax nickname length:\033[1;32m\t\t$NICK_LENGT" +echo -e "\033[0;37mMax channel length:\033[1;32m\t\t$CHAN_LENGT" +echo -e "\033[0;37mMax mode length:\033[1;32m\t\t$MAXI_MODES" +echo -e "\033[0;37m" +echo "Writing inspircd_config.h ..." + + +echo "/* Auto generated by configure, do not modify! */" >inspircd_config.h +echo "" >>inspircd_config.h +echo "#define SYSLOG_FACILITY LOG_DAEMON" >>inspircd_config.h +echo "#define SYSLOG_LEVEL LOG_NOTICE" >>inspircd_config.h +echo "#define CONFIG_FILE \"$CONFIG_DIR/inspircd.conf\"" >>inspircd_config.h +echo "#define MOD_PATH \"$MODULE_DIR\"" >>inspircd_config.h +echo "#define VERSION \"`sh ./version.sh`\"" >>inspircd_config.h +echo "#define MAXCLIENTS $MAX_CLIENT" >>inspircd_config.h +echo "#define NICKMAX $NICK_LENGT" >>inspircd_config.h +echo "#define CHANMAX $CHAN_LENGT" >>inspircd_config.h +echo "#define MAXCHANS $MAX_CHANNE" >>inspircd_config.h +echo "#define MAXMODES $MAXI_MODES" >>inspircd_config.h +echo "#define SYSTEM \"`uname -n -s -r`\"" >>inspircd_config.h +echo "#define MAXBUF 514">>inspircd_config.h +echo "$MODULE_DIR">.modpath + +touch inspircd_config.h +rm -rf *.o core $MOD_PATH/*.so + +echo "" +echo -e "\033[1;32mDetecting modules...\033[0;37m" +MODLINE="" +for module in m_*.cpp ; do + mod=`perl -e '$a='$module';print substr($a,0,length($a)-3)'` + dmod=`perl -e '$a="'$mod'";while (length($a)<30) { $a = "$a ";}; print $a;'` + desc=`perl -e 'open (F, "<'$module'");local($/)=undef;$blah=<F>;$blah=~/\$ModDesc(.*)\*\//;print substr($1,13,length($1));close F;'` + echo -e "Found \033[1;32m$dmod\033[0;37m$desc" + MODLINE="$mod.so $MODLINE" +done +echo "" +echo -e "Module list: \033[1;32m$MODLINE\033[0;37m" +echo "" + + + +echo -e "Writing \033[1;37m${OSNAME}\033[0;37m makefile" + +cp -f Makefile.${OSNAME} Makefile + +echo "" +echo "Do you want to compile the IRCd binaries?" +echo -e $n "[\033[1;32my\033[0;37m] $c" +read YN +if [ "$YN" != "n" ] ; then + echo "" + echo -e "\033[1;32mCompiling...\033[0;37m" + echo "" + cd $ME + make + echo "" + echo "Done!" + echo "" +else + echo "" + echo "Done!" + echo "" + echo -e "To build your server with these settings, please type '\033[1;32mmake\033[0;37m' now." + echo "" + echo -e "*** \033[1;32mRemember to edit your configuration files!!!\033[0;37m ***" + echo "" +fi + + +echo "" +echo "Do you want to run the config file maker?" +echo -e $n "[\033[1;32my\033[0;37m] $c" +read YN +if [ "$YN" != "n" ] ; then + sh makeconf +fi + +echo -e "*** \033[1;32mRemember to edit your configuration files!!!\033[0;37m ***" +echo "" + diff --git a/docs/COPYING b/docs/COPYING new file mode 100644 index 000000000..a43ea2126 --- /dev/null +++ b/docs/COPYING @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 675 Mass Ave, Cambridge, MA 02139, USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + Appendix: How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + <one line to give the program's name and a brief idea of what it does.> + Copyright (C) 19yy <name of author> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) 19yy name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + <signature of Ty Coon>, 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/docs/ChangeLog b/docs/ChangeLog new file mode 100644 index 000000000..085f93e01 --- /dev/null +++ b/docs/ChangeLog @@ -0,0 +1,49 @@ +1.0 alpha 5 + +* Changed channel array to a hash_map similar to the one used for users, faster and more efficient +* Changed ./configure, no longer asks for hard channel limit (depreciated) +* Added support for users to be disconnected once MAXUSERS is reached +* Changed code a lot, major overhauls for C++ and STL use for added stability and speed +* Changed entire user system to use the hash_map container type instead of an array +* Added /TIME command +* Added /INFO command +* Added restart and die passwords +* Partially implemented /RESTART command +* Fixed amusing bug which allowed partially connected clients to issue commands under the context of other users! *gulp!* (reported again by Craig) +* Fixed SegFault caused when doing a /who 0 or /who * whilst not in channels (Reported by Craig, Fixed by Craig :p) +* Added /who 0 o to display online Opers (Craigs First Scratch of Code :p) +* Fixed Typo in LUSERS (Reported by MrBOFH and CC) +* Fixed Joining Channels withough a # bug. (Reported by MrBOFH) + + +1.0 alpha 4 + +* Fixed parameters bug discovered by Allan +* Fixed /NICK repeating bug found by piggles. +* Added /REHASH command +* Added /LUSERS command +* Added ability to kill -HUP to rehash +* Fixed lock up after ping timeout +* Added system to /VERSION +* Added DNS lookups on connect (*FIXME* this needs to be asyncronous!) +* Fixed IRCop status shown on wrong users +* Fixed socket linger option via setsockopt (can restart faster as sockets arent in use after shutdown!) +* Added operators can now see real userhost in WHOIS +* Added oper-up failed msg to online opers +* Changed layout of /motd command start numeric +* Fixed empty channels are now purged upon user quit +* Changed: support for WHO * as well as WHO 0 (do the same thing) +* Fixed ability to kick users when you arent on the channel :) +* Fixed grammatical error when halfop tries to kick an op, "You must be at least a half-operator" + + +1.0 alpha 3 + +* Fixed problem where nicks containing control codes were allowed +* Added support so that ircd honours channel mode +n +* Added support so that ircd honours channel mode +t +* Fixed linefeeds in middle of line bug (reported by Craig) +* Fixed buffer overflow in channel names (reported by Allan) +* Fixed close() on nonblocking sockets problem +* Added /KILL command >:) +* Added /KICK command diff --git a/docs/SUPPORTED b/docs/SUPPORTED new file mode 100644 index 000000000..c172ccf71 --- /dev/null +++ b/docs/SUPPORTED @@ -0,0 +1,62 @@ +As this release is ALPHA, not everything is supported. Because of this, this +document will show you the commands and modes that are supported in this +version. All commands listed below are as listed in request for comments (RFC) +number 1459, the original IRC documentation. Anything extra to this RFC +(with the exception of commands for loading plugins etc) will be a loadable +module and not implemented in the core. + +Unimplemented user commands: + + WHOWAS + +Unimplimented server to server commands: + + SERVER CONNECT + LINKS SQUIT + +Implemented commands: + + NICK USER + OPER QUIT + JOIN MODE + TOPIC NAMES + LIST KICK + VERSION STATS + TIME ADMIN + INFO PRIVMSG + NOTICE WHO + WHOIS KILL + PING PONG + AWAY REHASH + RESTART SUMMON + USERS WALLOPS + USERHOST ISON + INVITE PASS + TRACE + +------------------------------------------------------------------------------ + +CHANNEL MODES: i,m,n,t,k,l,p,s,o,h**,v +USER MODES: i,w,s,o + +------------------------------------------------------------------------------ + +* WARNING: In this Alpha, RESTART will not work, it will perform the same as /DIE + until implemented. + +** CHANNEL MODE h will be optional, and eventually be enabled or disabled by a stub + module. + +The following features are supported: + + * Dynamic module support + * Object orientated architecture to save memory and increase speed + * Connection multiplexing, one process for all (no forking!) + +The following operating systems are supported: + + * Linux (i386, possibly others) + Tested on: RedHat, Slackware + * FreeBSD (i386, possibly others) + Tested on: 4.7-STABLE + diff --git a/docs/inspircd.conf.example b/docs/inspircd.conf.example new file mode 100644 index 000000000..3402a2c60 --- /dev/null +++ b/docs/inspircd.conf.example @@ -0,0 +1,231 @@ +######################################################################## +# # +# --------------------------- # +# InspIRCd Configuration File # +# --------------------------- # +# # +##################################||#################################### + #||# +##################################||#################################### +# # +# This is an example of the config file for InspIRCd. # +# Change the options to suit your network # +# # +# Last updated on : 30/10/2002 # +# Written by : CC (cc@backchat.co.za) # +# # +######################################################################## + + + +#-#-#-#-#-#-#-#-#-#-#-#- SERVER DESCRIPTION -#-#-#-#-#-#-#-#-#-#-#-#- +# # +# Here is where you enter the information about your server. # +# # +# Syntax is as follows: # +# <server name="server.name" # +# description="Server Description" # +# network="MyNetwork"> # +# # + +<server name="penguin.omega.org.za" + description="Waddle World" + network="Omega"> + + +#-#-#-#-#-#-#-#-#-#-#-#- ADMIN INFORMATION -#-#-#-#-#-#-#-#-#-#-#-# +# # +# Describes the Server Administrator's real name, nick # +# and email address. # +# # +# Syntax is as follows: # +# <admin name="real name" # +# nick="nick name" # +# email="email@address.com"> # +# # + +<admin name="Johnny Casino" + nick="CC" + email="cc@monkeynut.co.za"> + + +#-#-#-#-#-#-#-#-#-#-#-#- PORT CONFIGURATION -#-#-#-#-#-#-#-#-#-#-#- +# # +# Enter the port and address bindings here. # +# # +# bind address - specifies which the address which ports bind # +# port - opens an unused port # +# # +# Leaving address empty binds to all available interfaces # +# # +# Syntax is as follows: # +# <bind address="ip number" port="port number"> # +# # + +<bind address="" port="6667"> +<bind address="" port="7000"> + + +#-#-#-#-#-#-#-#-#-#- DIE/RESTART CONFIGURATION -#-#-#-#-#-#-#-#-#-#- +# # +# You can configure the passwords here which you wish to use for # +# the die and restart commands. Only trusted ircops who will # +# need this ability should know the die and restart password. # +# # +# Syntax is as follows: # +# <power diepass="die password" restartpass="restart password" +# pause="secs before dying"> # +# # + +<power diepass="diepass" restartpass="restartpass" pause="2"> + + +#-#-#-#-#-#-#-#-#-#- CONNECTIONS CONFIGURATION -#-#-#-#-#-#-#-#-#-#- +# # +# This is where you can configure which connections are allowed # +# and denied access onto your server. # +# The password is optional. # +# You may have as many of these as you require. # +# To allow/deny all connections use a * # +# # +# Syntax is as follows: # +# <connect allow="ip number"> # +# <connect allow="ip number" password="blahblah"> # +# <connect deny="ip number"> # +# # + +<connect allow="196.12.*" password="tiffany"> +<connect allow="*"> + +<connect deny="69.254.*"> + + +#-#-#-#-#-#-#-#-#-#-#-#- CLASS CONFIGURATION -#-#-#-#-#-#-#-#-#-#-#- +# # +# Classes are a group of commands which are grouped together # +# and given a unique name. They used to define which commands # +# are available to certain types of Operators. # +# # +# Syntax is as follow: # +# <class name="name" commands="oper commands"> # +# # + +<class name="Shutdown" commands="DIE RESTART REHASH"> +<class name="ServerLink" commands="CONNECT SQUIT"> +<class name="BanControl" commands="KILL GLINE KLINE ZLINE QLINE SHUN"> +<class name="OperChat" commands="WALLOPS CHATOPS"> +<class name="HostCloak" commands="SETHOST SETIDENT SETNAME"> + + +#-#-#-#-#-#-#-#-#-#-#-#- OPERATOR COMPOSITION -#-#-#-#-#-#-#-#-#-#-# +# # +# This is where you specify which types of operators you have on # +# your server, as well as the commands they are allowed to use. # +# This works alongside with the classes specified above. # +# # +# type name - a name for the combined class types # +# classes - specified above, used for flexibility for the # +# server admin to decide on which operators get # +# what commands # +# host - hostmask operators will recieve on oper-up # +# # +# Syntax is as follows: # +# <type name="name" classes="class name" host="oper hostmask"> # +# # + +<type name="NetAdmin" classes="OperChat BanControl HostCloak Shutdown ServerLink" host="netadmin.omega.org.za"> +<type name="GlobalOp" classes="OperChat BanControl HostCloak ServerLink" host="ircop.omega.org.za"> +<type name="LocalOp" classes="OperChat BanControl HostCloak" host="local.omega.org.za"> +<type name="Helper" classes="HostCloak" host="helper.omega.org.za"> + + +#-#-#-#-#-#-#-#-#-#-#- OPERATOR CONFIGURATION -#-#-#-#-#-#-#-#-#-#-# +# # +# Opers are defined here. This is a very important section. # +# Remember to only make operators out of truthworthy people. # +# # +# name - oper name, best to use lower-case # +# password - password to oper-up, # +# encryption not yet available # +# host - host of client allowed to oper-up, more hostmasks # +# seperated by spaces, wildcards accepted # +# type - specified above, defines the kind of operator # +# # +# Syntax is as follows: # +# <oper name="login" # +# password="pass" # +# host="hostmask@of.oper" # +# type="oper type"> # +# # + +<oper name="cc" + password="s3cret" + host="*@*" + type="NetAdmin"> + + +#-#-#-#-#-#-#-#-#-#- MISCELLANEOUS CONFIGURATION -#-#-#-#-#-#-#-#-#- +# # +# These options let you define the path to your motd and rules # +# files. # +# # + +<files motd="/home/cc/inspircd-1.0/conf/inspire.motd" + rules="/home/cc/inspircd-1.0/conf/inspire.rules"> + + + +#-#-#-#-#-#-#-#-#-#-#-#-#-#-#- RTFM LINE -#-#-#-#-#-#-#-#-#-#-#-#-#-# +# # +# Just remove this... Its here to make you read ALL of the config # +# file options ;) # + +<die value="And god came down from the heavens and smote down the noob."> + + + +#-#-#-#-#-#-#-#-#-#-#-#-#- SERVER OPTIONS -#-#-#-#-#-#-#-#-#-#-#-#-# +# # +# Settings to define which features are useable on your server. # +# # +# prefixquit - a prefix for a client's quit message # +# debug - provides an in-depth log file, # +# this should not need to be enabled # +# allowhalfop - allows the +h channel mode # +# allowprotect - allows the +a channel mode # +# allowfounder - allows the +q channel mode # +# # + +<options prefixquit="Quit: " + debug="off" + allowhalfop="yes" + allowprotect="yes" + allowfounder="yes"> + + + +#-#-#-#-#-#-#-#-#-#-#-#-#- MODULE OPTIONS -#-#-#-#-#-#-#-#-#-#-#-#-# +# # +# These tags define which modules will be loaded on startup by your # +# server. Add modules without any paths. When you make your ircd # +# using the 'make' command, all compiled modules will be moved into # +# the folder you specified when you ran ./configure. The module tag # +# automatically looks for modules in this location. # + +<module name="m_foobar.so"> + + + +#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#- YAWN -#-#-#-#-#-#-#-#-#-#-#-#-#-#-# +# # +# You should already know what to do here :) # + +<die value="All l33t noobs must edit their configs."> + + +######################################################################### +# # +# -InspIRCd Development and Coding Team- # +# www.inspircd.org # +# # +######################################################################### diff --git a/docs/module-doc/annotated.html b/docs/module-doc/annotated.html new file mode 100644 index 000000000..5e88bcf06 --- /dev/null +++ b/docs/module-doc/annotated.html @@ -0,0 +1,32 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>Annotated Index</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.3-rc2 --> +<center> +<a class="qindex" href="main.html">Main Page</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center> +<hr><h1>InspIRCd Compound List</h1>Here are the classes, structs, unions and interfaces with brief descriptions:<table> + <tr><td class="indexkey"><a class="el" href="classAdmin.html">Admin</a></td><td class="indexvalue">Holds /ADMIN data This class contains the admin details of the local server</td></tr> + <tr><td class="indexkey"><a class="el" href="classBanItem.html">BanItem</a></td><td class="indexvalue">A subclass of <a class="el" href="classHostItem.html">HostItem</a> designed to hold channel bans (+b)</td></tr> + <tr><td class="indexkey"><a class="el" href="classchanrec.html">chanrec</a></td><td class="indexvalue">Holds all relevent information for a channel</td></tr> + <tr><td class="indexkey"><a class="el" href="classConfigReader.html">ConfigReader</a></td><td class="indexvalue">Allows reading of values from configuration files This class allows a module to read from either the main configuration file (inspircd.conf) or from a module-specified configuration file</td></tr> + <tr><td class="indexkey"><a class="el" href="classConnectClass.html">ConnectClass</a></td><td class="indexvalue">Holds information relevent to <connect allow> and <connect deny> tags in the config file</td></tr> + <tr><td class="indexkey"><a class="el" href="classExemptItem.html">ExemptItem</a></td><td class="indexvalue">A subclass of <a class="el" href="classHostItem.html">HostItem</a> designed to hold channel exempts (+e)</td></tr> + <tr><td class="indexkey"><a class="el" href="classFileReader.html">FileReader</a></td><td class="indexvalue">Caches a text file into memory and can be used to retrieve lines from it</td></tr> + <tr><td class="indexkey"><a class="el" href="classHostItem.html">HostItem</a></td><td class="indexvalue">Holds an entry for a ban list, exemption list, or invite list</td></tr> + <tr><td class="indexkey"><a class="el" href="classInvited.html">Invited</a></td><td class="indexvalue">Holds a channel name to which a user has been invited</td></tr> + <tr><td class="indexkey"><a class="el" href="classInviteItem.html">InviteItem</a></td><td class="indexvalue">A subclass of <a class="el" href="classHostItem.html">HostItem</a> designed to hold channel invites (+I)</td></tr> + <tr><td class="indexkey"><a class="el" href="classModule.html">Module</a></td><td class="indexvalue">Base class for all InspIRCd modules This class is the base class for InspIRCd modules</td></tr> + <tr><td class="indexkey"><a class="el" href="classModuleFactory.html">ModuleFactory</a></td><td class="indexvalue">Instantiates classes inherited from <a class="el" href="classModule.html">Module</a> This class creates a class inherited from type <a class="el" href="classModule.html">Module</a>, using new</td></tr> + <tr><td class="indexkey"><a class="el" href="classServer.html">Server</a></td><td class="indexvalue">Allows server output and query functions This class contains methods which allow a module to query the state of the irc server, and produce output to users and other servers</td></tr> + <tr><td class="indexkey"><a class="el" href="classucrec.html">ucrec</a></td><td class="indexvalue">Holds a user's modes on a channel This class associates a users privilages with a channel by creating a pointer link between a userrec and chanrec class</td></tr> + <tr><td class="indexkey"><a class="el" href="classuserrec.html">userrec</a></td><td class="indexvalue">Holds all information about a user This class stores all information about a user connected to the irc server</td></tr> + <tr><td class="indexkey"><a class="el" href="classVersion.html">Version</a></td><td class="indexvalue">Holds a module's Version information The four members (set by the constructor only) indicate details as to the version number of a module</td></tr> +</table> +<hr><address style="align: right;"><small>Generated on Wed Jan 22 20:56:47 2003 for InspIRCd by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border=0 +width=110 height=53></a>1.3-rc2 </small></address> +</body> +</html> diff --git a/docs/module-doc/channels_8h-source.html b/docs/module-doc/channels_8h-source.html new file mode 100644 index 000000000..ba7592c81 --- /dev/null +++ b/docs/module-doc/channels_8h-source.html @@ -0,0 +1,146 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>channels.h Source File</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.3-rc2 --> +<center> +<a class="qindex" href="main.html">Main Page</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center> +<hr><h1>channels.h</h1><a href="channels_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <span class="comment">/*</span> +00002 <span class="comment"></span> +00003 <span class="comment">$Log$ +00003 <span class="comment">Revision 1.1 2003/01/23 19:45:57 brain +00003 <span class="comment">Initial revision +00003 <span class="comment"> +00003 <span class="comment">Revision 1.6 2003/01/22 20:59:12 brain +00003 <span class="comment">Added FileReader class documentation +00003 <span class="comment"></span> +00004 <span class="comment">Revision 1.7 2003/01/22 00:44:26 brain</span> +00005 <span class="comment">Added documentation comments</span> +00006 <span class="comment"></span> +00007 <span class="comment">Revision 1.6 2003/01/21 21:11:17 brain</span> +00008 <span class="comment">Added documentation</span> +00009 <span class="comment"></span> +00010 <span class="comment">Revision 1.5 2003/01/16 20:11:55 brain</span> +00011 <span class="comment">fixed some ugly pointer bugs (thanks dblack and a|KK|y!)</span> +00012 <span class="comment"></span> +00013 <span class="comment">Revision 1.4 2003/01/15 22:47:44 brain</span> +00014 <span class="comment">Changed user and channel structs to classes (finally)</span> +00015 <span class="comment"></span> +00016 <span class="comment"> </span> +00017 <span class="comment">*/</span> +00018 +00019 <span class="preprocessor">#include "inspircd_config.h"</span> +00020 <span class="preprocessor">#include <time.h></span> +00021 <span class="preprocessor">#include <vector></span> +00022 +00023 <span class="preprocessor">#ifndef __CHANNELS_H__</span> +00024 <span class="preprocessor"></span><span class="preprocessor">#define __CHANNELS_H__</span> +00025 <span class="preprocessor"></span> +<a name="l00029"></a><a class="code" href="classHostItem.html">00029</a> <span class="keyword">class </span><a class="code" href="classHostItem.html">HostItem</a> +00030 { +00031 <span class="keyword">public</span>: +<a name="l00032"></a><a class="code" href="classHostItem.html#m0">00032</a> time_t <a class="code" href="classHostItem.html#m0">set_time</a>; +<a name="l00033"></a><a class="code" href="classHostItem.html#m1">00033</a> <span class="keywordtype">char</span> <a class="code" href="classHostItem.html#m1">set_by</a>[NICKMAX]; +<a name="l00034"></a><a class="code" href="classHostItem.html#m2">00034</a> <span class="keywordtype">char</span> <a class="code" href="classHostItem.html#m2">data</a>[MAXBUF]; +00035 +<a name="l00036"></a><a class="code" href="classHostItem.html#a0">00036</a> <a class="code" href="classHostItem.html#a0">HostItem</a>() { <span class="comment">/* stub */</span> } +<a name="l00037"></a><a class="code" href="classHostItem.html#a1">00037</a> <span class="keyword">virtual</span> <a class="code" href="classHostItem.html#a1">~HostItem</a>() { <span class="comment">/* stub */</span> } +00038 }; +00039 +00040 <span class="comment">// banlist is inherited from HostList mainly for readability</span> +00041 <span class="comment">// reasons only</span> +00042 +<a name="l00045"></a><a class="code" href="classBanItem.html">00045</a> <span class="keyword">class </span><a class="code" href="classBanItem.html">BanItem</a> : <span class="keyword">public</span> <a class="code" href="classHostItem.html">HostItem</a> +00046 { +00047 }; +00048 +00049 <span class="comment">// same with this...</span> +00050 +<a name="l00053"></a><a class="code" href="classExemptItem.html">00053</a> <span class="keyword">class </span><a class="code" href="classExemptItem.html">ExemptItem</a> : <span class="keyword">public</span> <a class="code" href="classHostItem.html">HostItem</a> +00054 { +00055 }; +00056 +00057 <span class="comment">// and this...</span> +00058 +<a name="l00061"></a><a class="code" href="classInviteItem.html">00061</a> <span class="keyword">class </span><a class="code" href="classInviteItem.html">InviteItem</a> : <span class="keyword">public</span> <a class="code" href="classHostItem.html">HostItem</a> +00062 { +00063 }; +00064 +00065 +<a name="l00068"></a><a class="code" href="channels_8h.html#a5">00068</a> <span class="keyword">typedef</span> vector<BanItem> <a class="code" href="channels_8h.html#a5">BanList</a>; +00069 +<a name="l00072"></a><a class="code" href="channels_8h.html#a6">00072</a> <span class="keyword">typedef</span> vector<ExemptItem> <a class="code" href="channels_8h.html#a6">ExemptList</a>; +00073 +<a name="l00076"></a><a class="code" href="channels_8h.html#a7">00076</a> <span class="keyword">typedef</span> vector<InviteItem> <a class="code" href="channels_8h.html#a7">InviteList</a>; +00077 +<a name="l00082"></a><a class="code" href="classchanrec.html">00082</a> <span class="keyword">class </span><a class="code" href="classchanrec.html">chanrec</a> +00083 { +00084 <span class="keyword">public</span>: +<a name="l00087"></a><a class="code" href="classchanrec.html#m0">00087</a> <span class="keywordtype">char</span> <a class="code" href="classchanrec.html#m0">name</a>[CHANMAX]; <span class="comment">/* channel name */</span> +<a name="l00091"></a><a class="code" href="classchanrec.html#m1">00091</a> <span class="keywordtype">char</span> <a class="code" href="classchanrec.html#m1">custom_modes</a>[MAXMODES]; <span class="comment">/* modes handled by modules */</span> +<a name="l00095"></a><a class="code" href="classchanrec.html#m2">00095</a> <span class="keywordtype">char</span> <a class="code" href="classchanrec.html#m2">topic</a>[MAXBUF]; +<a name="l00098"></a><a class="code" href="classchanrec.html#m3">00098</a> time_t <a class="code" href="classchanrec.html#m3">created</a>; +<a name="l00102"></a><a class="code" href="classchanrec.html#m4">00102</a> time_t <a class="code" href="classchanrec.html#m4">topicset</a>; +<a name="l00106"></a><a class="code" href="classchanrec.html#m5">00106</a> <span class="keywordtype">char</span> <a class="code" href="classchanrec.html#m5">setby</a>[NICKMAX]; +00107 +<a name="l00111"></a><a class="code" href="classchanrec.html#m6">00111</a> <span class="keywordtype">long</span> <a class="code" href="classchanrec.html#m6">limit</a>; +00112 +<a name="l00116"></a><a class="code" href="classchanrec.html#m7">00116</a> <span class="keywordtype">char</span> <a class="code" href="classchanrec.html#m7">key</a>[32]; +00117 +<a name="l00120"></a><a class="code" href="classchanrec.html#m8">00120</a> <span class="keywordtype">short</span> <span class="keywordtype">int</span> <a class="code" href="classchanrec.html#m8">topiclock</a>; +00121 +<a name="l00124"></a><a class="code" href="classchanrec.html#m9">00124</a> <span class="keywordtype">short</span> <span class="keywordtype">int</span> <a class="code" href="classchanrec.html#m9">noexternal</a>; +00125 +<a name="l00128"></a><a class="code" href="classchanrec.html#m10">00128</a> <span class="keywordtype">short</span> <span class="keywordtype">int</span> <a class="code" href="classchanrec.html#m10">inviteonly</a>; +00129 +<a name="l00132"></a><a class="code" href="classchanrec.html#m11">00132</a> <span class="keywordtype">short</span> <span class="keywordtype">int</span> <a class="code" href="classchanrec.html#m11">moderated</a>; +00133 +<a name="l00137"></a><a class="code" href="classchanrec.html#m12">00137</a> <span class="keywordtype">short</span> <span class="keywordtype">int</span> <a class="code" href="classchanrec.html#m12">secret</a>; +00138 +<a name="l00142"></a><a class="code" href="classchanrec.html#m13">00142</a> <span class="keywordtype">short</span> <span class="keywordtype">int</span> <a class="code" href="classchanrec.html#m13">c_private</a>; +00143 +<a name="l00146"></a><a class="code" href="classchanrec.html#m14">00146</a> <a class="code" href="channels_8h.html#a5">BanList</a> <a class="code" href="classchanrec.html#m14">bans</a>; +00147 +<a name="l00150"></a><a class="code" href="classchanrec.html#a0">00150</a> <a class="code" href="classchanrec.html#a0">chanrec</a>() +00151 { +00152 strcpy(name,<span class="stringliteral">""</span>); +00153 strcpy(custom_modes,<span class="stringliteral">""</span>); +00154 strcpy(topic,<span class="stringliteral">""</span>); +00155 strcpy(setby,<span class="stringliteral">""</span>); +00156 strcpy(key,<span class="stringliteral">""</span>); +00157 created = topicset = limit = 0; +00158 topiclock = noexternal = inviteonly = moderated = secret = c_private = <span class="keyword">false</span>; +00159 } +00160 +<a name="l00161"></a><a class="code" href="classchanrec.html#a1">00161</a> <span class="keyword">virtual</span> <a class="code" href="classchanrec.html#a1">~chanrec</a>() { <span class="comment">/* stub */</span> } +00162 }; +00163 +00164 <span class="comment">/* used to hold a channel and a users modes on that channel, e.g. +v, +h, +o</span> +00165 <span class="comment"> * needs to come AFTER struct chanrec */</span> +00166 +<a name="l00167"></a><a class="code" href="channels_8h.html#a0">00167</a> <span class="preprocessor">#define UCMODE_OP 1</span> +<a name="l00168"></a><a class="code" href="channels_8h.html#a1">00168</a> <span class="preprocessor"></span><span class="preprocessor">#define UCMODE_VOICE 2</span> +<a name="l00169"></a><a class="code" href="channels_8h.html#a2">00169</a> <span class="preprocessor"></span><span class="preprocessor">#define UCMODE_HOP 4</span> +<a name="l00170"></a><a class="code" href="channels_8h.html#a3">00170</a> <span class="preprocessor"></span><span class="preprocessor">#define UCMODE_PROTECT 8</span> +<a name="l00171"></a><a class="code" href="channels_8h.html#a4">00171</a> <span class="preprocessor"></span><span class="preprocessor">#define UCMODE_FOUNDER 16</span> +00172 <span class="preprocessor"></span> +<a name="l00178"></a><a class="code" href="classucrec.html">00178</a> <span class="keyword">class </span><a class="code" href="classucrec.html">ucrec</a> +00179 { +00180 <span class="keyword">public</span>: +<a name="l00184"></a><a class="code" href="classucrec.html#m0">00184</a> <span class="keywordtype">long</span> <a class="code" href="classucrec.html#m0">uc_modes</a>; +00185 +<a name="l00189"></a><a class="code" href="classucrec.html#m1">00189</a> <a class="code" href="classchanrec.html">chanrec</a> *<a class="code" href="classucrec.html#m1">channel</a>; +00190 +<a name="l00191"></a><a class="code" href="classucrec.html#a0">00191</a> <a class="code" href="classucrec.html#a0">ucrec</a>() { <span class="comment">/* stub */</span> } +<a name="l00192"></a><a class="code" href="classucrec.html#a1">00192</a> <span class="keyword">virtual</span> <a class="code" href="classucrec.html#a1">~ucrec</a>() { <span class="comment">/* stub */</span> } +00193 }; +00194 +00195 <span class="preprocessor">#endif</span> +00196 <span class="preprocessor"></span> +</pre></div><hr><address style="align: right;"><small>Generated on Wed Jan 22 20:56:46 2003 for InspIRCd by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border=0 +width=110 height=53></a>1.3-rc2 </small></address> +</body> +</html> diff --git a/docs/module-doc/channels_8h.html b/docs/module-doc/channels_8h.html new file mode 100644 index 000000000..1eadc5857 --- /dev/null +++ b/docs/module-doc/channels_8h.html @@ -0,0 +1,248 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>channels.h File Reference</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.3-rc2 --> +<center> +<a class="qindex" href="main.html">Main Page</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center> +<hr><h1>channels.h File Reference</h1><code>#include "inspircd_config.h"</code><br> +<code>#include <time.h></code><br> +<code>#include <vector></code><br> + +<p> +<a href="channels_8h-source.html">Go to the source code of this file.</a><table border=0 cellpadding=0 cellspacing=0> +<tr><td></td></tr> +<tr><td colspan=2><br><h2>Compounds</h2></td></tr> +<tr><td nowrap align=right valign=top>class </td><td valign=bottom><a class="el" href="classBanItem.html">BanItem</a></td></tr> +<tr><td> </td><td><font size=-1><em>A subclass of <a class="el" href="classHostItem.html">HostItem</a> designed to hold channel bans (+b).</em> <a href="classBanItem.html#_details">More...</a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>class </td><td valign=bottom><a class="el" href="classchanrec.html">chanrec</a></td></tr> +<tr><td> </td><td><font size=-1><em>Holds all relevent information for a channel.</em> <a href="classchanrec.html#_details">More...</a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>class </td><td valign=bottom><a class="el" href="classExemptItem.html">ExemptItem</a></td></tr> +<tr><td> </td><td><font size=-1><em>A subclass of <a class="el" href="classHostItem.html">HostItem</a> designed to hold channel exempts (+e).</em> <a href="classExemptItem.html#_details">More...</a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>class </td><td valign=bottom><a class="el" href="classHostItem.html">HostItem</a></td></tr> +<tr><td> </td><td><font size=-1><em>Holds an entry for a ban list, exemption list, or invite list.</em> <a href="classHostItem.html#_details">More...</a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>class </td><td valign=bottom><a class="el" href="classInviteItem.html">InviteItem</a></td></tr> +<tr><td> </td><td><font size=-1><em>A subclass of <a class="el" href="classHostItem.html">HostItem</a> designed to hold channel invites (+I).</em> <a href="classInviteItem.html#_details">More...</a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>class </td><td valign=bottom><a class="el" href="classucrec.html">ucrec</a></td></tr> +<tr><td> </td><td><font size=-1><em>Holds a user's modes on a channel This class associates a users privilages with a channel by creating a pointer link between a userrec and chanrec class.</em> <a href="classucrec.html#_details">More...</a><em></em></font><br><br></td></tr> +<tr><td colspan=2><br><h2>Defines</h2></td></tr> +<tr><td nowrap align=right valign=top>#define </td><td valign=bottom><a class="el" href="channels_8h.html#a0">UCMODE_OP</a> 1</td></tr> +<tr><td nowrap align=right valign=top>#define </td><td valign=bottom><a class="el" href="channels_8h.html#a1">UCMODE_VOICE</a> 2</td></tr> +<tr><td nowrap align=right valign=top>#define </td><td valign=bottom><a class="el" href="channels_8h.html#a2">UCMODE_HOP</a> 4</td></tr> +<tr><td nowrap align=right valign=top>#define </td><td valign=bottom><a class="el" href="channels_8h.html#a3">UCMODE_PROTECT</a> 8</td></tr> +<tr><td nowrap align=right valign=top>#define </td><td valign=bottom><a class="el" href="channels_8h.html#a4">UCMODE_FOUNDER</a> 16</td></tr> +<tr><td colspan=2><br><h2>Typedefs</h2></td></tr> +<tr><td nowrap align=right valign=top>typedef vector< <a class="el" href="classBanItem.html">BanItem</a> > </td><td valign=bottom><a class="el" href="channels_8h.html#a5">BanList</a></td></tr> +<tr><td> </td><td><font size=-1><em>Holds a complete ban list.</em> <a href="#a5"></a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>typedef vector< <a class="el" href="classExemptItem.html">ExemptItem</a> > </td><td valign=bottom><a class="el" href="channels_8h.html#a6">ExemptList</a></td></tr> +<tr><td> </td><td><font size=-1><em>Holds a complete exempt list.</em> <a href="#a6"></a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>typedef vector< <a class="el" href="classInviteItem.html">InviteItem</a> > </td><td valign=bottom><a class="el" href="channels_8h.html#a7">InviteList</a></td></tr> +<tr><td> </td><td><font size=-1><em>Holds a complete invite list.</em> <a href="#a7"></a><em></em></font><br><br></td></tr> +</table> +<hr><h2>Define Documentation</h2> +<a name="a4" doxytag="channels.h::UCMODE_FOUNDER"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> #define UCMODE_FOUNDER 16 + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="channels_8h-source.html#l00171">171</a> of file <a class="el" href="channels_8h-source.html">channels.h</a>. </td> + </tr> +</table> +<a name="a2" doxytag="channels.h::UCMODE_HOP"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> #define UCMODE_HOP 4 + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="channels_8h-source.html#l00169">169</a> of file <a class="el" href="channels_8h-source.html">channels.h</a>. </td> + </tr> +</table> +<a name="a0" doxytag="channels.h::UCMODE_OP"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> #define UCMODE_OP 1 + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="channels_8h-source.html#l00167">167</a> of file <a class="el" href="channels_8h-source.html">channels.h</a>. </td> + </tr> +</table> +<a name="a3" doxytag="channels.h::UCMODE_PROTECT"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> #define UCMODE_PROTECT 8 + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="channels_8h-source.html#l00170">170</a> of file <a class="el" href="channels_8h-source.html">channels.h</a>. </td> + </tr> +</table> +<a name="a1" doxytag="channels.h::UCMODE_VOICE"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> #define UCMODE_VOICE 2 + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="channels_8h-source.html#l00168">168</a> of file <a class="el" href="channels_8h-source.html">channels.h</a>. </td> + </tr> +</table> +<hr><h2>Typedef Documentation</h2> +<a name="a5" doxytag="channels.h::BanList"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> typedef vector<<a class="el" href="classBanItem.html">BanItem</a>> BanList + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Holds a complete ban list. +<p> + +<p> +Definition at line <a class="el" href="channels_8h-source.html#l00068">68</a> of file <a class="el" href="channels_8h-source.html">channels.h</a>. </td> + </tr> +</table> +<a name="a6" doxytag="channels.h::ExemptList"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> typedef vector<<a class="el" href="classExemptItem.html">ExemptItem</a>> ExemptList + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Holds a complete exempt list. +<p> + +<p> +Definition at line <a class="el" href="channels_8h-source.html#l00072">72</a> of file <a class="el" href="channels_8h-source.html">channels.h</a>. </td> + </tr> +</table> +<a name="a7" doxytag="channels.h::InviteList"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> typedef vector<<a class="el" href="classInviteItem.html">InviteItem</a>> InviteList + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Holds a complete invite list. +<p> + +<p> +Definition at line <a class="el" href="channels_8h-source.html#l00076">76</a> of file <a class="el" href="channels_8h-source.html">channels.h</a>. </td> + </tr> +</table> +<hr><address style="align: right;"><small>Generated on Wed Jan 22 20:56:47 2003 for InspIRCd by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border=0 +width=110 height=53></a>1.3-rc2 </small></address> +</body> +</html> diff --git a/docs/module-doc/classAdmin-members.html b/docs/module-doc/classAdmin-members.html new file mode 100644 index 000000000..39b406601 --- /dev/null +++ b/docs/module-doc/classAdmin-members.html @@ -0,0 +1,19 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>Member List</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.3-rc2 --> +<center> +<a class="qindex" href="main.html">Main Page</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center> +<hr><h1>Admin Member List</h1>This is the complete list of members for <a class="el" href="classAdmin.html">Admin</a>, including all inherited members.<table> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classAdmin.html#a0">Admin</a>(string name, string email, string nick)</td><td><a class="el" href="classAdmin.html">Admin</a></td><td></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classAdmin.html#m1">Email</a></td><td><a class="el" href="classAdmin.html">Admin</a></td><td></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classAdmin.html#m0">Name</a></td><td><a class="el" href="classAdmin.html">Admin</a></td><td></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classAdmin.html#m2">Nick</a></td><td><a class="el" href="classAdmin.html">Admin</a></td><td></td></tr> +</table><hr><address style="align: right;"><small>Generated on Wed Jan 22 20:56:47 2003 for InspIRCd by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border=0 +width=110 height=53></a>1.3-rc2 </small></address> +</body> +</html> diff --git a/docs/module-doc/classAdmin.html b/docs/module-doc/classAdmin.html new file mode 100644 index 000000000..663193311 --- /dev/null +++ b/docs/module-doc/classAdmin.html @@ -0,0 +1,160 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>Admin class Reference</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.3-rc2 --> +<center> +<a class="qindex" href="main.html">Main Page</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center> +<hr><h1>Admin Class Reference</h1>Holds /ADMIN data This class contains the admin details of the local server. +<a href="#_details">More...</a> +<p> +<code>#include <<a class="el" href="modules_8h-source.html">modules.h</a>></code> +<p> +<a href="classAdmin-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0> +<tr><td></td></tr> +<tr><td colspan=2><br><h2>Public Methods</h2></td></tr> +<tr><td nowrap align=right valign=top> </td><td valign=bottom><a class="el" href="classAdmin.html#a0">Admin</a> (string name, string email, string nick)</td></tr> +<tr><td colspan=2><br><h2>Public Attributes</h2></td></tr> +<tr><td nowrap align=right valign=top>const string </td><td valign=bottom><a class="el" href="classAdmin.html#m0">Name</a></td></tr> +<tr><td nowrap align=right valign=top>const string </td><td valign=bottom><a class="el" href="classAdmin.html#m1">Email</a></td></tr> +<tr><td nowrap align=right valign=top>const string </td><td valign=bottom><a class="el" href="classAdmin.html#m2">Nick</a></td></tr> +</table> +<hr><a name="_details"></a><h2>Detailed Description</h2> +Holds /ADMIN data This class contains the admin details of the local server. +<p> +It is constructed by class <a class="el" href="classServer.html">Server</a>, and has three read-only values, Name, Email and Nick that contain the specified values for the server where the module is running. +<p> + +<p> +Definition at line <a class="el" href="modules_8h-source.html#l00067">67</a> of file <a class="el" href="modules_8h-source.html">modules.h</a>.<hr><h2>Constructor & Destructor Documentation</h2> +<a name="a0" doxytag="Admin::Admin"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> Admin::Admin </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">string </td> + <td class="mdname" nowrap> <em>name</em>, </td> + </tr> + <tr> + <td></td> + <td></td> + <td class="md" nowrap>string </td> + <td class="mdname" nowrap> <em>email</em>, </td> + </tr> + <tr> + <td></td> + <td></td> + <td class="md" nowrap>string </td> + <td class="mdname" nowrap> <em>nick</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="modules_8cpp-source.html#l00033">33</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>. +<p> +<div class="fragment"><pre>00033 : <a class="code" href="classAdmin.html#m0">Name</a>(name), <a class="code" href="classAdmin.html#m1">Email</a>(email), <a class="code" href="classAdmin.html#m2">Nick</a>(nick) { }; +</pre></div> </td> + </tr> +</table> +<hr><h2>Member Data Documentation</h2> +<a name="m1" doxytag="Admin::Email"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> const string Admin::Email + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="modules_8h-source.html#l00070">70</a> of file <a class="el" href="modules_8h-source.html">modules.h</a>. </td> + </tr> +</table> +<a name="m0" doxytag="Admin::Name"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> const string Admin::Name + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="modules_8h-source.html#l00070">70</a> of file <a class="el" href="modules_8h-source.html">modules.h</a>. </td> + </tr> +</table> +<a name="m2" doxytag="Admin::Nick"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> const string Admin::Nick + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="modules_8h-source.html#l00070">70</a> of file <a class="el" href="modules_8h-source.html">modules.h</a>. </td> + </tr> +</table> +<hr>The documentation for this class was generated from the following files:<ul> +<li><a class="el" href="modules_8h-source.html">modules.h</a><li><a class="el" href="modules_8cpp-source.html">modules.cpp</a></ul> +<hr><address style="align: right;"><small>Generated on Wed Jan 22 20:56:47 2003 for InspIRCd by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border=0 +width=110 height=53></a>1.3-rc2 </small></address> +</body> +</html> diff --git a/docs/module-doc/classBanItem-members.html b/docs/module-doc/classBanItem-members.html new file mode 100644 index 000000000..11295cdc7 --- /dev/null +++ b/docs/module-doc/classBanItem-members.html @@ -0,0 +1,20 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>Member List</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.3-rc2 --> +<center> +<a class="qindex" href="main.html">Main Page</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center> +<hr><h1>BanItem Member List</h1>This is the complete list of members for <a class="el" href="classBanItem.html">BanItem</a>, including all inherited members.<table> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classHostItem.html#m2">data</a></td><td><a class="el" href="classHostItem.html">HostItem</a></td><td></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classHostItem.html#a0">HostItem</a>()</td><td><a class="el" href="classHostItem.html">HostItem</a></td><td><code> [inline]</code></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classHostItem.html#m1">set_by</a></td><td><a class="el" href="classHostItem.html">HostItem</a></td><td></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classHostItem.html#m0">set_time</a></td><td><a class="el" href="classHostItem.html">HostItem</a></td><td></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classHostItem.html#a1">~HostItem</a>()</td><td><a class="el" href="classHostItem.html">HostItem</a></td><td><code> [inline, virtual]</code></td></tr> +</table><hr><address style="align: right;"><small>Generated on Wed Jan 22 20:56:47 2003 for InspIRCd by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border=0 +width=110 height=53></a>1.3-rc2 </small></address> +</body> +</html> diff --git a/docs/module-doc/classBanItem.html b/docs/module-doc/classBanItem.html new file mode 100644 index 000000000..194010968 --- /dev/null +++ b/docs/module-doc/classBanItem.html @@ -0,0 +1,34 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>BanItem class Reference</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.3-rc2 --> +<center> +<a class="qindex" href="main.html">Main Page</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center> +<hr><h1>BanItem Class Reference</h1>A subclass of <a class="el" href="classHostItem.html">HostItem</a> designed to hold channel bans (+b). +<a href="#_details">More...</a> +<p> +<code>#include <<a class="el" href="channels_8h-source.html">channels.h</a>></code> +<p> +<p>Inheritance diagram for BanItem: +<p><center><img src="classBanItem.png" usemap="#BanItem_map" border="0" alt=""></center> +<map name="BanItem_map"> +<area href="classHostItem.html" alt="HostItem" shape="rect" coords="0,0,59,24"> +</map> +<a href="classBanItem-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0> +<tr><td></td></tr> +</table> +<hr><a name="_details"></a><h2>Detailed Description</h2> +A subclass of <a class="el" href="classHostItem.html">HostItem</a> designed to hold channel bans (+b). +<p> + +<p> +Definition at line <a class="el" href="channels_8h-source.html#l00045">45</a> of file <a class="el" href="channels_8h-source.html">channels.h</a>.<hr>The documentation for this class was generated from the following file:<ul> +<li><a class="el" href="channels_8h-source.html">channels.h</a></ul> +<hr><address style="align: right;"><small>Generated on Wed Jan 22 20:56:47 2003 for InspIRCd by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border=0 +width=110 height=53></a>1.3-rc2 </small></address> +</body> +</html> diff --git a/docs/module-doc/classBanItem.png b/docs/module-doc/classBanItem.png Binary files differnew file mode 100644 index 000000000..e0a7f35b2 --- /dev/null +++ b/docs/module-doc/classBanItem.png diff --git a/docs/module-doc/classConfigReader-members.html b/docs/module-doc/classConfigReader-members.html new file mode 100644 index 000000000..d27bbd43e --- /dev/null +++ b/docs/module-doc/classConfigReader-members.html @@ -0,0 +1,22 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>Member List</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.3-rc2 --> +<center> +<a class="qindex" href="main.html">Main Page</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center> +<hr><h1>ConfigReader Member List</h1>This is the complete list of members for <a class="el" href="classConfigReader.html">ConfigReader</a>, including all inherited members.<table> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classConfigReader.html#a0">ConfigReader</a>()</td><td><a class="el" href="classConfigReader.html">ConfigReader</a></td><td></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classConfigReader.html#a1">ConfigReader</a>(string filename)</td><td><a class="el" href="classConfigReader.html">ConfigReader</a></td><td></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classConfigReader.html#a4">Enumerate</a>(string tag)</td><td><a class="el" href="classConfigReader.html">ConfigReader</a></td><td></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classConfigReader.html#n0">fname</a></td><td><a class="el" href="classConfigReader.html">ConfigReader</a></td><td><code> [protected]</code></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classConfigReader.html#a3">ReadValue</a>(string tag, string name, int index)</td><td><a class="el" href="classConfigReader.html">ConfigReader</a></td><td></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classConfigReader.html#a5">Verify</a>()</td><td><a class="el" href="classConfigReader.html">ConfigReader</a></td><td></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classConfigReader.html#a2">~ConfigReader</a>()</td><td><a class="el" href="classConfigReader.html">ConfigReader</a></td><td></td></tr> +</table><hr><address style="align: right;"><small>Generated on Wed Jan 22 20:56:47 2003 for InspIRCd by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border=0 +width=110 height=53></a>1.3-rc2 </small></address> +</body> +</html> diff --git a/docs/module-doc/classConfigReader.html b/docs/module-doc/classConfigReader.html new file mode 100644 index 000000000..f0221a1a1 --- /dev/null +++ b/docs/module-doc/classConfigReader.html @@ -0,0 +1,324 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>ConfigReader class Reference</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.3-rc2 --> +<center> +<a class="qindex" href="main.html">Main Page</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center> +<hr><h1>ConfigReader Class Reference</h1>Allows reading of values from configuration files This class allows a module to read from either the main configuration file (inspircd.conf) or from a module-specified configuration file. +<a href="#_details">More...</a> +<p> +<code>#include <<a class="el" href="modules_8h-source.html">modules.h</a>></code> +<p> +<a href="classConfigReader-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0> +<tr><td></td></tr> +<tr><td colspan=2><br><h2>Public Methods</h2></td></tr> +<tr><td nowrap align=right valign=top> </td><td valign=bottom><a class="el" href="classConfigReader.html#a0">ConfigReader</a> ()</td></tr> +<tr><td> </td><td><font size=-1><em>Default constructor.</em> <a href="#a0"></a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top> </td><td valign=bottom><a class="el" href="classConfigReader.html#a1">ConfigReader</a> (string filename)</td></tr> +<tr><td> </td><td><font size=-1><em>Overloaded constructor.</em> <a href="#a1"></a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top> </td><td valign=bottom><a class="el" href="classConfigReader.html#a2">~ConfigReader</a> ()</td></tr> +<tr><td> </td><td><font size=-1><em>Default destructor.</em> <a href="#a2"></a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>string </td><td valign=bottom><a class="el" href="classConfigReader.html#a3">ReadValue</a> (string tag, string name, int index)</td></tr> +<tr><td> </td><td><font size=-1><em>Retrieves a value from the config file.</em> <a href="#a3"></a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>int </td><td valign=bottom><a class="el" href="classConfigReader.html#a4">Enumerate</a> (string tag)</td></tr> +<tr><td> </td><td><font size=-1><em>Counts the number of times a given tag appears in the config file.</em> <a href="#a4"></a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>bool </td><td valign=bottom><a class="el" href="classConfigReader.html#a5">Verify</a> ()</td></tr> +<tr><td> </td><td><font size=-1><em>Returns true if a config file is valid.</em> <a href="#a5"></a><em></em></font><br><br></td></tr> +<tr><td colspan=2><br><h2>Protected Attributes</h2></td></tr> +<tr><td nowrap align=right valign=top>string </td><td valign=bottom><a class="el" href="classConfigReader.html#n0">fname</a></td></tr> +<tr><td> </td><td><font size=-1><em>The filename of the configuration file, as set by the constructor.</em> <a href="#n0"></a><em></em></font><br><br></td></tr> +</table> +<hr><a name="_details"></a><h2>Detailed Description</h2> +Allows reading of values from configuration files This class allows a module to read from either the main configuration file (inspircd.conf) or from a module-specified configuration file. +<p> +It may either be instantiated with one parameter or none. Constructing the class using one parameter allows you to specify a path to your own configuration file, otherwise, inspircd.conf is read. +<p> + +<p> +Definition at line <a class="el" href="modules_8h-source.html#l00226">226</a> of file <a class="el" href="modules_8h-source.html">modules.h</a>.<hr><h2>Constructor & Destructor Documentation</h2> +<a name="a0" doxytag="ConfigReader::ConfigReader"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> ConfigReader::ConfigReader </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top">) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Default constructor. +<p> +This constructor initialises the ConfigReader class to read the inspircd.conf file as specified when running ./configure. +<p> +Definition at line <a class="el" href="modules_8cpp-source.html#l00161">161</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>. +<p> +References <a class="el" href="modules_8h-source.html#l00231">fname</a>. +<p> +<div class="fragment"><pre>00162 { +00163 <a class="code" href="classConfigReader.html#n0">fname</a> = CONFIG_FILE; +00164 } +</pre></div> </td> + </tr> +</table> +<a name="a1" doxytag="ConfigReader::ConfigReader"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> ConfigReader::ConfigReader </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">string </td> + <td class="mdname1" valign="top" nowrap> <em>filename</em> </td> + <td class="md" valign="top">) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Overloaded constructor. +<p> +This constructor initialises the ConfigReader class to read a user-specified config file +<p> +Definition at line <a class="el" href="modules_8cpp-source.html#l00172">172</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>. +<p> +<div class="fragment"><pre>00172 : <a class="code" href="classConfigReader.html#n0">fname</a>(filename) { }; +</pre></div> </td> + </tr> +</table> +<a name="a2" doxytag="ConfigReader::~ConfigReader"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> ConfigReader::~ConfigReader </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top">) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Default destructor. +<p> +This method destroys the ConfigReader class. +<p> +Definition at line <a class="el" href="modules_8cpp-source.html#l00167">167</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>. +<p> +<div class="fragment"><pre>00168 { +00169 } +</pre></div> </td> + </tr> +</table> +<hr><h2>Member Function Documentation</h2> +<a name="a4" doxytag="ConfigReader::Enumerate"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> int ConfigReader::Enumerate </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">string </td> + <td class="mdname1" valign="top" nowrap> <em>tag</em> </td> + <td class="md" valign="top">) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Counts the number of times a given tag appears in the config file. +<p> +This method counts the number of times a tag appears in a config file, for use where there are several tags of the same kind, e.g. with opers and connect types. It can be used with the index value of <a class="el" href="classConfigReader.html#a3">ConfigReader::ReadValue</a> to loop through all copies of a multiple instance tag. +<p> +Definition at line <a class="el" href="modules_8cpp-source.html#l00183">183</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>. +<p> +References <a class="el" href="modules_8h-source.html#l00231">fname</a>. +<p> +<div class="fragment"><pre>00184 { +00185 <span class="keywordflow">return</span> EnumConf(<a class="code" href="classConfigReader.html#n0">fname</a>.c_str(),tag.c_str()); +00186 } +</pre></div> </td> + </tr> +</table> +<a name="a3" doxytag="ConfigReader::ReadValue"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> string ConfigReader::ReadValue </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">string </td> + <td class="mdname" nowrap> <em>tag</em>, </td> + </tr> + <tr> + <td></td> + <td></td> + <td class="md" nowrap>string </td> + <td class="mdname" nowrap> <em>name</em>, </td> + </tr> + <tr> + <td></td> + <td></td> + <td class="md" nowrap>int </td> + <td class="mdname" nowrap> <em>index</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Retrieves a value from the config file. +<p> +This method retrieves a value from the config file. Where multiple copies of the tag exist in the config file, index indicates which of the values to retrieve. +<p> +Definition at line <a class="el" href="modules_8cpp-source.html#l00174">174</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>. +<p> +References <a class="el" href="modules_8h-source.html#l00231">fname</a>. +<p> +<div class="fragment"><pre>00175 { +00176 <span class="keywordtype">char</span> val[MAXBUF]; +00177 ReadConf(<a class="code" href="classConfigReader.html#n0">fname</a>.c_str(),tag.c_str(),name.c_str(),index,val); +00178 string s = val; +00179 <span class="keywordflow">return</span> s; +00180 } +</pre></div> </td> + </tr> +</table> +<a name="a5" doxytag="ConfigReader::Verify"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> bool ConfigReader::Verify </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top">) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Returns true if a config file is valid. +<p> +This method is unimplemented and will always return true. +<p> +Definition at line <a class="el" href="modules_8cpp-source.html#l00189">189</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>. +<p> +<div class="fragment"><pre>00190 { +00191 <span class="keywordflow">return</span> <span class="keyword">true</span>; +00192 } +</pre></div> </td> + </tr> +</table> +<hr><h2>Member Data Documentation</h2> +<a name="n0" doxytag="ConfigReader::fname"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> string ConfigReader::fname<code> [protected]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +The filename of the configuration file, as set by the constructor. +<p> + +<p> +Definition at line <a class="el" href="modules_8h-source.html#l00231">231</a> of file <a class="el" href="modules_8h-source.html">modules.h</a>. +<p> +Referenced by <a class="el" href="modules_8cpp-source.html#l00161">ConfigReader()</a>, <a class="el" href="modules_8cpp-source.html#l00183">Enumerate()</a>, and <a class="el" href="modules_8cpp-source.html#l00174">ReadValue()</a>. </td> + </tr> +</table> +<hr>The documentation for this class was generated from the following files:<ul> +<li><a class="el" href="modules_8h-source.html">modules.h</a><li><a class="el" href="modules_8cpp-source.html">modules.cpp</a></ul> +<hr><address style="align: right;"><small>Generated on Wed Jan 22 20:56:47 2003 for InspIRCd by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border=0 +width=110 height=53></a>1.3-rc2 </small></address> +</body> +</html> diff --git a/docs/module-doc/classConnectClass-members.html b/docs/module-doc/classConnectClass-members.html new file mode 100644 index 000000000..f8b7a913a --- /dev/null +++ b/docs/module-doc/classConnectClass-members.html @@ -0,0 +1,18 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>Member List</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.3-rc2 --> +<center> +<a class="qindex" href="main.html">Main Page</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center> +<hr><h1>ConnectClass Member List</h1>This is the complete list of members for <a class="el" href="classConnectClass.html">ConnectClass</a>, including all inherited members.<table> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classConnectClass.html#m1">host</a></td><td><a class="el" href="classConnectClass.html">ConnectClass</a></td><td></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classConnectClass.html#m2">pass</a></td><td><a class="el" href="classConnectClass.html">ConnectClass</a></td><td></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classConnectClass.html#m0">type</a></td><td><a class="el" href="classConnectClass.html">ConnectClass</a></td><td></td></tr> +</table><hr><address style="align: right;"><small>Generated on Wed Jan 22 20:56:47 2003 for InspIRCd by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border=0 +width=110 height=53></a>1.3-rc2 </small></address> +</body> +</html> diff --git a/docs/module-doc/classConnectClass.html b/docs/module-doc/classConnectClass.html new file mode 100644 index 000000000..7fd64062e --- /dev/null +++ b/docs/module-doc/classConnectClass.html @@ -0,0 +1,106 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>ConnectClass class Reference</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.3-rc2 --> +<center> +<a class="qindex" href="main.html">Main Page</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center> +<hr><h1>ConnectClass Class Reference</h1>Holds information relevent to <connect allow> and <connect deny> tags in the config file. +<a href="#_details">More...</a> +<p> +<code>#include <<a class="el" href="users_8h-source.html">users.h</a>></code> +<p> +<a href="classConnectClass-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0> +<tr><td></td></tr> +<tr><td colspan=2><br><h2>Public Attributes</h2></td></tr> +<tr><td nowrap align=right valign=top>int </td><td valign=bottom><a class="el" href="classConnectClass.html#m0">type</a></td></tr> +<tr><td nowrap align=right valign=top>char </td><td valign=bottom><a class="el" href="classConnectClass.html#m1">host</a> [MAXBUF]</td></tr> +<tr><td nowrap align=right valign=top>char </td><td valign=bottom><a class="el" href="classConnectClass.html#m2">pass</a> [MAXBUF]</td></tr> +</table> +<hr><a name="_details"></a><h2>Detailed Description</h2> +Holds information relevent to <connect allow> and <connect deny> tags in the config file. +<p> + +<p> +Definition at line <a class="el" href="users_8h-source.html#l00056">56</a> of file <a class="el" href="users_8h-source.html">users.h</a>.<hr><h2>Member Data Documentation</h2> +<a name="m1" doxytag="ConnectClass::host"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> char ConnectClass::host[MAXBUF] + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="users_8h-source.html#l00060">60</a> of file <a class="el" href="users_8h-source.html">users.h</a>. </td> + </tr> +</table> +<a name="m2" doxytag="ConnectClass::pass"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> char ConnectClass::pass[MAXBUF] + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="users_8h-source.html#l00061">61</a> of file <a class="el" href="users_8h-source.html">users.h</a>. </td> + </tr> +</table> +<a name="m0" doxytag="ConnectClass::type"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> int ConnectClass::type + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="users_8h-source.html#l00059">59</a> of file <a class="el" href="users_8h-source.html">users.h</a>. </td> + </tr> +</table> +<hr>The documentation for this class was generated from the following file:<ul> +<li><a class="el" href="users_8h-source.html">users.h</a></ul> +<hr><address style="align: right;"><small>Generated on Wed Jan 22 20:56:47 2003 for InspIRCd by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border=0 +width=110 height=53></a>1.3-rc2 </small></address> +</body> +</html> diff --git a/docs/module-doc/classExemptItem-members.html b/docs/module-doc/classExemptItem-members.html new file mode 100644 index 000000000..37ac533e3 --- /dev/null +++ b/docs/module-doc/classExemptItem-members.html @@ -0,0 +1,20 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>Member List</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.3-rc2 --> +<center> +<a class="qindex" href="main.html">Main Page</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center> +<hr><h1>ExemptItem Member List</h1>This is the complete list of members for <a class="el" href="classExemptItem.html">ExemptItem</a>, including all inherited members.<table> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classHostItem.html#m2">data</a></td><td><a class="el" href="classHostItem.html">HostItem</a></td><td></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classHostItem.html#a0">HostItem</a>()</td><td><a class="el" href="classHostItem.html">HostItem</a></td><td><code> [inline]</code></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classHostItem.html#m1">set_by</a></td><td><a class="el" href="classHostItem.html">HostItem</a></td><td></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classHostItem.html#m0">set_time</a></td><td><a class="el" href="classHostItem.html">HostItem</a></td><td></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classHostItem.html#a1">~HostItem</a>()</td><td><a class="el" href="classHostItem.html">HostItem</a></td><td><code> [inline, virtual]</code></td></tr> +</table><hr><address style="align: right;"><small>Generated on Wed Jan 22 20:56:48 2003 for InspIRCd by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border=0 +width=110 height=53></a>1.3-rc2 </small></address> +</body> +</html> diff --git a/docs/module-doc/classExemptItem.html b/docs/module-doc/classExemptItem.html new file mode 100644 index 000000000..de865231d --- /dev/null +++ b/docs/module-doc/classExemptItem.html @@ -0,0 +1,34 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>ExemptItem class Reference</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.3-rc2 --> +<center> +<a class="qindex" href="main.html">Main Page</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center> +<hr><h1>ExemptItem Class Reference</h1>A subclass of <a class="el" href="classHostItem.html">HostItem</a> designed to hold channel exempts (+e). +<a href="#_details">More...</a> +<p> +<code>#include <<a class="el" href="channels_8h-source.html">channels.h</a>></code> +<p> +<p>Inheritance diagram for ExemptItem: +<p><center><img src="classExemptItem.png" usemap="#ExemptItem_map" border="0" alt=""></center> +<map name="ExemptItem_map"> +<area href="classHostItem.html" alt="HostItem" shape="rect" coords="0,0,74,24"> +</map> +<a href="classExemptItem-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0> +<tr><td></td></tr> +</table> +<hr><a name="_details"></a><h2>Detailed Description</h2> +A subclass of <a class="el" href="classHostItem.html">HostItem</a> designed to hold channel exempts (+e). +<p> + +<p> +Definition at line <a class="el" href="channels_8h-source.html#l00053">53</a> of file <a class="el" href="channels_8h-source.html">channels.h</a>.<hr>The documentation for this class was generated from the following file:<ul> +<li><a class="el" href="channels_8h-source.html">channels.h</a></ul> +<hr><address style="align: right;"><small>Generated on Wed Jan 22 20:56:48 2003 for InspIRCd by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border=0 +width=110 height=53></a>1.3-rc2 </small></address> +</body> +</html> diff --git a/docs/module-doc/classExemptItem.png b/docs/module-doc/classExemptItem.png Binary files differnew file mode 100644 index 000000000..6aa67a9ef --- /dev/null +++ b/docs/module-doc/classExemptItem.png diff --git a/docs/module-doc/classFileReader-members.html b/docs/module-doc/classFileReader-members.html new file mode 100644 index 000000000..e61cf78d8 --- /dev/null +++ b/docs/module-doc/classFileReader-members.html @@ -0,0 +1,22 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>Member List</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.3-rc2 --> +<center> +<a class="qindex" href="main.html">Main Page</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center> +<hr><h1>FileReader Member List</h1>This is the complete list of members for <a class="el" href="classFileReader.html">FileReader</a>, including all inherited members.<table> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classFileReader.html#o0">fc</a></td><td><a class="el" href="classFileReader.html">FileReader</a></td><td><code> [private]</code></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classFileReader.html#a0">FileReader</a>()</td><td><a class="el" href="classFileReader.html">FileReader</a></td><td></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classFileReader.html#a1">FileReader</a>(string filename)</td><td><a class="el" href="classFileReader.html">FileReader</a></td><td></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classFileReader.html#a5">FileSize</a>()</td><td><a class="el" href="classFileReader.html">FileReader</a></td><td></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classFileReader.html#a4">GetLine</a>(int x)</td><td><a class="el" href="classFileReader.html">FileReader</a></td><td></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classFileReader.html#a3">LoadFile</a>(string filename)</td><td><a class="el" href="classFileReader.html">FileReader</a></td><td></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classFileReader.html#a2">~FileReader</a>()</td><td><a class="el" href="classFileReader.html">FileReader</a></td><td></td></tr> +</table><hr><address style="align: right;"><small>Generated on Wed Jan 22 20:56:48 2003 for InspIRCd by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border=0 +width=110 height=53></a>1.3-rc2 </small></address> +</body> +</html> diff --git a/docs/module-doc/classFileReader.html b/docs/module-doc/classFileReader.html new file mode 100644 index 000000000..ee84a6d74 --- /dev/null +++ b/docs/module-doc/classFileReader.html @@ -0,0 +1,312 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>FileReader class Reference</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.3-rc2 --> +<center> +<a class="qindex" href="main.html">Main Page</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center> +<hr><h1>FileReader Class Reference</h1>Caches a text file into memory and can be used to retrieve lines from it. +<a href="#_details">More...</a> +<p> +<code>#include <<a class="el" href="modules_8h-source.html">modules.h</a>></code> +<p> +<a href="classFileReader-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0> +<tr><td></td></tr> +<tr><td colspan=2><br><h2>Public Methods</h2></td></tr> +<tr><td nowrap align=right valign=top> </td><td valign=bottom><a class="el" href="classFileReader.html#a0">FileReader</a> ()</td></tr> +<tr><td> </td><td><font size=-1><em>Default constructor.</em> <a href="#a0"></a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top> </td><td valign=bottom><a class="el" href="classFileReader.html#a1">FileReader</a> (string filename)</td></tr> +<tr><td> </td><td><font size=-1><em>Secondary constructor.</em> <a href="#a1"></a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top> </td><td valign=bottom><a class="el" href="classFileReader.html#a2">~FileReader</a> ()</td></tr> +<tr><td> </td><td><font size=-1><em>Default destructor.</em> <a href="#a2"></a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classFileReader.html#a3">LoadFile</a> (string filename)</td></tr> +<tr><td> </td><td><font size=-1><em>Used to load a file.</em> <a href="#a3"></a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>string </td><td valign=bottom><a class="el" href="classFileReader.html#a4">GetLine</a> (int x)</td></tr> +<tr><td> </td><td><font size=-1><em>Retrieve one line from the file.</em> <a href="#a4"></a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>int </td><td valign=bottom><a class="el" href="classFileReader.html#a5">FileSize</a> ()</td></tr> +<tr><td> </td><td><font size=-1><em>Returns the size of the file in lines.</em> <a href="#a5"></a><em></em></font><br><br></td></tr> +<tr><td colspan=2><br><h2>Private Attributes</h2></td></tr> +<tr><td nowrap align=right valign=top><a class="el" href="modules_8h.html#a1">file_cache</a> </td><td valign=bottom><a class="el" href="classFileReader.html#o0">fc</a></td></tr> +</table> +<hr><a name="_details"></a><h2>Detailed Description</h2> +Caches a text file into memory and can be used to retrieve lines from it. +<p> +This class contains methods for read-only manipulation of a text file in memory. Either use the constructor type with one parameter to load a file into memory at construction, or use the LoadFile method to load a file. +<p> + +<p> +Definition at line <a class="el" href="modules_8h-source.html#l00271">271</a> of file <a class="el" href="modules_8h-source.html">modules.h</a>.<hr><h2>Constructor & Destructor Documentation</h2> +<a name="a0" doxytag="FileReader::FileReader"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> FileReader::FileReader </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top">) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Default constructor. +<p> +This method does not load any file into memory, you must use the LoadFile method after constructing the class this way. +<p> +Definition at line <a class="el" href="modules_8cpp-source.html#l00202">202</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>. +<p> +<div class="fragment"><pre>00203 { +00204 } +</pre></div> </td> + </tr> +</table> +<a name="a1" doxytag="FileReader::FileReader"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> FileReader::FileReader </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">string </td> + <td class="mdname1" valign="top" nowrap> <em>filename</em> </td> + <td class="md" valign="top">) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Secondary constructor. +<p> +This method initialises the class with a file loaded into it ready for GetLine and and other methods to be called. If the file could not be loaded, <a class="el" href="classFileReader.html#a5">FileReader::FileSize</a> returns 0. +<p> +Definition at line <a class="el" href="modules_8cpp-source.html#l00195">195</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>. +<p> +References <a class="el" href="modules_8h-source.html#l00273">fc</a>, and <a class="el" href="modules_8h-source.html#l00038">file_cache</a>. +<p> +<div class="fragment"><pre>00196 { +00197 <a class="code" href="modules_8h.html#a1">file_cache</a> c; +00198 readfile(c,filename.c_str()); +00199 this-><a class="code" href="classFileReader.html#o0">fc</a> = c; +00200 } +</pre></div> </td> + </tr> +</table> +<a name="a2" doxytag="FileReader::~FileReader"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> FileReader::~FileReader </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top">) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Default destructor. +<p> +This deletes the memory allocated to the file. +<p> +Definition at line <a class="el" href="modules_8cpp-source.html#l00213">213</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>. +<p> +<div class="fragment"><pre>00214 { +00215 } +</pre></div> </td> + </tr> +</table> +<hr><h2>Member Function Documentation</h2> +<a name="a5" doxytag="FileReader::FileSize"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> int FileReader::FileSize </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top">) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Returns the size of the file in lines. +<p> +This method returns the number of lines in the read file. If it is 0, no lines have been read into memory, either because the file is empty or it does not exist, or cannot be opened due to permission problems. +<p> +Definition at line <a class="el" href="modules_8cpp-source.html#l00224">224</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>. +<p> +References <a class="el" href="modules_8h-source.html#l00273">fc</a>. +<p> +<div class="fragment"><pre>00225 { +00226 <span class="keywordflow">return</span> <a class="code" href="classFileReader.html#o0">fc</a>.size(); +00227 } +</pre></div> </td> + </tr> +</table> +<a name="a4" doxytag="FileReader::GetLine"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> string FileReader::GetLine </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">int </td> + <td class="mdname1" valign="top" nowrap> <em>x</em> </td> + <td class="md" valign="top">) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Retrieve one line from the file. +<p> +This method retrieves one line from the text file. If an empty non-NULL string is returned, the index was out of bounds, or the line had no data on it. +<p> +Definition at line <a class="el" href="modules_8cpp-source.html#l00217">217</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>. +<p> +References <a class="el" href="modules_8h-source.html#l00273">fc</a>. +<p> +<div class="fragment"><pre>00218 { +00219 <span class="keywordflow">if</span> ((x<0) || (x><a class="code" href="classFileReader.html#o0">fc</a>.size())) +00220 <span class="keywordflow">return</span> <span class="stringliteral">""</span>; +00221 <span class="keywordflow">return</span> <a class="code" href="classFileReader.html#o0">fc</a>[x]; +00222 } +</pre></div> </td> + </tr> +</table> +<a name="a3" doxytag="FileReader::LoadFile"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void FileReader::LoadFile </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">string </td> + <td class="mdname1" valign="top" nowrap> <em>filename</em> </td> + <td class="md" valign="top">) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Used to load a file. +<p> +This method loads a file into the class ready for GetLine and and other methods to be called. If the file could not be loaded, <a class="el" href="classFileReader.html#a5">FileReader::FileSize</a> returns 0. +<p> +Definition at line <a class="el" href="modules_8cpp-source.html#l00206">206</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>. +<p> +References <a class="el" href="modules_8h-source.html#l00273">fc</a>, and <a class="el" href="modules_8h-source.html#l00038">file_cache</a>. +<p> +<div class="fragment"><pre>00207 { +00208 <a class="code" href="modules_8h.html#a1">file_cache</a> c; +00209 readfile(c,filename.c_str()); +00210 this-><a class="code" href="classFileReader.html#o0">fc</a> = c; +00211 } +</pre></div> </td> + </tr> +</table> +<hr><h2>Member Data Documentation</h2> +<a name="o0" doxytag="FileReader::fc"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="modules_8h.html#a1">file_cache</a> FileReader::fc<code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="modules_8h-source.html#l00273">273</a> of file <a class="el" href="modules_8h-source.html">modules.h</a>. +<p> +Referenced by <a class="el" href="modules_8cpp-source.html#l00195">FileReader()</a>, <a class="el" href="modules_8cpp-source.html#l00224">FileSize()</a>, <a class="el" href="modules_8cpp-source.html#l00217">GetLine()</a>, and <a class="el" href="modules_8cpp-source.html#l00206">LoadFile()</a>. </td> + </tr> +</table> +<hr>The documentation for this class was generated from the following files:<ul> +<li><a class="el" href="modules_8h-source.html">modules.h</a><li><a class="el" href="modules_8cpp-source.html">modules.cpp</a></ul> +<hr><address style="align: right;"><small>Generated on Wed Jan 22 20:56:48 2003 for InspIRCd by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border=0 +width=110 height=53></a>1.3-rc2 </small></address> +</body> +</html> diff --git a/docs/module-doc/classHostItem-members.html b/docs/module-doc/classHostItem-members.html new file mode 100644 index 000000000..bf8242760 --- /dev/null +++ b/docs/module-doc/classHostItem-members.html @@ -0,0 +1,20 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>Member List</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.3-rc2 --> +<center> +<a class="qindex" href="main.html">Main Page</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center> +<hr><h1>HostItem Member List</h1>This is the complete list of members for <a class="el" href="classHostItem.html">HostItem</a>, including all inherited members.<table> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classHostItem.html#m2">data</a></td><td><a class="el" href="classHostItem.html">HostItem</a></td><td></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classHostItem.html#a0">HostItem</a>()</td><td><a class="el" href="classHostItem.html">HostItem</a></td><td><code> [inline]</code></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classHostItem.html#m1">set_by</a></td><td><a class="el" href="classHostItem.html">HostItem</a></td><td></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classHostItem.html#m0">set_time</a></td><td><a class="el" href="classHostItem.html">HostItem</a></td><td></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classHostItem.html#a1">~HostItem</a>()</td><td><a class="el" href="classHostItem.html">HostItem</a></td><td><code> [inline, virtual]</code></td></tr> +</table><hr><address style="align: right;"><small>Generated on Wed Jan 22 20:56:48 2003 for InspIRCd by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border=0 +width=110 height=53></a>1.3-rc2 </small></address> +</body> +</html> diff --git a/docs/module-doc/classHostItem.html b/docs/module-doc/classHostItem.html new file mode 100644 index 000000000..de0e216f6 --- /dev/null +++ b/docs/module-doc/classHostItem.html @@ -0,0 +1,185 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>HostItem class Reference</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.3-rc2 --> +<center> +<a class="qindex" href="main.html">Main Page</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center> +<hr><h1>HostItem Class Reference</h1>Holds an entry for a ban list, exemption list, or invite list. +<a href="#_details">More...</a> +<p> +<code>#include <<a class="el" href="channels_8h-source.html">channels.h</a>></code> +<p> +<p>Inheritance diagram for HostItem: +<p><center><img src="classHostItem.png" usemap="#HostItem_map" border="0" alt=""></center> +<map name="HostItem_map"> +<area href="classBanItem.html" alt="BanItem" shape="rect" coords="0,56,74,80"> +<area href="classExemptItem.html" alt="ExemptItem" shape="rect" coords="84,56,158,80"> +<area href="classInviteItem.html" alt="InviteItem" shape="rect" coords="168,56,242,80"> +</map> +<a href="classHostItem-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0> +<tr><td></td></tr> +<tr><td colspan=2><br><h2>Public Methods</h2></td></tr> +<tr><td nowrap align=right valign=top> </td><td valign=bottom><a class="el" href="classHostItem.html#a0">HostItem</a> ()</td></tr> +<tr><td nowrap align=right valign=top>virtual </td><td valign=bottom><a class="el" href="classHostItem.html#a1">~HostItem</a> ()</td></tr> +<tr><td colspan=2><br><h2>Public Attributes</h2></td></tr> +<tr><td nowrap align=right valign=top>time_t </td><td valign=bottom><a class="el" href="classHostItem.html#m0">set_time</a></td></tr> +<tr><td nowrap align=right valign=top>char </td><td valign=bottom><a class="el" href="classHostItem.html#m1">set_by</a> [NICKMAX]</td></tr> +<tr><td nowrap align=right valign=top>char </td><td valign=bottom><a class="el" href="classHostItem.html#m2">data</a> [MAXBUF]</td></tr> +</table> +<hr><a name="_details"></a><h2>Detailed Description</h2> +Holds an entry for a ban list, exemption list, or invite list. +<p> +This class contains a single element in a channel list, such as a banlist. +<p> + +<p> +Definition at line <a class="el" href="channels_8h-source.html#l00029">29</a> of file <a class="el" href="channels_8h-source.html">channels.h</a>.<hr><h2>Constructor & Destructor Documentation</h2> +<a name="a0" doxytag="HostItem::HostItem"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> HostItem::HostItem </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top">) </td> + <td class="md" nowrap><code> [inline]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="channels_8h-source.html#l00036">36</a> of file <a class="el" href="channels_8h-source.html">channels.h</a>. +<p> +<div class="fragment"><pre>00036 { <span class="comment">/* stub */</span> } +</pre></div> </td> + </tr> +</table> +<a name="a1" doxytag="HostItem::~HostItem"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> virtual HostItem::~HostItem </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top">) </td> + <td class="md" nowrap><code> [inline, virtual]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="channels_8h-source.html#l00037">37</a> of file <a class="el" href="channels_8h-source.html">channels.h</a>. +<p> +<div class="fragment"><pre>00037 { <span class="comment">/* stub */</span> } +</pre></div> </td> + </tr> +</table> +<hr><h2>Member Data Documentation</h2> +<a name="m2" doxytag="HostItem::data"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> char HostItem::data[MAXBUF] + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="channels_8h-source.html#l00034">34</a> of file <a class="el" href="channels_8h-source.html">channels.h</a>. </td> + </tr> +</table> +<a name="m1" doxytag="HostItem::set_by"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> char HostItem::set_by[NICKMAX] + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="channels_8h-source.html#l00033">33</a> of file <a class="el" href="channels_8h-source.html">channels.h</a>. </td> + </tr> +</table> +<a name="m0" doxytag="HostItem::set_time"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> time_t HostItem::set_time + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="channels_8h-source.html#l00032">32</a> of file <a class="el" href="channels_8h-source.html">channels.h</a>. </td> + </tr> +</table> +<hr>The documentation for this class was generated from the following file:<ul> +<li><a class="el" href="channels_8h-source.html">channels.h</a></ul> +<hr><address style="align: right;"><small>Generated on Wed Jan 22 20:56:48 2003 for InspIRCd by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border=0 +width=110 height=53></a>1.3-rc2 </small></address> +</body> +</html> diff --git a/docs/module-doc/classHostItem.png b/docs/module-doc/classHostItem.png Binary files differnew file mode 100644 index 000000000..99f88aacd --- /dev/null +++ b/docs/module-doc/classHostItem.png diff --git a/docs/module-doc/classInviteItem-members.html b/docs/module-doc/classInviteItem-members.html new file mode 100644 index 000000000..a65d27fc8 --- /dev/null +++ b/docs/module-doc/classInviteItem-members.html @@ -0,0 +1,20 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>Member List</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.3-rc2 --> +<center> +<a class="qindex" href="main.html">Main Page</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center> +<hr><h1>InviteItem Member List</h1>This is the complete list of members for <a class="el" href="classInviteItem.html">InviteItem</a>, including all inherited members.<table> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classHostItem.html#m2">data</a></td><td><a class="el" href="classHostItem.html">HostItem</a></td><td></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classHostItem.html#a0">HostItem</a>()</td><td><a class="el" href="classHostItem.html">HostItem</a></td><td><code> [inline]</code></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classHostItem.html#m1">set_by</a></td><td><a class="el" href="classHostItem.html">HostItem</a></td><td></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classHostItem.html#m0">set_time</a></td><td><a class="el" href="classHostItem.html">HostItem</a></td><td></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classHostItem.html#a1">~HostItem</a>()</td><td><a class="el" href="classHostItem.html">HostItem</a></td><td><code> [inline, virtual]</code></td></tr> +</table><hr><address style="align: right;"><small>Generated on Wed Jan 22 20:56:48 2003 for InspIRCd by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border=0 +width=110 height=53></a>1.3-rc2 </small></address> +</body> +</html> diff --git a/docs/module-doc/classInviteItem.html b/docs/module-doc/classInviteItem.html new file mode 100644 index 000000000..80336bca9 --- /dev/null +++ b/docs/module-doc/classInviteItem.html @@ -0,0 +1,34 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>InviteItem class Reference</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.3-rc2 --> +<center> +<a class="qindex" href="main.html">Main Page</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center> +<hr><h1>InviteItem Class Reference</h1>A subclass of <a class="el" href="classHostItem.html">HostItem</a> designed to hold channel invites (+I). +<a href="#_details">More...</a> +<p> +<code>#include <<a class="el" href="channels_8h-source.html">channels.h</a>></code> +<p> +<p>Inheritance diagram for InviteItem: +<p><center><img src="classInviteItem.png" usemap="#InviteItem_map" border="0" alt=""></center> +<map name="InviteItem_map"> +<area href="classHostItem.html" alt="HostItem" shape="rect" coords="0,0,64,24"> +</map> +<a href="classInviteItem-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0> +<tr><td></td></tr> +</table> +<hr><a name="_details"></a><h2>Detailed Description</h2> +A subclass of <a class="el" href="classHostItem.html">HostItem</a> designed to hold channel invites (+I). +<p> + +<p> +Definition at line <a class="el" href="channels_8h-source.html#l00061">61</a> of file <a class="el" href="channels_8h-source.html">channels.h</a>.<hr>The documentation for this class was generated from the following file:<ul> +<li><a class="el" href="channels_8h-source.html">channels.h</a></ul> +<hr><address style="align: right;"><small>Generated on Wed Jan 22 20:56:48 2003 for InspIRCd by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border=0 +width=110 height=53></a>1.3-rc2 </small></address> +</body> +</html> diff --git a/docs/module-doc/classInviteItem.png b/docs/module-doc/classInviteItem.png Binary files differnew file mode 100644 index 000000000..8ebdd8403 --- /dev/null +++ b/docs/module-doc/classInviteItem.png diff --git a/docs/module-doc/classInvited-members.html b/docs/module-doc/classInvited-members.html new file mode 100644 index 000000000..bd4003b69 --- /dev/null +++ b/docs/module-doc/classInvited-members.html @@ -0,0 +1,16 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>Member List</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.3-rc2 --> +<center> +<a class="qindex" href="main.html">Main Page</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center> +<hr><h1>Invited Member List</h1>This is the complete list of members for <a class="el" href="classInvited.html">Invited</a>, including all inherited members.<table> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classInvited.html#m0">channel</a></td><td><a class="el" href="classInvited.html">Invited</a></td><td></td></tr> +</table><hr><address style="align: right;"><small>Generated on Wed Jan 22 20:56:48 2003 for InspIRCd by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border=0 +width=110 height=53></a>1.3-rc2 </small></address> +</body> +</html> diff --git a/docs/module-doc/classInvited.html b/docs/module-doc/classInvited.html new file mode 100644 index 000000000..c6d945068 --- /dev/null +++ b/docs/module-doc/classInvited.html @@ -0,0 +1,58 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>Invited class Reference</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.3-rc2 --> +<center> +<a class="qindex" href="main.html">Main Page</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center> +<hr><h1>Invited Class Reference</h1>Holds a channel name to which a user has been invited. +<a href="#_details">More...</a> +<p> +<code>#include <<a class="el" href="users_8h-source.html">users.h</a>></code> +<p> +<a href="classInvited-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0> +<tr><td></td></tr> +<tr><td colspan=2><br><h2>Public Attributes</h2></td></tr> +<tr><td nowrap align=right valign=top>char </td><td valign=bottom><a class="el" href="classInvited.html#m0">channel</a> [CHANMAX]</td></tr> +</table> +<hr><a name="_details"></a><h2>Detailed Description</h2> +Holds a channel name to which a user has been invited. +<p> + +<p> +Definition at line <a class="el" href="users_8h-source.html#l00047">47</a> of file <a class="el" href="users_8h-source.html">users.h</a>.<hr><h2>Member Data Documentation</h2> +<a name="m0" doxytag="Invited::channel"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> char Invited::channel[CHANMAX] + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="users_8h-source.html#l00050">50</a> of file <a class="el" href="users_8h-source.html">users.h</a>. +<p> +Referenced by <a class="el" href="users_8cpp-source.html#l00072">userrec::InviteTo()</a>. </td> + </tr> +</table> +<hr>The documentation for this class was generated from the following file:<ul> +<li><a class="el" href="users_8h-source.html">users.h</a></ul> +<hr><address style="align: right;"><small>Generated on Wed Jan 22 20:56:48 2003 for InspIRCd by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border=0 +width=110 height=53></a>1.3-rc2 </small></address> +</body> +</html> diff --git a/docs/module-doc/classModule-members.html b/docs/module-doc/classModule-members.html new file mode 100644 index 000000000..3a1f87ed4 --- /dev/null +++ b/docs/module-doc/classModule-members.html @@ -0,0 +1,22 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>Member List</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.3-rc2 --> +<center> +<a class="qindex" href="main.html">Main Page</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center> +<hr><h1>Module Member List</h1>This is the complete list of members for <a class="el" href="classModule.html">Module</a>, including all inherited members.<table> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classModule.html#a2">GetVersion</a>()</td><td><a class="el" href="classModule.html">Module</a></td><td><code> [virtual]</code></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classModule.html#a0">Module</a>()</td><td><a class="el" href="classModule.html">Module</a></td><td></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classModule.html#a3">OnUserConnect</a>(userrec *user)</td><td><a class="el" href="classModule.html">Module</a></td><td><code> [virtual]</code></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classModule.html#a5">OnUserJoin</a>(userrec *user, chanrec *channel)</td><td><a class="el" href="classModule.html">Module</a></td><td><code> [virtual]</code></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classModule.html#a6">OnUserPart</a>(userrec *user, chanrec *channel)</td><td><a class="el" href="classModule.html">Module</a></td><td><code> [virtual]</code></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classModule.html#a4">OnUserQuit</a>(userrec *user)</td><td><a class="el" href="classModule.html">Module</a></td><td><code> [virtual]</code></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classModule.html#a1">~Module</a>()</td><td><a class="el" href="classModule.html">Module</a></td><td><code> [virtual]</code></td></tr> +</table><hr><address style="align: right;"><small>Generated on Wed Jan 22 20:56:48 2003 for InspIRCd by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border=0 +width=110 height=53></a>1.3-rc2 </small></address> +</body> +</html> diff --git a/docs/module-doc/classModule.html b/docs/module-doc/classModule.html new file mode 100644 index 000000000..519fbeb27 --- /dev/null +++ b/docs/module-doc/classModule.html @@ -0,0 +1,315 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>Module class Reference</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.3-rc2 --> +<center> +<a class="qindex" href="main.html">Main Page</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center> +<hr><h1>Module Class Reference</h1>Base class for all InspIRCd modules This class is the base class for InspIRCd modules. +<a href="#_details">More...</a> +<p> +<code>#include <<a class="el" href="modules_8h-source.html">modules.h</a>></code> +<p> +<a href="classModule-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0> +<tr><td></td></tr> +<tr><td colspan=2><br><h2>Public Methods</h2></td></tr> +<tr><td nowrap align=right valign=top> </td><td valign=bottom><a class="el" href="classModule.html#a0">Module</a> ()</td></tr> +<tr><td> </td><td><font size=-1><em>Default constructor creates a module class.</em> <a href="#a0"></a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>virtual </td><td valign=bottom><a class="el" href="classModule.html#a1">~Module</a> ()</td></tr> +<tr><td> </td><td><font size=-1><em>Default destructor destroys a module class.</em> <a href="#a1"></a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>virtual <a class="el" href="classVersion.html">Version</a> </td><td valign=bottom><a class="el" href="classModule.html#a2">GetVersion</a> ()</td></tr> +<tr><td> </td><td><font size=-1><em>Returns the version number of a Module.</em> <a href="#a2"></a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classModule.html#a3">OnUserConnect</a> (<a class="el" href="classuserrec.html">userrec</a> *user)</td></tr> +<tr><td> </td><td><font size=-1><em>Called when a user connects.</em> <a href="#a3"></a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classModule.html#a4">OnUserQuit</a> (<a class="el" href="classuserrec.html">userrec</a> *user)</td></tr> +<tr><td> </td><td><font size=-1><em>Called when a user quits.</em> <a href="#a4"></a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classModule.html#a5">OnUserJoin</a> (<a class="el" href="classuserrec.html">userrec</a> *user, <a class="el" href="classchanrec.html">chanrec</a> *channel)</td></tr> +<tr><td> </td><td><font size=-1><em>Called when a user joins a channel.</em> <a href="#a5"></a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classModule.html#a6">OnUserPart</a> (<a class="el" href="classuserrec.html">userrec</a> *user, <a class="el" href="classchanrec.html">chanrec</a> *channel)</td></tr> +<tr><td> </td><td><font size=-1><em>Called when a user parts a channel.</em> <a href="#a6"></a><em></em></font><br><br></td></tr> +</table> +<hr><a name="_details"></a><h2>Detailed Description</h2> +Base class for all InspIRCd modules This class is the base class for InspIRCd modules. +<p> +All modules must inherit from this class, its methods will be called when irc server events occur. class inherited from module must be instantiated by the <a class="el" href="classModuleFactory.html">ModuleFactory</a> class (see relevent section) for the plugin to be initialised. +<p> + +<p> +Definition at line <a class="el" href="modules_8h-source.html#l00079">79</a> of file <a class="el" href="modules_8h-source.html">modules.h</a>.<hr><h2>Constructor & Destructor Documentation</h2> +<a name="a0" doxytag="Module::Module"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> Module::Module </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top">) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Default constructor creates a module class. +<p> + +<p> +Definition at line <a class="el" href="modules_8cpp-source.html#l00040">40</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>. +<p> +<div class="fragment"><pre>00040 { } +</pre></div> </td> + </tr> +</table> +<a name="a1" doxytag="Module::~Module"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> Module::~Module </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top">) </td> + <td class="md" nowrap><code> [virtual]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Default destructor destroys a module class. +<p> + +<p> +Definition at line <a class="el" href="modules_8cpp-source.html#l00041">41</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>. +<p> +<div class="fragment"><pre>00041 { } +</pre></div> </td> + </tr> +</table> +<hr><h2>Member Function Documentation</h2> +<a name="a2" doxytag="Module::GetVersion"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="classVersion.html">Version</a> Module::GetVersion </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top">) </td> + <td class="md" nowrap><code> [virtual]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Returns the version number of a Module. +<p> +The method should return a <a class="el" href="classVersion.html">Version</a> object with its version information assigned via <a class="el" href="classVersion.html#a0">Version::Version</a> +<p> +Definition at line <a class="el" href="modules_8cpp-source.html#l00046">46</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>. +<p> +<div class="fragment"><pre>00046 { <span class="keywordflow">return</span> <a class="code" href="classVersion.html">Version</a>(1,0,0,0); } +</pre></div> </td> + </tr> +</table> +<a name="a3" doxytag="Module::OnUserConnect"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void Module::OnUserConnect </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td> + <td class="mdname1" valign="top" nowrap> <em>user</em> </td> + <td class="md" valign="top">) </td> + <td class="md" nowrap><code> [virtual]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Called when a user connects. +<p> +The details of the connecting user are available to you in the parameter userrec *user +<p> +Definition at line <a class="el" href="modules_8cpp-source.html#l00042">42</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>. +<p> +<div class="fragment"><pre>00042 { } +</pre></div> </td> + </tr> +</table> +<a name="a5" doxytag="Module::OnUserJoin"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void Module::OnUserJoin </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td> + <td class="mdname" nowrap> <em>user</em>, </td> + </tr> + <tr> + <td></td> + <td></td> + <td class="md" nowrap><a class="el" href="classchanrec.html">chanrec</a> * </td> + <td class="mdname" nowrap> <em>channel</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"><code> [virtual]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Called when a user joins a channel. +<p> +The details of the joining user are available to you in the parameter userrec *user, and the details of the channel they have joined is available in the variable chanrec *channel +<p> +Definition at line <a class="el" href="modules_8cpp-source.html#l00044">44</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>. +<p> +<div class="fragment"><pre>00044 { } +</pre></div> </td> + </tr> +</table> +<a name="a6" doxytag="Module::OnUserPart"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void Module::OnUserPart </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td> + <td class="mdname" nowrap> <em>user</em>, </td> + </tr> + <tr> + <td></td> + <td></td> + <td class="md" nowrap><a class="el" href="classchanrec.html">chanrec</a> * </td> + <td class="mdname" nowrap> <em>channel</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"><code> [virtual]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Called when a user parts a channel. +<p> +The details of the leaving user are available to you in the parameter userrec *user, and the details of the channel they have left is available in the variable chanrec *channel +<p> +Definition at line <a class="el" href="modules_8cpp-source.html#l00045">45</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>. +<p> +<div class="fragment"><pre>00045 { } +</pre></div> </td> + </tr> +</table> +<a name="a4" doxytag="Module::OnUserQuit"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void Module::OnUserQuit </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td> + <td class="mdname1" valign="top" nowrap> <em>user</em> </td> + <td class="md" valign="top">) </td> + <td class="md" nowrap><code> [virtual]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Called when a user quits. +<p> +The details of the exiting user are available to you in the parameter userrec *user +<p> +Definition at line <a class="el" href="modules_8cpp-source.html#l00043">43</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>. +<p> +<div class="fragment"><pre>00043 { } +</pre></div> </td> + </tr> +</table> +<hr>The documentation for this class was generated from the following files:<ul> +<li><a class="el" href="modules_8h-source.html">modules.h</a><li><a class="el" href="modules_8cpp-source.html">modules.cpp</a></ul> +<hr><address style="align: right;"><small>Generated on Wed Jan 22 20:56:48 2003 for InspIRCd by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border=0 +width=110 height=53></a>1.3-rc2 </small></address> +</body> +</html> diff --git a/docs/module-doc/classModuleFactory-members.html b/docs/module-doc/classModuleFactory-members.html new file mode 100644 index 000000000..bd8a7618c --- /dev/null +++ b/docs/module-doc/classModuleFactory-members.html @@ -0,0 +1,18 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>Member List</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.3-rc2 --> +<center> +<a class="qindex" href="main.html">Main Page</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center> +<hr><h1>ModuleFactory Member List</h1>This is the complete list of members for <a class="el" href="classModuleFactory.html">ModuleFactory</a>, including all inherited members.<table> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classModuleFactory.html#a2">CreateModule</a>()=0</td><td><a class="el" href="classModuleFactory.html">ModuleFactory</a></td><td><code> [pure virtual]</code></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classModuleFactory.html#a0">ModuleFactory</a>()</td><td><a class="el" href="classModuleFactory.html">ModuleFactory</a></td><td><code> [inline]</code></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classModuleFactory.html#a1">~ModuleFactory</a>()</td><td><a class="el" href="classModuleFactory.html">ModuleFactory</a></td><td><code> [inline, virtual]</code></td></tr> +</table><hr><address style="align: right;"><small>Generated on Wed Jan 22 20:56:48 2003 for InspIRCd by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border=0 +width=110 height=53></a>1.3-rc2 </small></address> +</body> +</html> diff --git a/docs/module-doc/classModuleFactory.html b/docs/module-doc/classModuleFactory.html new file mode 100644 index 000000000..12bf82cef --- /dev/null +++ b/docs/module-doc/classModuleFactory.html @@ -0,0 +1,134 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>ModuleFactory class Reference</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.3-rc2 --> +<center> +<a class="qindex" href="main.html">Main Page</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center> +<hr><h1>ModuleFactory Class Reference</h1>Instantiates classes inherited from <a class="el" href="classModule.html">Module</a> This class creates a class inherited from type <a class="el" href="classModule.html">Module</a>, using new. +<a href="#_details">More...</a> +<p> +<code>#include <<a class="el" href="modules_8h-source.html">modules.h</a>></code> +<p> +<a href="classModuleFactory-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0> +<tr><td></td></tr> +<tr><td colspan=2><br><h2>Public Methods</h2></td></tr> +<tr><td nowrap align=right valign=top> </td><td valign=bottom><a class="el" href="classModuleFactory.html#a0">ModuleFactory</a> ()</td></tr> +<tr><td nowrap align=right valign=top>virtual </td><td valign=bottom><a class="el" href="classModuleFactory.html#a1">~ModuleFactory</a> ()</td></tr> +<tr><td nowrap align=right valign=top>virtual <a class="el" href="classModule.html">Module</a> * </td><td valign=bottom><a class="el" href="classModuleFactory.html#a2">CreateModule</a> ()=0</td></tr> +<tr><td> </td><td><font size=-1><em>Creates a new module.</em> <a href="#a2"></a><em></em></font><br><br></td></tr> +</table> +<hr><a name="_details"></a><h2>Detailed Description</h2> +Instantiates classes inherited from <a class="el" href="classModule.html">Module</a> This class creates a class inherited from type <a class="el" href="classModule.html">Module</a>, using new. +<p> +This is to allow for modules to create many different variants of <a class="el" href="classModule.html">Module</a>, dependent on architecture, configuration, etc. In most cases, the simple class shown in the example module m_foobar.so will suffice for most modules. +<p> + +<p> +Definition at line <a class="el" href="modules_8h-source.html#l00316">316</a> of file <a class="el" href="modules_8h-source.html">modules.h</a>.<hr><h2>Constructor & Destructor Documentation</h2> +<a name="a0" doxytag="ModuleFactory::ModuleFactory"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> ModuleFactory::ModuleFactory </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top">) </td> + <td class="md" nowrap><code> [inline]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="modules_8h-source.html#l00319">319</a> of file <a class="el" href="modules_8h-source.html">modules.h</a>. +<p> +<div class="fragment"><pre>00319 { } +</pre></div> </td> + </tr> +</table> +<a name="a1" doxytag="ModuleFactory::~ModuleFactory"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> virtual ModuleFactory::~ModuleFactory </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top">) </td> + <td class="md" nowrap><code> [inline, virtual]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="modules_8h-source.html#l00320">320</a> of file <a class="el" href="modules_8h-source.html">modules.h</a>. +<p> +<div class="fragment"><pre>00320 { } +</pre></div> </td> + </tr> +</table> +<hr><h2>Member Function Documentation</h2> +<a name="a2" doxytag="ModuleFactory::CreateModule"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> virtual <a class="el" href="classModule.html">Module</a>* ModuleFactory::CreateModule </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top">) </td> + <td class="md" nowrap><code> [pure virtual]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Creates a new module. +<p> +Your inherited class of ModuleFactory must return a pointer to your <a class="el" href="classModule.html">Module</a> class using this method. </td> + </tr> +</table> +<hr>The documentation for this class was generated from the following file:<ul> +<li><a class="el" href="modules_8h-source.html">modules.h</a></ul> +<hr><address style="align: right;"><small>Generated on Wed Jan 22 20:56:48 2003 for InspIRCd by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border=0 +width=110 height=53></a>1.3-rc2 </small></address> +</body> +</html> diff --git a/docs/module-doc/classServer-members.html b/docs/module-doc/classServer-members.html new file mode 100644 index 000000000..63c331106 --- /dev/null +++ b/docs/module-doc/classServer-members.html @@ -0,0 +1,34 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>Member List</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.3-rc2 --> +<center> +<a class="qindex" href="main.html">Main Page</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center> +<hr><h1>Server Member List</h1>This is the complete list of members for <a class="el" href="classServer.html">Server</a>, including all inherited members.<table> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classServer.html#a15">ChanMode</a>(userrec *User, chanrec *Chan)</td><td><a class="el" href="classServer.html">Server</a></td><td><code> [virtual]</code></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classServer.html#a9">CommonChannels</a>(userrec *u1, userrec *u2)</td><td><a class="el" href="classServer.html">Server</a></td><td><code> [virtual]</code></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classServer.html#a3">Debug</a>(string s)</td><td><a class="el" href="classServer.html">Server</a></td><td><code> [virtual]</code></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classServer.html#a14">FindChannel</a>(string channel)</td><td><a class="el" href="classServer.html">Server</a></td><td><code> [virtual]</code></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classServer.html#a13">FindNick</a>(string nick)</td><td><a class="el" href="classServer.html">Server</a></td><td><code> [virtual]</code></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classServer.html#a18">GetAdmin</a>()</td><td><a class="el" href="classServer.html">Server</a></td><td><code> [virtual]</code></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classServer.html#a17">GetNetworkName</a>()</td><td><a class="el" href="classServer.html">Server</a></td><td><code> [virtual]</code></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classServer.html#a16">GetServerName</a>()</td><td><a class="el" href="classServer.html">Server</a></td><td><code> [virtual]</code></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classServer.html#a12">IsNick</a>(string nick)</td><td><a class="el" href="classServer.html">Server</a></td><td><code> [virtual]</code></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classServer.html#a4">Send</a>(int Socket, string s)</td><td><a class="el" href="classServer.html">Server</a></td><td><code> [virtual]</code></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classServer.html#a8">SendChannel</a>(userrec *User, chanrec *Channel, string s, bool IncludeSender)</td><td><a class="el" href="classServer.html">Server</a></td><td><code> [virtual]</code></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classServer.html#a10">SendCommon</a>(userrec *User, string text, bool IncludeSender)</td><td><a class="el" href="classServer.html">Server</a></td><td><code> [virtual]</code></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classServer.html#a6">SendFrom</a>(int Socket, userrec *User, string s)</td><td><a class="el" href="classServer.html">Server</a></td><td><code> [virtual]</code></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classServer.html#a2">SendOpers</a>(string s)</td><td><a class="el" href="classServer.html">Server</a></td><td><code> [virtual]</code></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classServer.html#a5">SendServ</a>(int Socket, string s)</td><td><a class="el" href="classServer.html">Server</a></td><td><code> [virtual]</code></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classServer.html#a7">SendTo</a>(userrec *Source, userrec *Dest, string s)</td><td><a class="el" href="classServer.html">Server</a></td><td><code> [virtual]</code></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classServer.html#a11">SendWallops</a>(userrec *User, string text)</td><td><a class="el" href="classServer.html">Server</a></td><td><code> [virtual]</code></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classServer.html#a0">Server</a>()</td><td><a class="el" href="classServer.html">Server</a></td><td></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classServer.html#a1">~Server</a>()</td><td><a class="el" href="classServer.html">Server</a></td><td><code> [virtual]</code></td></tr> +</table><hr><address style="align: right;"><small>Generated on Wed Jan 22 20:56:48 2003 for InspIRCd by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border=0 +width=110 height=53></a>1.3-rc2 </small></address> +</body> +</html> diff --git a/docs/module-doc/classServer.html b/docs/module-doc/classServer.html new file mode 100644 index 000000000..d7a809046 --- /dev/null +++ b/docs/module-doc/classServer.html @@ -0,0 +1,913 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>Server class Reference</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.3-rc2 --> +<center> +<a class="qindex" href="main.html">Main Page</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center> +<hr><h1>Server Class Reference</h1>Allows server output and query functions This class contains methods which allow a module to query the state of the irc server, and produce output to users and other servers. +<a href="#_details">More...</a> +<p> +<code>#include <<a class="el" href="modules_8h-source.html">modules.h</a>></code> +<p> +<a href="classServer-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0> +<tr><td></td></tr> +<tr><td colspan=2><br><h2>Public Methods</h2></td></tr> +<tr><td nowrap align=right valign=top> </td><td valign=bottom><a class="el" href="classServer.html#a0">Server</a> ()</td></tr> +<tr><td> </td><td><font size=-1><em>Default constructor.</em> <a href="#a0"></a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>virtual </td><td valign=bottom><a class="el" href="classServer.html#a1">~Server</a> ()</td></tr> +<tr><td> </td><td><font size=-1><em>Default destructor.</em> <a href="#a1"></a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classServer.html#a2">SendOpers</a> (string s)</td></tr> +<tr><td> </td><td><font size=-1><em>Sends text to all opers.</em> <a href="#a2"></a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classServer.html#a3">Debug</a> (string s)</td></tr> +<tr><td> </td><td><font size=-1><em>Sends a debug string.</em> <a href="#a3"></a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classServer.html#a4">Send</a> (int Socket, string s)</td></tr> +<tr><td> </td><td><font size=-1><em>Sends a line of text down a TCP/IP socket.</em> <a href="#a4"></a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classServer.html#a5">SendServ</a> (int Socket, string s)</td></tr> +<tr><td> </td><td><font size=-1><em>Sends text from the server to a socket.</em> <a href="#a5"></a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classServer.html#a6">SendFrom</a> (int Socket, <a class="el" href="classuserrec.html">userrec</a> *User, string s)</td></tr> +<tr><td> </td><td><font size=-1><em>Sends text from a user to a socket.</em> <a href="#a6"></a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classServer.html#a7">SendTo</a> (<a class="el" href="classuserrec.html">userrec</a> *Source, <a class="el" href="classuserrec.html">userrec</a> *Dest, string s)</td></tr> +<tr><td> </td><td><font size=-1><em>Sends text from a user to another user.</em> <a href="#a7"></a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classServer.html#a8">SendChannel</a> (<a class="el" href="classuserrec.html">userrec</a> *User, <a class="el" href="classchanrec.html">chanrec</a> *Channel, string s, bool IncludeSender)</td></tr> +<tr><td> </td><td><font size=-1><em>Sends text from a user to a channel (mulicast).</em> <a href="#a8"></a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>virtual bool </td><td valign=bottom><a class="el" href="classServer.html#a9">CommonChannels</a> (<a class="el" href="classuserrec.html">userrec</a> *u1, <a class="el" href="classuserrec.html">userrec</a> *u2)</td></tr> +<tr><td> </td><td><font size=-1><em>Returns true if two users share a common channel.</em> <a href="#a9"></a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classServer.html#a10">SendCommon</a> (<a class="el" href="classuserrec.html">userrec</a> *User, string text, bool IncludeSender)</td></tr> +<tr><td> </td><td><font size=-1><em>Sends text from a user to one or more channels (mulicast).</em> <a href="#a10"></a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classServer.html#a11">SendWallops</a> (<a class="el" href="classuserrec.html">userrec</a> *User, string text)</td></tr> +<tr><td> </td><td><font size=-1><em>Sends a WALLOPS message.</em> <a href="#a11"></a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>virtual bool </td><td valign=bottom><a class="el" href="classServer.html#a12">IsNick</a> (string nick)</td></tr> +<tr><td> </td><td><font size=-1><em>Returns true if a nick is valid.</em> <a href="#a12"></a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>virtual <a class="el" href="classuserrec.html">userrec</a> * </td><td valign=bottom><a class="el" href="classServer.html#a13">FindNick</a> (string nick)</td></tr> +<tr><td> </td><td><font size=-1><em>Attempts to look up a nick and return a pointer to it.</em> <a href="#a13"></a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>virtual <a class="el" href="classchanrec.html">chanrec</a> * </td><td valign=bottom><a class="el" href="classServer.html#a14">FindChannel</a> (string channel)</td></tr> +<tr><td> </td><td><font size=-1><em>Attempts to look up a channel and return a pointer to it.</em> <a href="#a14"></a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>virtual string </td><td valign=bottom><a class="el" href="classServer.html#a15">ChanMode</a> (<a class="el" href="classuserrec.html">userrec</a> *User, <a class="el" href="classchanrec.html">chanrec</a> *Chan)</td></tr> +<tr><td> </td><td><font size=-1><em>Attempts to look up a user's privilages on a channel.</em> <a href="#a15"></a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>virtual string </td><td valign=bottom><a class="el" href="classServer.html#a16">GetServerName</a> ()</td></tr> +<tr><td> </td><td><font size=-1><em>Returns the server name of the server where the module is loaded.</em> <a href="#a16"></a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>virtual string </td><td valign=bottom><a class="el" href="classServer.html#a17">GetNetworkName</a> ()</td></tr> +<tr><td> </td><td><font size=-1><em>Returns the network name, global to all linked servers.</em> <a href="#a17"></a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>virtual <a class="el" href="classAdmin.html">Admin</a> </td><td valign=bottom><a class="el" href="classServer.html#a18">GetAdmin</a> ()</td></tr> +<tr><td> </td><td><font size=-1><em>Returns the information of the server as returned by the /ADMIN command.</em> <a href="#a18"></a><em></em></font><br><br></td></tr> +</table> +<hr><a name="_details"></a><h2>Detailed Description</h2> +Allows server output and query functions This class contains methods which allow a module to query the state of the irc server, and produce output to users and other servers. +<p> +All modules should instantiate at least one copy of this class, and use its member functions to perform their tasks. +<p> + +<p> +Definition at line <a class="el" href="modules_8h-source.html#l00121">121</a> of file <a class="el" href="modules_8h-source.html">modules.h</a>.<hr><h2>Constructor & Destructor Documentation</h2> +<a name="a0" doxytag="Server::Server"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> Server::Server </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top">) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Default constructor. +<p> +Creates a Server object. +<p> +Definition at line <a class="el" href="modules_8cpp-source.html#l00052">52</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>. +<p> +<div class="fragment"><pre>00053 { +00054 } +</pre></div> </td> + </tr> +</table> +<a name="a1" doxytag="Server::~Server"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> Server::~Server </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top">) </td> + <td class="md" nowrap><code> [virtual]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Default destructor. +<p> +Destroys a Server object. +<p> +Definition at line <a class="el" href="modules_8cpp-source.html#l00056">56</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>. +<p> +<div class="fragment"><pre>00057 { +00058 } +</pre></div> </td> + </tr> +</table> +<hr><h2>Member Function Documentation</h2> +<a name="a15" doxytag="Server::ChanMode"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> string Server::ChanMode </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td> + <td class="mdname" nowrap> <em>User</em>, </td> + </tr> + <tr> + <td></td> + <td></td> + <td class="md" nowrap><a class="el" href="classchanrec.html">chanrec</a> * </td> + <td class="mdname" nowrap> <em>Chan</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"><code> [virtual]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Attempts to look up a user's privilages on a channel. +<p> +This function will return a string containing either @, , +, or an empty string, representing the user's privilages upon the channel you specify. +<p> +Definition at line <a class="el" href="modules_8cpp-source.html#l00139">139</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>. +<p> +<div class="fragment"><pre>00140 { +00141 string mode = cmode(User,Chan); +00142 <span class="keywordflow">return</span> mode; +00143 } +</pre></div> </td> + </tr> +</table> +<a name="a9" doxytag="Server::CommonChannels"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> bool Server::CommonChannels </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td> + <td class="mdname" nowrap> <em>u1</em>, </td> + </tr> + <tr> + <td></td> + <td></td> + <td class="md" nowrap><a class="el" href="classuserrec.html">userrec</a> * </td> + <td class="mdname" nowrap> <em>u2</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"><code> [virtual]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Returns true if two users share a common channel. +<p> +This method is used internally by the NICK and QUIT commands, and the <a class="el" href="classServer.html#a10">Server::SendCommon</a> method. +<p> +Definition at line <a class="el" href="modules_8cpp-source.html#l00102">102</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>. +<p> +<div class="fragment"><pre>00103 { +00104 <span class="keywordflow">return</span> (common_channels(u1,u2) != 0); +00105 } +</pre></div> </td> + </tr> +</table> +<a name="a3" doxytag="Server::Debug"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void Server::Debug </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">string </td> + <td class="mdname1" valign="top" nowrap> <em>s</em> </td> + <td class="md" valign="top">) </td> + <td class="md" nowrap><code> [virtual]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Sends a debug string. +<p> +This method writes a line of text to the debug log. If debugging is disabled in the configuration, this command has no effect. +<p> +Definition at line <a class="el" href="modules_8cpp-source.html#l00065">65</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>. +<p> +<div class="fragment"><pre>00066 { +00067 debug(<span class="stringliteral">"%s"</span>,s.c_str()); +00068 } +</pre></div> </td> + </tr> +</table> +<a name="a14" doxytag="Server::FindChannel"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="classchanrec.html">chanrec</a> * Server::FindChannel </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">string </td> + <td class="mdname1" valign="top" nowrap> <em>channel</em> </td> + <td class="md" valign="top">) </td> + <td class="md" nowrap><code> [virtual]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Attempts to look up a channel and return a pointer to it. +<p> +This function will return NULL if the channel does not exist. +<p> +Definition at line <a class="el" href="modules_8cpp-source.html#l00134">134</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>. +<p> +<div class="fragment"><pre>00135 { +00136 <span class="keywordflow">return</span> FindChan(channel.c_str()); +00137 } +</pre></div> </td> + </tr> +</table> +<a name="a13" doxytag="Server::FindNick"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="classuserrec.html">userrec</a> * Server::FindNick </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">string </td> + <td class="mdname1" valign="top" nowrap> <em>nick</em> </td> + <td class="md" valign="top">) </td> + <td class="md" nowrap><code> [virtual]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Attempts to look up a nick and return a pointer to it. +<p> +This function will return NULL if the nick does not exist. +<p> +Definition at line <a class="el" href="modules_8cpp-source.html#l00129">129</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>. +<p> +<div class="fragment"><pre>00130 { +00131 <span class="keywordflow">return</span> Find(nick); +00132 } +</pre></div> </td> + </tr> +</table> +<a name="a18" doxytag="Server::GetAdmin"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="classAdmin.html">Admin</a> Server::GetAdmin </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top">) </td> + <td class="md" nowrap><code> [virtual]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Returns the information of the server as returned by the /ADMIN command. +<p> +See the <a class="el" href="classAdmin.html">Admin</a> class for further information of the return value. The members <a class="el" href="classAdmin.html#m2">Admin::Nick</a>, <a class="el" href="classAdmin.html#m1">Admin::Email</a> and <a class="el" href="classAdmin.html#m0">Admin::Name</a> contain the information for the server where the module is loaded. +<p> +Definition at line <a class="el" href="modules_8cpp-source.html#l00155">155</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>. +<p> +<div class="fragment"><pre>00156 { +00157 <span class="keywordflow">return</span> <a class="code" href="classAdmin.html">Admin</a>(getadminname(),getadminemail(),getadminnick()); +00158 } +</pre></div> </td> + </tr> +</table> +<a name="a17" doxytag="Server::GetNetworkName"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> string Server::GetNetworkName </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top">) </td> + <td class="md" nowrap><code> [virtual]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Returns the network name, global to all linked servers. +<p> + +<p> +Definition at line <a class="el" href="modules_8cpp-source.html#l00150">150</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>. +<p> +<div class="fragment"><pre>00151 { +00152 <span class="keywordflow">return</span> getnetworkname(); +00153 } +</pre></div> </td> + </tr> +</table> +<a name="a16" doxytag="Server::GetServerName"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> string Server::GetServerName </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top">) </td> + <td class="md" nowrap><code> [virtual]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Returns the server name of the server where the module is loaded. +<p> + +<p> +Definition at line <a class="el" href="modules_8cpp-source.html#l00145">145</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>. +<p> +<div class="fragment"><pre>00146 { +00147 <span class="keywordflow">return</span> getservername(); +00148 } +</pre></div> </td> + </tr> +</table> +<a name="a12" doxytag="Server::IsNick"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> bool Server::IsNick </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">string </td> + <td class="mdname1" valign="top" nowrap> <em>nick</em> </td> + <td class="md" valign="top">) </td> + <td class="md" nowrap><code> [virtual]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Returns true if a nick is valid. +<p> +Nicks for unregistered connections will return false. +<p> +Definition at line <a class="el" href="modules_8cpp-source.html#l00124">124</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>. +<p> +<div class="fragment"><pre>00125 { +00126 <span class="keywordflow">return</span> (isnick(nick.c_str()) != 0); +00127 } +</pre></div> </td> + </tr> +</table> +<a name="a4" doxytag="Server::Send"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void Server::Send </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">int </td> + <td class="mdname" nowrap> <em>Socket</em>, </td> + </tr> + <tr> + <td></td> + <td></td> + <td class="md" nowrap>string </td> + <td class="mdname" nowrap> <em>s</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"><code> [virtual]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Sends a line of text down a TCP/IP socket. +<p> +This method writes a line of text to an established socket, cutting it to 510 characters plus a carriage return and linefeed if required. +<p> +Definition at line <a class="el" href="modules_8cpp-source.html#l00070">70</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>. +<p> +<div class="fragment"><pre>00071 { +00072 Write(Socket,<span class="stringliteral">"%s"</span>,s.c_str()); +00073 } +</pre></div> </td> + </tr> +</table> +<a name="a8" doxytag="Server::SendChannel"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void Server::SendChannel </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td> + <td class="mdname" nowrap> <em>User</em>, </td> + </tr> + <tr> + <td></td> + <td></td> + <td class="md" nowrap><a class="el" href="classchanrec.html">chanrec</a> * </td> + <td class="mdname" nowrap> <em>Channel</em>, </td> + </tr> + <tr> + <td></td> + <td></td> + <td class="md" nowrap>string </td> + <td class="mdname" nowrap> <em>s</em>, </td> + </tr> + <tr> + <td></td> + <td></td> + <td class="md" nowrap>bool </td> + <td class="mdname" nowrap> <em>IncludeSender</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"><code> [virtual]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Sends text from a user to a channel (mulicast). +<p> +This method writes a line of text to a channel, with the given user's nick/ident /host combination prepended, as used in PRIVMSG etc commands (see RFC 1459). If the IncludeSender flag is set, then the text is also sent back to the user from which it originated, as seen in MODE (see RFC 1459). +<p> +Definition at line <a class="el" href="modules_8cpp-source.html#l00090">90</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>. +<p> +<div class="fragment"><pre>00091 { +00092 <span class="keywordflow">if</span> (IncludeSender) +00093 { +00094 WriteChannel(Channel,User,<span class="stringliteral">"%s"</span>,s.c_str()); +00095 } +00096 <span class="keywordflow">else</span> +00097 { +00098 ChanExceptSender(Channel,User,<span class="stringliteral">"%s"</span>,s.c_str()); +00099 } +00100 } +</pre></div> </td> + </tr> +</table> +<a name="a10" doxytag="Server::SendCommon"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void Server::SendCommon </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td> + <td class="mdname" nowrap> <em>User</em>, </td> + </tr> + <tr> + <td></td> + <td></td> + <td class="md" nowrap>string </td> + <td class="mdname" nowrap> <em>text</em>, </td> + </tr> + <tr> + <td></td> + <td></td> + <td class="md" nowrap>bool </td> + <td class="mdname" nowrap> <em>IncludeSender</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"><code> [virtual]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Sends text from a user to one or more channels (mulicast). +<p> +This method writes a line of text to all users which share a common channel with a given user, with the user's nick/ident/host combination prepended, as used in PRIVMSG etc commands (see RFC 1459). If the IncludeSender flag is set, then the text is also sent back to the user from which it originated, as seen in NICK (see RFC 1459). Otherwise, it is only sent to the other recipients, as seen in QUIT. +<p> +Definition at line <a class="el" href="modules_8cpp-source.html#l00107">107</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>. +<p> +<div class="fragment"><pre>00108 { +00109 <span class="keywordflow">if</span> (IncludeSender) +00110 { +00111 WriteCommon(User,<span class="stringliteral">"%s"</span>,text.c_str()); +00112 } +00113 <span class="keywordflow">else</span> +00114 { +00115 WriteCommonExcept(User,<span class="stringliteral">"%s"</span>,text.c_str()); +00116 } +00117 } +</pre></div> </td> + </tr> +</table> +<a name="a6" doxytag="Server::SendFrom"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void Server::SendFrom </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">int </td> + <td class="mdname" nowrap> <em>Socket</em>, </td> + </tr> + <tr> + <td></td> + <td></td> + <td class="md" nowrap><a class="el" href="classuserrec.html">userrec</a> * </td> + <td class="mdname" nowrap> <em>User</em>, </td> + </tr> + <tr> + <td></td> + <td></td> + <td class="md" nowrap>string </td> + <td class="mdname" nowrap> <em>s</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"><code> [virtual]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Sends text from a user to a socket. +<p> +This method writes a line of text to an established socket, with the given user's nick/ident /host combination prepended, as used in PRIVSG etc commands (see RFC 1459) +<p> +Definition at line <a class="el" href="modules_8cpp-source.html#l00080">80</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>. +<p> +<div class="fragment"><pre>00081 { +00082 WriteFrom(Socket,User,<span class="stringliteral">"%s"</span>,s.c_str()); +00083 } +</pre></div> </td> + </tr> +</table> +<a name="a2" doxytag="Server::SendOpers"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void Server::SendOpers </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">string </td> + <td class="mdname1" valign="top" nowrap> <em>s</em> </td> + <td class="md" valign="top">) </td> + <td class="md" nowrap><code> [virtual]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Sends text to all opers. +<p> +This method sends a server notice to all opers with the usermode +s. +<p> +Definition at line <a class="el" href="modules_8cpp-source.html#l00060">60</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>. +<p> +<div class="fragment"><pre>00061 { +00062 WriteOpers(<span class="stringliteral">"%s"</span>,s.c_str()); +00063 } +</pre></div> </td> + </tr> +</table> +<a name="a5" doxytag="Server::SendServ"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void Server::SendServ </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">int </td> + <td class="mdname" nowrap> <em>Socket</em>, </td> + </tr> + <tr> + <td></td> + <td></td> + <td class="md" nowrap>string </td> + <td class="mdname" nowrap> <em>s</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"><code> [virtual]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Sends text from the server to a socket. +<p> +This method writes a line of text to an established socket, with the servername prepended as used by numerics (see RFC 1459) +<p> +Definition at line <a class="el" href="modules_8cpp-source.html#l00075">75</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>. +<p> +<div class="fragment"><pre>00076 { +00077 WriteServ(Socket,<span class="stringliteral">"%s"</span>,s.c_str()); +00078 } +</pre></div> </td> + </tr> +</table> +<a name="a7" doxytag="Server::SendTo"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void Server::SendTo </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td> + <td class="mdname" nowrap> <em>Source</em>, </td> + </tr> + <tr> + <td></td> + <td></td> + <td class="md" nowrap><a class="el" href="classuserrec.html">userrec</a> * </td> + <td class="mdname" nowrap> <em>Dest</em>, </td> + </tr> + <tr> + <td></td> + <td></td> + <td class="md" nowrap>string </td> + <td class="mdname" nowrap> <em>s</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"><code> [virtual]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Sends text from a user to another user. +<p> +This method writes a line of text to a user, with a user's nick/ident /host combination prepended, as used in PRIVMSG etc commands (see RFC 1459) +<p> +Definition at line <a class="el" href="modules_8cpp-source.html#l00085">85</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>. +<p> +<div class="fragment"><pre>00086 { +00087 WriteTo(Source,Dest,<span class="stringliteral">"%s"</span>,s.c_str()); +00088 } +</pre></div> </td> + </tr> +</table> +<a name="a11" doxytag="Server::SendWallops"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void Server::SendWallops </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td> + <td class="mdname" nowrap> <em>User</em>, </td> + </tr> + <tr> + <td></td> + <td></td> + <td class="md" nowrap>string </td> + <td class="mdname" nowrap> <em>text</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"><code> [virtual]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Sends a WALLOPS message. +<p> +This method writes a WALLOPS message to all users with the +w flag, originating from the specified user. +<p> +Definition at line <a class="el" href="modules_8cpp-source.html#l00119">119</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>. +<p> +<div class="fragment"><pre>00120 { +00121 WriteWallOps(User,<span class="stringliteral">"%s"</span>,text.c_str()); +00122 } +</pre></div> </td> + </tr> +</table> +<hr>The documentation for this class was generated from the following files:<ul> +<li><a class="el" href="modules_8h-source.html">modules.h</a><li><a class="el" href="modules_8cpp-source.html">modules.cpp</a></ul> +<hr><address style="align: right;"><small>Generated on Wed Jan 22 20:56:48 2003 for InspIRCd by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border=0 +width=110 height=53></a>1.3-rc2 </small></address> +</body> +</html> diff --git a/docs/module-doc/classVersion-members.html b/docs/module-doc/classVersion-members.html new file mode 100644 index 000000000..438f2645f --- /dev/null +++ b/docs/module-doc/classVersion-members.html @@ -0,0 +1,20 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>Member List</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.3-rc2 --> +<center> +<a class="qindex" href="main.html">Main Page</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center> +<hr><h1>Version Member List</h1>This is the complete list of members for <a class="el" href="classVersion.html">Version</a>, including all inherited members.<table> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classVersion.html#m3">Build</a></td><td><a class="el" href="classVersion.html">Version</a></td><td></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classVersion.html#m0">Major</a></td><td><a class="el" href="classVersion.html">Version</a></td><td></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classVersion.html#m1">Minor</a></td><td><a class="el" href="classVersion.html">Version</a></td><td></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classVersion.html#m2">Revision</a></td><td><a class="el" href="classVersion.html">Version</a></td><td></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classVersion.html#a0">Version</a>(int major, int minor, int revision, int build)</td><td><a class="el" href="classVersion.html">Version</a></td><td></td></tr> +</table><hr><address style="align: right;"><small>Generated on Wed Jan 22 20:56:48 2003 for InspIRCd by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border=0 +width=110 height=53></a>1.3-rc2 </small></address> +</body> +</html> diff --git a/docs/module-doc/classVersion.html b/docs/module-doc/classVersion.html new file mode 100644 index 000000000..3c3e53d8c --- /dev/null +++ b/docs/module-doc/classVersion.html @@ -0,0 +1,191 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>Version class Reference</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.3-rc2 --> +<center> +<a class="qindex" href="main.html">Main Page</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center> +<hr><h1>Version Class Reference</h1>Holds a module's Version information The four members (set by the constructor only) indicate details as to the version number of a module. +<a href="#_details">More...</a> +<p> +<code>#include <<a class="el" href="modules_8h-source.html">modules.h</a>></code> +<p> +<a href="classVersion-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0> +<tr><td></td></tr> +<tr><td colspan=2><br><h2>Public Methods</h2></td></tr> +<tr><td nowrap align=right valign=top> </td><td valign=bottom><a class="el" href="classVersion.html#a0">Version</a> (int major, int minor, int revision, int build)</td></tr> +<tr><td colspan=2><br><h2>Public Attributes</h2></td></tr> +<tr><td nowrap align=right valign=top>const int </td><td valign=bottom><a class="el" href="classVersion.html#m0">Major</a></td></tr> +<tr><td nowrap align=right valign=top>const int </td><td valign=bottom><a class="el" href="classVersion.html#m1">Minor</a></td></tr> +<tr><td nowrap align=right valign=top>const int </td><td valign=bottom><a class="el" href="classVersion.html#m2">Revision</a></td></tr> +<tr><td nowrap align=right valign=top>const int </td><td valign=bottom><a class="el" href="classVersion.html#m3">Build</a></td></tr> +</table> +<hr><a name="_details"></a><h2>Detailed Description</h2> +Holds a module's Version information The four members (set by the constructor only) indicate details as to the version number of a module. +<p> +A class of type Version is returned by the GetVersion method of the <a class="el" href="classModule.html">Module</a> class. +<p> + +<p> +Definition at line <a class="el" href="modules_8h-source.html#l00054">54</a> of file <a class="el" href="modules_8h-source.html">modules.h</a>.<hr><h2>Constructor & Destructor Documentation</h2> +<a name="a0" doxytag="Version::Version"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> Version::Version </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">int </td> + <td class="mdname" nowrap> <em>major</em>, </td> + </tr> + <tr> + <td></td> + <td></td> + <td class="md" nowrap>int </td> + <td class="mdname" nowrap> <em>minor</em>, </td> + </tr> + <tr> + <td></td> + <td></td> + <td class="md" nowrap>int </td> + <td class="mdname" nowrap> <em>revision</em>, </td> + </tr> + <tr> + <td></td> + <td></td> + <td class="md" nowrap>int </td> + <td class="mdname" nowrap> <em>build</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="modules_8cpp-source.html#l00029">29</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>. +<p> +<div class="fragment"><pre>00029 : <a class="code" href="classVersion.html#m0">Major</a>(major), <a class="code" href="classVersion.html#m1">Minor</a>(minor), <a class="code" href="classVersion.html#m2">Revision</a>(revision), <a class="code" href="classVersion.html#m3">Build</a>(build) { }; +</pre></div> </td> + </tr> +</table> +<hr><h2>Member Data Documentation</h2> +<a name="m3" doxytag="Version::Build"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> const int Version::Build + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="modules_8h-source.html#l00057">57</a> of file <a class="el" href="modules_8h-source.html">modules.h</a>. </td> + </tr> +</table> +<a name="m0" doxytag="Version::Major"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> const int Version::Major + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="modules_8h-source.html#l00057">57</a> of file <a class="el" href="modules_8h-source.html">modules.h</a>. </td> + </tr> +</table> +<a name="m1" doxytag="Version::Minor"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> const int Version::Minor + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="modules_8h-source.html#l00057">57</a> of file <a class="el" href="modules_8h-source.html">modules.h</a>. </td> + </tr> +</table> +<a name="m2" doxytag="Version::Revision"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> const int Version::Revision + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="modules_8h-source.html#l00057">57</a> of file <a class="el" href="modules_8h-source.html">modules.h</a>. </td> + </tr> +</table> +<hr>The documentation for this class was generated from the following files:<ul> +<li><a class="el" href="modules_8h-source.html">modules.h</a><li><a class="el" href="modules_8cpp-source.html">modules.cpp</a></ul> +<hr><address style="align: right;"><small>Generated on Wed Jan 22 20:56:48 2003 for InspIRCd by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border=0 +width=110 height=53></a>1.3-rc2 </small></address> +</body> +</html> diff --git a/docs/module-doc/classchanrec-members.html b/docs/module-doc/classchanrec-members.html new file mode 100644 index 000000000..7d34a88a0 --- /dev/null +++ b/docs/module-doc/classchanrec-members.html @@ -0,0 +1,32 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>Member List</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.3-rc2 --> +<center> +<a class="qindex" href="main.html">Main Page</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center> +<hr><h1>chanrec Member List</h1>This is the complete list of members for <a class="el" href="classchanrec.html">chanrec</a>, including all inherited members.<table> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classchanrec.html#m14">bans</a></td><td><a class="el" href="classchanrec.html">chanrec</a></td><td></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classchanrec.html#m13">c_private</a></td><td><a class="el" href="classchanrec.html">chanrec</a></td><td></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classchanrec.html#a0">chanrec</a>()</td><td><a class="el" href="classchanrec.html">chanrec</a></td><td><code> [inline]</code></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classchanrec.html#m3">created</a></td><td><a class="el" href="classchanrec.html">chanrec</a></td><td></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classchanrec.html#m1">custom_modes</a></td><td><a class="el" href="classchanrec.html">chanrec</a></td><td></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classchanrec.html#m10">inviteonly</a></td><td><a class="el" href="classchanrec.html">chanrec</a></td><td></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classchanrec.html#m7">key</a></td><td><a class="el" href="classchanrec.html">chanrec</a></td><td></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classchanrec.html#m6">limit</a></td><td><a class="el" href="classchanrec.html">chanrec</a></td><td></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classchanrec.html#m11">moderated</a></td><td><a class="el" href="classchanrec.html">chanrec</a></td><td></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classchanrec.html#m0">name</a></td><td><a class="el" href="classchanrec.html">chanrec</a></td><td></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classchanrec.html#m9">noexternal</a></td><td><a class="el" href="classchanrec.html">chanrec</a></td><td></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classchanrec.html#m12">secret</a></td><td><a class="el" href="classchanrec.html">chanrec</a></td><td></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classchanrec.html#m5">setby</a></td><td><a class="el" href="classchanrec.html">chanrec</a></td><td></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classchanrec.html#m2">topic</a></td><td><a class="el" href="classchanrec.html">chanrec</a></td><td></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classchanrec.html#m8">topiclock</a></td><td><a class="el" href="classchanrec.html">chanrec</a></td><td></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classchanrec.html#m4">topicset</a></td><td><a class="el" href="classchanrec.html">chanrec</a></td><td></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classchanrec.html#a1">~chanrec</a>()</td><td><a class="el" href="classchanrec.html">chanrec</a></td><td><code> [inline, virtual]</code></td></tr> +</table><hr><address style="align: right;"><small>Generated on Wed Jan 22 20:56:47 2003 for InspIRCd by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border=0 +width=110 height=53></a>1.3-rc2 </small></address> +</body> +</html> diff --git a/docs/module-doc/classchanrec.html b/docs/module-doc/classchanrec.html new file mode 100644 index 000000000..bf8299560 --- /dev/null +++ b/docs/module-doc/classchanrec.html @@ -0,0 +1,534 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>chanrec class Reference</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.3-rc2 --> +<center> +<a class="qindex" href="main.html">Main Page</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center> +<hr><h1>chanrec Class Reference</h1>Holds all relevent information for a channel. +<a href="#_details">More...</a> +<p> +<code>#include <<a class="el" href="channels_8h-source.html">channels.h</a>></code> +<p> +<a href="classchanrec-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0> +<tr><td></td></tr> +<tr><td colspan=2><br><h2>Public Methods</h2></td></tr> +<tr><td nowrap align=right valign=top> </td><td valign=bottom><a class="el" href="classchanrec.html#a0">chanrec</a> ()</td></tr> +<tr><td> </td><td><font size=-1><em>Creates a channel record and initialises it with default values.</em> <a href="#a0"></a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>virtual </td><td valign=bottom><a class="el" href="classchanrec.html#a1">~chanrec</a> ()</td></tr> +<tr><td colspan=2><br><h2>Public Attributes</h2></td></tr> +<tr><td nowrap align=right valign=top>char </td><td valign=bottom><a class="el" href="classchanrec.html#m0">name</a> [CHANMAX]</td></tr> +<tr><td> </td><td><font size=-1><em>The channels name.</em> <a href="#m0"></a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>char </td><td valign=bottom><a class="el" href="classchanrec.html#m1">custom_modes</a> [MAXMODES]</td></tr> +<tr><td> </td><td><font size=-1><em>Custom modes for the channel.</em> <a href="#m1"></a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>char </td><td valign=bottom><a class="el" href="classchanrec.html#m2">topic</a> [MAXBUF]</td></tr> +<tr><td> </td><td><font size=-1><em>Channel topic.</em> <a href="#m2"></a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>time_t </td><td valign=bottom><a class="el" href="classchanrec.html#m3">created</a></td></tr> +<tr><td> </td><td><font size=-1><em>Creation time.</em> <a href="#m3"></a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>time_t </td><td valign=bottom><a class="el" href="classchanrec.html#m4">topicset</a></td></tr> +<tr><td> </td><td><font size=-1><em>Time topic was set.</em> <a href="#m4"></a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>char </td><td valign=bottom><a class="el" href="classchanrec.html#m5">setby</a> [NICKMAX]</td></tr> +<tr><td> </td><td><font size=-1><em>The last user to set the topic.</em> <a href="#m5"></a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>long </td><td valign=bottom><a class="el" href="classchanrec.html#m6">limit</a></td></tr> +<tr><td> </td><td><font size=-1><em>Contains the channel user limit.</em> <a href="#m6"></a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>char </td><td valign=bottom><a class="el" href="classchanrec.html#m7">key</a> [32]</td></tr> +<tr><td> </td><td><font size=-1><em>Contains the channel key.</em> <a href="#m7"></a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>short int </td><td valign=bottom><a class="el" href="classchanrec.html#m8">topiclock</a></td></tr> +<tr><td> </td><td><font size=-1><em>Nonzero if the mode +t is set.</em> <a href="#m8"></a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>short int </td><td valign=bottom><a class="el" href="classchanrec.html#m9">noexternal</a></td></tr> +<tr><td> </td><td><font size=-1><em>Nonzero if the mode +n is set.</em> <a href="#m9"></a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>short int </td><td valign=bottom><a class="el" href="classchanrec.html#m10">inviteonly</a></td></tr> +<tr><td> </td><td><font size=-1><em>Nonzero if the mode +i is set.</em> <a href="#m10"></a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>short int </td><td valign=bottom><a class="el" href="classchanrec.html#m11">moderated</a></td></tr> +<tr><td> </td><td><font size=-1><em>Nonzero if the mode +m is set.</em> <a href="#m11"></a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>short int </td><td valign=bottom><a class="el" href="classchanrec.html#m12">secret</a></td></tr> +<tr><td> </td><td><font size=-1><em>Nonzero if the mode +s is set.</em> <a href="#m12"></a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>short int </td><td valign=bottom><a class="el" href="classchanrec.html#m13">c_private</a></td></tr> +<tr><td> </td><td><font size=-1><em>Nonzero if the mode +p is set.</em> <a href="#m13"></a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top><a class="el" href="channels_8h.html#a5">BanList</a> </td><td valign=bottom><a class="el" href="classchanrec.html#m14">bans</a></td></tr> +<tr><td> </td><td><font size=-1><em>The list of all bans set on the channel.</em> <a href="#m14"></a><em></em></font><br><br></td></tr> +</table> +<hr><a name="_details"></a><h2>Detailed Description</h2> +Holds all relevent information for a channel. +<p> +This class represents a channel, and contains its name, modes, time created, topic, topic set time, etc, and an instance of the BanList type. +<p> + +<p> +Definition at line <a class="el" href="channels_8h-source.html#l00082">82</a> of file <a class="el" href="channels_8h-source.html">channels.h</a>.<hr><h2>Constructor & Destructor Documentation</h2> +<a name="a0" doxytag="chanrec::chanrec"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> chanrec::chanrec </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top">) </td> + <td class="md" nowrap><code> [inline]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Creates a channel record and initialises it with default values. +<p> + +<p> +Definition at line <a class="el" href="channels_8h-source.html#l00150">150</a> of file <a class="el" href="channels_8h-source.html">channels.h</a>. +<p> +<div class="fragment"><pre>00151 { +00152 strcpy(name,<span class="stringliteral">""</span>); +00153 strcpy(custom_modes,<span class="stringliteral">""</span>); +00154 strcpy(topic,<span class="stringliteral">""</span>); +00155 strcpy(setby,<span class="stringliteral">""</span>); +00156 strcpy(key,<span class="stringliteral">""</span>); +00157 <a class="code" href="classchanrec.html#m3">created</a> = <a class="code" href="classchanrec.html#m4">topicset</a> = <a class="code" href="classchanrec.html#m6">limit</a> = 0; +00158 <a class="code" href="classchanrec.html#m8">topiclock</a> = <a class="code" href="classchanrec.html#m9">noexternal</a> = <a class="code" href="classchanrec.html#m10">inviteonly</a> = <a class="code" href="classchanrec.html#m11">moderated</a> = <a class="code" href="classchanrec.html#m12">secret</a> = <a class="code" href="classchanrec.html#m13">c_private</a> = <span class="keyword">false</span>; +00159 } +</pre></div> </td> + </tr> +</table> +<a name="a1" doxytag="chanrec::~chanrec"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> virtual chanrec::~chanrec </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top">) </td> + <td class="md" nowrap><code> [inline, virtual]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="channels_8h-source.html#l00161">161</a> of file <a class="el" href="channels_8h-source.html">channels.h</a>. +<p> +<div class="fragment"><pre>00161 { <span class="comment">/* stub */</span> } +</pre></div> </td> + </tr> +</table> +<hr><h2>Member Data Documentation</h2> +<a name="m14" doxytag="chanrec::bans"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="channels_8h.html#a5">BanList</a> chanrec::bans + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +The list of all bans set on the channel. +<p> + +<p> +Definition at line <a class="el" href="channels_8h-source.html#l00146">146</a> of file <a class="el" href="channels_8h-source.html">channels.h</a>. </td> + </tr> +</table> +<a name="m13" doxytag="chanrec::c_private"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> short int chanrec::c_private + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Nonzero if the mode +p is set. +<p> +This value cannot be set at the same time as <a class="el" href="classchanrec.html#m12">chanrec::secret</a> +<p> +Definition at line <a class="el" href="channels_8h-source.html#l00142">142</a> of file <a class="el" href="channels_8h-source.html">channels.h</a>. </td> + </tr> +</table> +<a name="m3" doxytag="chanrec::created"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> time_t chanrec::created + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Creation time. +<p> + +<p> +Definition at line <a class="el" href="channels_8h-source.html#l00098">98</a> of file <a class="el" href="channels_8h-source.html">channels.h</a>. </td> + </tr> +</table> +<a name="m1" doxytag="chanrec::custom_modes"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> char chanrec::custom_modes[MAXMODES] + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Custom modes for the channel. +<p> +Plugins may use this field in any way they see fit. +<p> +Definition at line <a class="el" href="channels_8h-source.html#l00091">91</a> of file <a class="el" href="channels_8h-source.html">channels.h</a>. </td> + </tr> +</table> +<a name="m10" doxytag="chanrec::inviteonly"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> short int chanrec::inviteonly + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Nonzero if the mode +i is set. +<p> + +<p> +Definition at line <a class="el" href="channels_8h-source.html#l00128">128</a> of file <a class="el" href="channels_8h-source.html">channels.h</a>. </td> + </tr> +</table> +<a name="m7" doxytag="chanrec::key"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> char chanrec::key[32] + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Contains the channel key. +<p> +If this value is an empty string, there is no channel key in place. +<p> +Definition at line <a class="el" href="channels_8h-source.html#l00116">116</a> of file <a class="el" href="channels_8h-source.html">channels.h</a>. </td> + </tr> +</table> +<a name="m6" doxytag="chanrec::limit"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> long chanrec::limit + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Contains the channel user limit. +<p> +If this value is zero, there is no limit in place. +<p> +Definition at line <a class="el" href="channels_8h-source.html#l00111">111</a> of file <a class="el" href="channels_8h-source.html">channels.h</a>. </td> + </tr> +</table> +<a name="m11" doxytag="chanrec::moderated"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> short int chanrec::moderated + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Nonzero if the mode +m is set. +<p> + +<p> +Definition at line <a class="el" href="channels_8h-source.html#l00132">132</a> of file <a class="el" href="channels_8h-source.html">channels.h</a>. </td> + </tr> +</table> +<a name="m0" doxytag="chanrec::name"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> char chanrec::name[CHANMAX] + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +The channels name. +<p> + +<p> +Definition at line <a class="el" href="channels_8h-source.html#l00087">87</a> of file <a class="el" href="channels_8h-source.html">channels.h</a>. </td> + </tr> +</table> +<a name="m9" doxytag="chanrec::noexternal"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> short int chanrec::noexternal + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Nonzero if the mode +n is set. +<p> + +<p> +Definition at line <a class="el" href="channels_8h-source.html#l00124">124</a> of file <a class="el" href="channels_8h-source.html">channels.h</a>. </td> + </tr> +</table> +<a name="m12" doxytag="chanrec::secret"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> short int chanrec::secret + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Nonzero if the mode +s is set. +<p> +This value cannot be set at the same time as <a class="el" href="classchanrec.html#m13">chanrec::c_private</a> +<p> +Definition at line <a class="el" href="channels_8h-source.html#l00137">137</a> of file <a class="el" href="channels_8h-source.html">channels.h</a>. </td> + </tr> +</table> +<a name="m5" doxytag="chanrec::setby"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> char chanrec::setby[NICKMAX] + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +The last user to set the topic. +<p> +If this member is an empty string, no topic was ever set. +<p> +Definition at line <a class="el" href="channels_8h-source.html#l00106">106</a> of file <a class="el" href="channels_8h-source.html">channels.h</a>. </td> + </tr> +</table> +<a name="m2" doxytag="chanrec::topic"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> char chanrec::topic[MAXBUF] + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Channel topic. +<p> +If this is an empty string, no channel topic is set. +<p> +Definition at line <a class="el" href="channels_8h-source.html#l00095">95</a> of file <a class="el" href="channels_8h-source.html">channels.h</a>. </td> + </tr> +</table> +<a name="m8" doxytag="chanrec::topiclock"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> short int chanrec::topiclock + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Nonzero if the mode +t is set. +<p> + +<p> +Definition at line <a class="el" href="channels_8h-source.html#l00120">120</a> of file <a class="el" href="channels_8h-source.html">channels.h</a>. </td> + </tr> +</table> +<a name="m4" doxytag="chanrec::topicset"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> time_t chanrec::topicset + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Time topic was set. +<p> +If no topic was ever set, this will be equal to <a class="el" href="classchanrec.html#m3">chanrec::created</a> +<p> +Definition at line <a class="el" href="channels_8h-source.html#l00102">102</a> of file <a class="el" href="channels_8h-source.html">channels.h</a>. </td> + </tr> +</table> +<hr>The documentation for this class was generated from the following file:<ul> +<li><a class="el" href="channels_8h-source.html">channels.h</a></ul> +<hr><address style="align: right;"><small>Generated on Wed Jan 22 20:56:47 2003 for InspIRCd by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border=0 +width=110 height=53></a>1.3-rc2 </small></address> +</body> +</html> diff --git a/docs/module-doc/classes.html b/docs/module-doc/classes.html new file mode 100644 index 000000000..d305624f7 --- /dev/null +++ b/docs/module-doc/classes.html @@ -0,0 +1,26 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>Alphabetical index</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.3-rc2 --> +<center> +<a class="qindex" href="main.html">Main Page</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center> +<hr><h1>InspIRCd Compound Index</h1><table align=center width="95%" border="0" cellspacing="0" cellpadding="0"> +<tr><td><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah"> A </td></tr></table> +</td><td><a class="el" href="classConfigReader.html">ConfigReader</a> </td><td><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah"> H </td></tr></table> +</td><td><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah"> M </td></tr></table> +</td><td><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah"> U </td></tr></table> +</td></tr><tr><td><a class="el" href="classAdmin.html">Admin</a> </td><td><a class="el" href="classConnectClass.html">ConnectClass</a> </td><td><a class="el" href="classHostItem.html">HostItem</a> </td><td><a class="el" href="classModule.html">Module</a> </td><td><a class="el" href="classucrec.html">ucrec</a> </td></tr><tr><td><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah"> B </td></tr></table> +</td><td><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah"> E </td></tr></table> +</td><td><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah"> I </td></tr></table> +</td><td><a class="el" href="classModuleFactory.html">ModuleFactory</a> </td><td><a class="el" href="classuserrec.html">userrec</a> </td></tr><tr><td><a class="el" href="classBanItem.html">BanItem</a> </td><td><a class="el" href="classExemptItem.html">ExemptItem</a> </td><td><a class="el" href="classInvited.html">Invited</a> </td><td><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah"> S </td></tr></table> +</td><td><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah"> V </td></tr></table> +</td></tr><tr><td><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah"> C </td></tr></table> +</td><td><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah"> F </td></tr></table> +</td><td><a class="el" href="classInviteItem.html">InviteItem</a> </td><td><a class="el" href="classServer.html">Server</a> </td><td><a class="el" href="classVersion.html">Version</a> </td></tr><tr><td><a class="el" href="classchanrec.html">chanrec</a> </td><td><a class="el" href="classFileReader.html">FileReader</a> </td></tr></table><hr><address style="align: right;"><small>Generated on Wed Jan 22 20:56:47 2003 for InspIRCd by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border=0 +width=110 height=53></a>1.3-rc2 </small></address> +</body> +</html> diff --git a/docs/module-doc/classucrec-members.html b/docs/module-doc/classucrec-members.html new file mode 100644 index 000000000..43e5c1cca --- /dev/null +++ b/docs/module-doc/classucrec-members.html @@ -0,0 +1,19 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>Member List</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.3-rc2 --> +<center> +<a class="qindex" href="main.html">Main Page</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center> +<hr><h1>ucrec Member List</h1>This is the complete list of members for <a class="el" href="classucrec.html">ucrec</a>, including all inherited members.<table> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classucrec.html#m1">channel</a></td><td><a class="el" href="classucrec.html">ucrec</a></td><td></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classucrec.html#m0">uc_modes</a></td><td><a class="el" href="classucrec.html">ucrec</a></td><td></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classucrec.html#a0">ucrec</a>()</td><td><a class="el" href="classucrec.html">ucrec</a></td><td><code> [inline]</code></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classucrec.html#a1">~ucrec</a>()</td><td><a class="el" href="classucrec.html">ucrec</a></td><td><code> [inline, virtual]</code></td></tr> +</table><hr><address style="align: right;"><small>Generated on Wed Jan 22 20:56:48 2003 for InspIRCd by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border=0 +width=110 height=53></a>1.3-rc2 </small></address> +</body> +</html> diff --git a/docs/module-doc/classucrec.html b/docs/module-doc/classucrec.html new file mode 100644 index 000000000..c95b8a3b6 --- /dev/null +++ b/docs/module-doc/classucrec.html @@ -0,0 +1,161 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>ucrec class Reference</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.3-rc2 --> +<center> +<a class="qindex" href="main.html">Main Page</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center> +<hr><h1>ucrec Class Reference</h1>Holds a user's modes on a channel This class associates a users privilages with a channel by creating a pointer link between a userrec and chanrec class. +<a href="#_details">More...</a> +<p> +<code>#include <<a class="el" href="channels_8h-source.html">channels.h</a>></code> +<p> +<a href="classucrec-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0> +<tr><td></td></tr> +<tr><td colspan=2><br><h2>Public Methods</h2></td></tr> +<tr><td nowrap align=right valign=top> </td><td valign=bottom><a class="el" href="classucrec.html#a0">ucrec</a> ()</td></tr> +<tr><td nowrap align=right valign=top>virtual </td><td valign=bottom><a class="el" href="classucrec.html#a1">~ucrec</a> ()</td></tr> +<tr><td colspan=2><br><h2>Public Attributes</h2></td></tr> +<tr><td nowrap align=right valign=top>long </td><td valign=bottom><a class="el" href="classucrec.html#m0">uc_modes</a></td></tr> +<tr><td> </td><td><font size=-1><em>Contains a bitmask of the UCMODE_OP ...</em> <a href="#m0"></a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top><a class="el" href="classchanrec.html">chanrec</a> * </td><td valign=bottom><a class="el" href="classucrec.html#m1">channel</a></td></tr> +<tr><td> </td><td><font size=-1><em>Points to the channel record where the given modes apply.</em> <a href="#m1"></a><em></em></font><br><br></td></tr> +</table> +<hr><a name="_details"></a><h2>Detailed Description</h2> +Holds a user's modes on a channel This class associates a users privilages with a channel by creating a pointer link between a userrec and chanrec class. +<p> +The uc_modes member holds a bitmask of which privilages the user has on the channel, such as op, voice, etc. +<p> + +<p> +Definition at line <a class="el" href="channels_8h-source.html#l00178">178</a> of file <a class="el" href="channels_8h-source.html">channels.h</a>.<hr><h2>Constructor & Destructor Documentation</h2> +<a name="a0" doxytag="ucrec::ucrec"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> ucrec::ucrec </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top">) </td> + <td class="md" nowrap><code> [inline]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="channels_8h-source.html#l00191">191</a> of file <a class="el" href="channels_8h-source.html">channels.h</a>. +<p> +<div class="fragment"><pre>00191 { <span class="comment">/* stub */</span> } +</pre></div> </td> + </tr> +</table> +<a name="a1" doxytag="ucrec::~ucrec"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> virtual ucrec::~ucrec </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top">) </td> + <td class="md" nowrap><code> [inline, virtual]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="channels_8h-source.html#l00192">192</a> of file <a class="el" href="channels_8h-source.html">channels.h</a>. +<p> +<div class="fragment"><pre>00192 { <span class="comment">/* stub */</span> } +</pre></div> </td> + </tr> +</table> +<hr><h2>Member Data Documentation</h2> +<a name="m1" doxytag="ucrec::channel"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="classchanrec.html">chanrec</a>* ucrec::channel + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Points to the channel record where the given modes apply. +<p> +If the record is not in use, this value will be NULL. +<p> +Definition at line <a class="el" href="channels_8h-source.html#l00189">189</a> of file <a class="el" href="channels_8h-source.html">channels.h</a>. +<p> +Referenced by <a class="el" href="users_8cpp-source.html#l00023">userrec::userrec()</a>. </td> + </tr> +</table> +<a name="m0" doxytag="ucrec::uc_modes"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> long ucrec::uc_modes + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Contains a bitmask of the UCMODE_OP ... +<p> +UCMODE_FOUNDER values. If this value is zero, the user has no privilages upon the channel. +<p> +Definition at line <a class="el" href="channels_8h-source.html#l00184">184</a> of file <a class="el" href="channels_8h-source.html">channels.h</a>. </td> + </tr> +</table> +<hr>The documentation for this class was generated from the following file:<ul> +<li><a class="el" href="channels_8h-source.html">channels.h</a></ul> +<hr><address style="align: right;"><small>Generated on Wed Jan 22 20:56:48 2003 for InspIRCd by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border=0 +width=110 height=53></a>1.3-rc2 </small></address> +</body> +</html> diff --git a/docs/module-doc/classuserrec-members.html b/docs/module-doc/classuserrec-members.html new file mode 100644 index 000000000..78781c9e8 --- /dev/null +++ b/docs/module-doc/classuserrec-members.html @@ -0,0 +1,47 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>Member List</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.3-rc2 --> +<center> +<a class="qindex" href="main.html">Main Page</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center> +<hr><h1>userrec Member List</h1>This is the complete list of members for <a class="el" href="classuserrec.html">userrec</a>, including all inherited members.<table> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classuserrec.html#m16">awaymsg</a></td><td><a class="el" href="classuserrec.html">userrec</a></td><td></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classuserrec.html#m18">bytes_in</a></td><td><a class="el" href="classuserrec.html">userrec</a></td><td></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classuserrec.html#m19">bytes_out</a></td><td><a class="el" href="classuserrec.html">userrec</a></td><td></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classuserrec.html#m14">chans</a></td><td><a class="el" href="classuserrec.html">userrec</a></td><td></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classuserrec.html#m20">cmds_in</a></td><td><a class="el" href="classuserrec.html">userrec</a></td><td></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classuserrec.html#m21">cmds_out</a></td><td><a class="el" href="classuserrec.html">userrec</a></td><td></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classuserrec.html#m4">dhost</a></td><td><a class="el" href="classuserrec.html">userrec</a></td><td></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classuserrec.html#m6">fd</a></td><td><a class="el" href="classuserrec.html">userrec</a></td><td></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classuserrec.html#m5">fullname</a></td><td><a class="el" href="classuserrec.html">userrec</a></td><td></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classuserrec.html#a2">GetFullHost</a>()</td><td><a class="el" href="classuserrec.html">userrec</a></td><td><code> [virtual]</code></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classuserrec.html#a3">GetFullRealHost</a>()</td><td><a class="el" href="classuserrec.html">userrec</a></td><td><code> [virtual]</code></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classuserrec.html#m23">haspassed</a></td><td><a class="el" href="classuserrec.html">userrec</a></td><td></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classuserrec.html#m3">host</a></td><td><a class="el" href="classuserrec.html">userrec</a></td><td></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classuserrec.html#m2">ident</a></td><td><a class="el" href="classuserrec.html">userrec</a></td><td></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classuserrec.html#m11">idle_lastmsg</a></td><td><a class="el" href="classuserrec.html">userrec</a></td><td></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classuserrec.html#m8">inbuf</a></td><td><a class="el" href="classuserrec.html">userrec</a></td><td></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classuserrec.html#o0">invites</a></td><td><a class="el" href="classuserrec.html">userrec</a></td><td><code> [private]</code></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classuserrec.html#a5">InviteTo</a>(char *channel)</td><td><a class="el" href="classuserrec.html">userrec</a></td><td><code> [virtual]</code></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classuserrec.html#m1">ip</a></td><td><a class="el" href="classuserrec.html">userrec</a></td><td></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classuserrec.html#a4">IsInvited</a>(char *channel)</td><td><a class="el" href="classuserrec.html">userrec</a></td><td><code> [virtual]</code></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classuserrec.html#m9">lastping</a></td><td><a class="el" href="classuserrec.html">userrec</a></td><td></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classuserrec.html#m7">modes</a></td><td><a class="el" href="classuserrec.html">userrec</a></td><td></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classuserrec.html#m0">nick</a></td><td><a class="el" href="classuserrec.html">userrec</a></td><td></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classuserrec.html#m12">nping</a></td><td><a class="el" href="classuserrec.html">userrec</a></td><td></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classuserrec.html#m17">port</a></td><td><a class="el" href="classuserrec.html">userrec</a></td><td></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classuserrec.html#m13">registered</a></td><td><a class="el" href="classuserrec.html">userrec</a></td><td></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classuserrec.html#a6">RemoveInvite</a>(char *channel)</td><td><a class="el" href="classuserrec.html">userrec</a></td><td><code> [virtual]</code></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classuserrec.html#m22">result</a></td><td><a class="el" href="classuserrec.html">userrec</a></td><td></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classuserrec.html#m15">server</a></td><td><a class="el" href="classuserrec.html">userrec</a></td><td></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classuserrec.html#m10">signon</a></td><td><a class="el" href="classuserrec.html">userrec</a></td><td></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classuserrec.html#a0">userrec</a>()</td><td><a class="el" href="classuserrec.html">userrec</a></td><td></td></tr> + <tr bgcolor="#f0f0f0"><td><a class="el" href="classuserrec.html#a1">~userrec</a>()</td><td><a class="el" href="classuserrec.html">userrec</a></td><td><code> [inline, virtual]</code></td></tr> +</table><hr><address style="align: right;"><small>Generated on Wed Jan 22 20:56:48 2003 for InspIRCd by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border=0 +width=110 height=53></a>1.3-rc2 </small></address> +</body> +</html> diff --git a/docs/module-doc/classuserrec.html b/docs/module-doc/classuserrec.html new file mode 100644 index 000000000..d4be7912e --- /dev/null +++ b/docs/module-doc/classuserrec.html @@ -0,0 +1,1085 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>userrec class Reference</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.3-rc2 --> +<center> +<a class="qindex" href="main.html">Main Page</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center> +<hr><h1>userrec Class Reference</h1>Holds all information about a user This class stores all information about a user connected to the irc server. +<a href="#_details">More...</a> +<p> +<code>#include <<a class="el" href="users_8h-source.html">users.h</a>></code> +<p> +<a href="classuserrec-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0> +<tr><td></td></tr> +<tr><td colspan=2><br><h2>Public Methods</h2></td></tr> +<tr><td nowrap align=right valign=top> </td><td valign=bottom><a class="el" href="classuserrec.html#a0">userrec</a> ()</td></tr> +<tr><td nowrap align=right valign=top>virtual </td><td valign=bottom><a class="el" href="classuserrec.html#a1">~userrec</a> ()</td></tr> +<tr><td nowrap align=right valign=top>virtual char * </td><td valign=bottom><a class="el" href="classuserrec.html#a2">GetFullHost</a> ()</td></tr> +<tr><td> </td><td><font size=-1><em>Returns the full displayed host of the user This member function returns the hostname of the user as seen by other users on the server, in nick!identhost form.</em> <a href="#a2"></a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>virtual char * </td><td valign=bottom><a class="el" href="classuserrec.html#a3">GetFullRealHost</a> ()</td></tr> +<tr><td> </td><td><font size=-1><em>Returns the full real host of the user This member function returns the hostname of the user as seen by other users on the server, in nick!identhost form.</em> <a href="#a3"></a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>virtual bool </td><td valign=bottom><a class="el" href="classuserrec.html#a4">IsInvited</a> (char *channel)</td></tr> +<tr><td> </td><td><font size=-1><em>Returns true if a user is invited to a channel.</em> <a href="#a4"></a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classuserrec.html#a5">InviteTo</a> (char *channel)</td></tr> +<tr><td> </td><td><font size=-1><em>Adds a channel to a users invite list (invites them to a channel).</em> <a href="#a5"></a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classuserrec.html#a6">RemoveInvite</a> (char *channel)</td></tr> +<tr><td> </td><td><font size=-1><em>Removes a channel from a users invite list.</em> <a href="#a6"></a><em></em></font><br><br></td></tr> +<tr><td colspan=2><br><h2>Public Attributes</h2></td></tr> +<tr><td nowrap align=right valign=top>char </td><td valign=bottom><a class="el" href="classuserrec.html#m0">nick</a> [NICKMAX]</td></tr> +<tr><td> </td><td><font size=-1><em>The users nickname.</em> <a href="#m0"></a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>unsigned long </td><td valign=bottom><a class="el" href="classuserrec.html#m1">ip</a></td></tr> +<tr><td> </td><td><font size=-1><em>The users ip address in network order.</em> <a href="#m1"></a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>char </td><td valign=bottom><a class="el" href="classuserrec.html#m2">ident</a> [64]</td></tr> +<tr><td> </td><td><font size=-1><em>The users ident reply.</em> <a href="#m2"></a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>char </td><td valign=bottom><a class="el" href="classuserrec.html#m3">host</a> [256]</td></tr> +<tr><td> </td><td><font size=-1><em>The users hostname, or ip address in string form.</em> <a href="#m3"></a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>char </td><td valign=bottom><a class="el" href="classuserrec.html#m4">dhost</a> [256]</td></tr> +<tr><td> </td><td><font size=-1><em>The host displayed to non-opers (used for cloaking etc).</em> <a href="#m4"></a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>char </td><td valign=bottom><a class="el" href="classuserrec.html#m5">fullname</a> [128]</td></tr> +<tr><td> </td><td><font size=-1><em>The users full name.</em> <a href="#m5"></a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>int </td><td valign=bottom><a class="el" href="classuserrec.html#m6">fd</a></td></tr> +<tr><td> </td><td><font size=-1><em>The users file descriptor.</em> <a href="#m6"></a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>char </td><td valign=bottom><a class="el" href="classuserrec.html#m7">modes</a> [32]</td></tr> +<tr><td> </td><td><font size=-1><em>The user's mode string.</em> <a href="#m7"></a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>char </td><td valign=bottom><a class="el" href="classuserrec.html#m8">inbuf</a> [MAXBUF]</td></tr> +<tr><td> </td><td><font size=-1><em>The users input buffer.</em> <a href="#m8"></a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>time_t </td><td valign=bottom><a class="el" href="classuserrec.html#m9">lastping</a></td></tr> +<tr><td> </td><td><font size=-1><em>The last time the user was pinged by the core.</em> <a href="#m9"></a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>time_t </td><td valign=bottom><a class="el" href="classuserrec.html#m10">signon</a></td></tr> +<tr><td> </td><td><font size=-1><em>The users signon time.</em> <a href="#m10"></a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>time_t </td><td valign=bottom><a class="el" href="classuserrec.html#m11">idle_lastmsg</a></td></tr> +<tr><td> </td><td><font size=-1><em>The time the user last sent a message.</em> <a href="#m11"></a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>time_t </td><td valign=bottom><a class="el" href="classuserrec.html#m12">nping</a></td></tr> +<tr><td> </td><td><font size=-1><em>True if the user replied to their last ping.</em> <a href="#m12"></a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>int </td><td valign=bottom><a class="el" href="classuserrec.html#m13">registered</a></td></tr> +<tr><td> </td><td><font size=-1><em>Bit 1 is set if the user sent a NICK command, bit 2 is set if the user sent a USER command.</em> <a href="#m13"></a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top><a class="el" href="classucrec.html">ucrec</a> </td><td valign=bottom><a class="el" href="classuserrec.html#m14">chans</a> [MAXCHANS]</td></tr> +<tr><td> </td><td><font size=-1><em>A list of the channels the user is currently on.</em> <a href="#m14"></a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>char </td><td valign=bottom><a class="el" href="classuserrec.html#m15">server</a> [256]</td></tr> +<tr><td> </td><td><font size=-1><em>The server the user is connected to.</em> <a href="#m15"></a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>char </td><td valign=bottom><a class="el" href="classuserrec.html#m16">awaymsg</a> [512]</td></tr> +<tr><td> </td><td><font size=-1><em>The user's away message.</em> <a href="#m16"></a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>int </td><td valign=bottom><a class="el" href="classuserrec.html#m17">port</a></td></tr> +<tr><td> </td><td><font size=-1><em>The port that the user connected to.</em> <a href="#m17"></a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>long </td><td valign=bottom><a class="el" href="classuserrec.html#m18">bytes_in</a></td></tr> +<tr><td> </td><td><font size=-1><em>Stores the number of incoming bytes from the connection.</em> <a href="#m18"></a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>long </td><td valign=bottom><a class="el" href="classuserrec.html#m19">bytes_out</a></td></tr> +<tr><td> </td><td><font size=-1><em>Stores the number of outgoing bytes to the connection.</em> <a href="#m19"></a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>long </td><td valign=bottom><a class="el" href="classuserrec.html#m20">cmds_in</a></td></tr> +<tr><td> </td><td><font size=-1><em>Stores the number of incoming commands from the connection.</em> <a href="#m20"></a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>long </td><td valign=bottom><a class="el" href="classuserrec.html#m21">cmds_out</a></td></tr> +<tr><td> </td><td><font size=-1><em>Stores the number of outgoing commands to the connection.</em> <a href="#m21"></a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>char </td><td valign=bottom><a class="el" href="classuserrec.html#m22">result</a> [256]</td></tr> +<tr><td> </td><td><font size=-1><em>Stores the result of the last GetFullHost or GetRealHost call.</em> <a href="#m22"></a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>bool </td><td valign=bottom><a class="el" href="classuserrec.html#m23">haspassed</a></td></tr> +<tr><td> </td><td><font size=-1><em>True if a correct password has been given using PASS command.</em> <a href="#m23"></a><em></em></font><br><br></td></tr> +<tr><td colspan=2><br><h2>Private Attributes</h2></td></tr> +<tr><td nowrap align=right valign=top><a class="el" href="users_8h.html#a6">InvitedList</a> </td><td valign=bottom><a class="el" href="classuserrec.html#o0">invites</a></td></tr> +<tr><td> </td><td><font size=-1><em>A list of channels the user has a pending invite to.</em> <a href="#o0"></a><em></em></font><br><br></td></tr> +</table> +<hr><a name="_details"></a><h2>Detailed Description</h2> +Holds all information about a user This class stores all information about a user connected to the irc server. +<p> +Everything about a connection is stored here primarily, from the user's socket ID (file descriptor) through to the user's nickname and hostname. Use the Find method of the server class to locate a specific user by nickname. +<p> + +<p> +Definition at line <a class="el" href="users_8h-source.html#l00080">80</a> of file <a class="el" href="users_8h-source.html">users.h</a>.<hr><h2>Constructor & Destructor Documentation</h2> +<a name="a0" doxytag="userrec::userrec"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> userrec::userrec </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top">) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="users_8cpp-source.html#l00023">23</a> of file <a class="el" href="users_8cpp-source.html">users.cpp</a>. +<p> +References <a class="el" href="users_8h-source.html#l00183">bytes_in</a>, <a class="el" href="users_8h-source.html#l00188">bytes_out</a>, <a class="el" href="channels_8h-source.html#l00189">ucrec::channel</a>, <a class="el" href="users_8h-source.html#l00165">chans</a>, <a class="el" href="users_8h-source.html#l00193">cmds_in</a>, <a class="el" href="users_8h-source.html#l00198">cmds_out</a>, <a class="el" href="users_8h-source.html#l00120">fd</a>, <a class="el" href="users_8h-source.html#l00209">haspassed</a>, <a class="el" href="users_8h-source.html#l00147">idle_lastmsg</a>, <a class="el" href="users_8h-source.html#l00086">invites</a>, <a class="el" href="users_8h-source.html#l00097">ip</a>, <a class="el" href="users_8h-source.html#l00138">lastping</a>, <a class="el" href="users_8h-source.html#l00153">nping</a>, <a class="el" href="users_8h-source.html#l00178">port</a>, <a class="el" href="users_8h-source.html#l00159">registered</a>, and <a class="el" href="users_8h-source.html#l00142">signon</a>. +<p> +<div class="fragment"><pre>00024 { +00025 <span class="comment">// the PROPER way to do it, AVOID bzero at *ALL* costs</span> +00026 strcpy(nick,<span class="stringliteral">""</span>); +00027 <a class="code" href="classuserrec.html#m1">ip</a> = 0; +00028 strcpy(ident,<span class="stringliteral">""</span>); +00029 strcpy(host,<span class="stringliteral">""</span>); +00030 strcpy(dhost,<span class="stringliteral">""</span>); +00031 strcpy(fullname,<span class="stringliteral">""</span>); +00032 strcpy(modes,<span class="stringliteral">""</span>); +00033 strcpy(inbuf,<span class="stringliteral">""</span>); +00034 strcpy(server,<span class="stringliteral">""</span>); +00035 strcpy(awaymsg,<span class="stringliteral">""</span>); +00036 <a class="code" href="classuserrec.html#m6">fd</a> = <a class="code" href="classuserrec.html#m9">lastping</a> = <a class="code" href="classuserrec.html#m10">signon</a> = <a class="code" href="classuserrec.html#m11">idle_lastmsg</a> = <a class="code" href="classuserrec.html#m12">nping</a> = <a class="code" href="classuserrec.html#m13">registered</a> = 0; +00037 <a class="code" href="classuserrec.html#m17">port</a> = <a class="code" href="classuserrec.html#m18">bytes_in</a> = <a class="code" href="classuserrec.html#m19">bytes_out</a> = <a class="code" href="classuserrec.html#m20">cmds_in</a> = <a class="code" href="classuserrec.html#m21">cmds_out</a> = 0; +00038 <a class="code" href="classuserrec.html#m23">haspassed</a> = <span class="keyword">false</span>; +00039 strcpy(result,<span class="stringliteral">""</span>); +00040 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < MAXCHANS; i++) +00041 { +00042 <a class="code" href="classuserrec.html#m14">chans</a>[i].<a class="code" href="classucrec.html#m1">channel</a> = NULL; +00043 } +00044 <a class="code" href="classuserrec.html#o0">invites</a>.clear(); +00045 } +</pre></div> </td> + </tr> +</table> +<a name="a1" doxytag="userrec::~userrec"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> virtual userrec::~userrec </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top">) </td> + <td class="md" nowrap><code> [inline, virtual]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="users_8h-source.html#l00213">213</a> of file <a class="el" href="users_8h-source.html">users.h</a>. +<p> +<div class="fragment"><pre>00213 { } +</pre></div> </td> + </tr> +</table> +<hr><h2>Member Function Documentation</h2> +<a name="a2" doxytag="userrec::GetFullHost"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> char * userrec::GetFullHost </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top">) </td> + <td class="md" nowrap><code> [virtual]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Returns the full displayed host of the user This member function returns the hostname of the user as seen by other users on the server, in nick!identhost form. +<p> + +<p> +Definition at line <a class="el" href="users_8cpp-source.html#l00048">48</a> of file <a class="el" href="users_8cpp-source.html">users.cpp</a>. +<p> +References <a class="el" href="users_8h-source.html#l00203">result</a>. +<p> +<div class="fragment"><pre>00049 { +00050 sprintf(result,<span class="stringliteral">"%s!%s@%s"</span>,nick,ident,dhost); +00051 <span class="keywordflow">return</span> <a class="code" href="classuserrec.html#m22">result</a>; +00052 } +</pre></div> </td> + </tr> +</table> +<a name="a3" doxytag="userrec::GetFullRealHost"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> char * userrec::GetFullRealHost </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top">) </td> + <td class="md" nowrap><code> [virtual]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Returns the full real host of the user This member function returns the hostname of the user as seen by other users on the server, in nick!identhost form. +<p> +If any form of hostname cloaking is in operation, e.g. through a module, then this method will ignore it and return the true hostname. +<p> +Definition at line <a class="el" href="users_8cpp-source.html#l00055">55</a> of file <a class="el" href="users_8cpp-source.html">users.cpp</a>. +<p> +References <a class="el" href="users_8h-source.html#l00203">result</a>. +<p> +<div class="fragment"><pre>00056 { +00057 sprintf(result,<span class="stringliteral">"%s!%s@%s"</span>,nick,ident,host); +00058 <span class="keywordflow">return</span> <a class="code" href="classuserrec.html#m22">result</a>; +00059 } +</pre></div> </td> + </tr> +</table> +<a name="a5" doxytag="userrec::InviteTo"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void userrec::InviteTo </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">char * </td> + <td class="mdname1" valign="top" nowrap> <em>channel</em> </td> + <td class="md" valign="top">) </td> + <td class="md" nowrap><code> [virtual]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Adds a channel to a users invite list (invites them to a channel). +<p> + +<p> +Definition at line <a class="el" href="users_8cpp-source.html#l00072">72</a> of file <a class="el" href="users_8cpp-source.html">users.cpp</a>. +<p> +References <a class="el" href="users_8h-source.html#l00050">Invited::channel</a>, and <a class="el" href="users_8h-source.html#l00086">invites</a>. +<p> +<div class="fragment"><pre>00073 { +00074 <a class="code" href="classInvited.html">Invited</a> i; +00075 strcpy(i.<a class="code" href="classInvited.html#m0">channel</a>,channel); +00076 <a class="code" href="classuserrec.html#o0">invites</a>.push_back(i); +00077 } +</pre></div> </td> + </tr> +</table> +<a name="a4" doxytag="userrec::IsInvited"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> bool userrec::IsInvited </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">char * </td> + <td class="mdname1" valign="top" nowrap> <em>channel</em> </td> + <td class="md" valign="top">) </td> + <td class="md" nowrap><code> [virtual]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Returns true if a user is invited to a channel. +<p> + +<p> +Definition at line <a class="el" href="users_8cpp-source.html#l00061">61</a> of file <a class="el" href="users_8cpp-source.html">users.cpp</a>. +<p> +References <a class="el" href="users_8h-source.html#l00086">invites</a>. +<p> +<div class="fragment"><pre>00062 { +00063 <span class="keywordflow">for</span> (InvitedList::iterator i = <a class="code" href="classuserrec.html#o0">invites</a>.begin(); i != <a class="code" href="classuserrec.html#o0">invites</a>.end(); i++) +00064 { +00065 <span class="keywordflow">if</span> (!strcasecmp(i->channel,channel)) +00066 { +00067 <span class="keywordflow">return</span> <span class="keyword">true</span>; +00068 } +00069 } +00070 } +</pre></div> </td> + </tr> +</table> +<a name="a6" doxytag="userrec::RemoveInvite"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void userrec::RemoveInvite </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">char * </td> + <td class="mdname1" valign="top" nowrap> <em>channel</em> </td> + <td class="md" valign="top">) </td> + <td class="md" nowrap><code> [virtual]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Removes a channel from a users invite list. +<p> +This member function is called on successfully joining an invite only channel to which the user has previously been invited, to clear the invitation. +<p> +Definition at line <a class="el" href="users_8cpp-source.html#l00079">79</a> of file <a class="el" href="users_8cpp-source.html">users.cpp</a>. +<p> +References <a class="el" href="users_8h-source.html#l00086">invites</a>. +<p> +<div class="fragment"><pre>00080 { +00081 <span class="keywordflow">for</span> (InvitedList::iterator i = <a class="code" href="classuserrec.html#o0">invites</a>.begin(); i != <a class="code" href="classuserrec.html#o0">invites</a>.end(); i++) +00082 { +00083 <span class="keywordflow">if</span> (!strcasecmp(i->channel,channel)) +00084 { +00085 <a class="code" href="classuserrec.html#o0">invites</a>.erase(i); +00086 <span class="keywordflow">return</span>; +00087 } +00088 } +00089 } +</pre></div> </td> + </tr> +</table> +<hr><h2>Member Data Documentation</h2> +<a name="m16" doxytag="userrec::awaymsg"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> char userrec::awaymsg[512] + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +The user's away message. +<p> +If this string is empty, the user is not marked as away. +<p> +Definition at line <a class="el" href="users_8h-source.html#l00174">174</a> of file <a class="el" href="users_8h-source.html">users.h</a>. </td> + </tr> +</table> +<a name="m18" doxytag="userrec::bytes_in"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> long userrec::bytes_in + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Stores the number of incoming bytes from the connection. +<p> +Used by /STATS +<p> +Definition at line <a class="el" href="users_8h-source.html#l00183">183</a> of file <a class="el" href="users_8h-source.html">users.h</a>. +<p> +Referenced by <a class="el" href="users_8cpp-source.html#l00023">userrec()</a>. </td> + </tr> +</table> +<a name="m19" doxytag="userrec::bytes_out"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> long userrec::bytes_out + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Stores the number of outgoing bytes to the connection. +<p> +Used by /STATS +<p> +Definition at line <a class="el" href="users_8h-source.html#l00188">188</a> of file <a class="el" href="users_8h-source.html">users.h</a>. +<p> +Referenced by <a class="el" href="users_8cpp-source.html#l00023">userrec()</a>. </td> + </tr> +</table> +<a name="m14" doxytag="userrec::chans"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="classucrec.html">ucrec</a> userrec::chans[MAXCHANS] + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +A list of the channels the user is currently on. +<p> +If any of these values are NULL, the record is not in use and may be associated with a channel by the JOIN command. see RFC 1459. +<p> +Definition at line <a class="el" href="users_8h-source.html#l00165">165</a> of file <a class="el" href="users_8h-source.html">users.h</a>. +<p> +Referenced by <a class="el" href="users_8cpp-source.html#l00023">userrec()</a>. </td> + </tr> +</table> +<a name="m20" doxytag="userrec::cmds_in"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> long userrec::cmds_in + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Stores the number of incoming commands from the connection. +<p> +Used by /STATS +<p> +Definition at line <a class="el" href="users_8h-source.html#l00193">193</a> of file <a class="el" href="users_8h-source.html">users.h</a>. +<p> +Referenced by <a class="el" href="users_8cpp-source.html#l00023">userrec()</a>. </td> + </tr> +</table> +<a name="m21" doxytag="userrec::cmds_out"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> long userrec::cmds_out + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Stores the number of outgoing commands to the connection. +<p> +Used by /STATS +<p> +Definition at line <a class="el" href="users_8h-source.html#l00198">198</a> of file <a class="el" href="users_8h-source.html">users.h</a>. +<p> +Referenced by <a class="el" href="users_8cpp-source.html#l00023">userrec()</a>. </td> + </tr> +</table> +<a name="m4" doxytag="userrec::dhost"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> char userrec::dhost[256] + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +The host displayed to non-opers (used for cloaking etc). +<p> +This usually matches the value of <a class="el" href="classuserrec.html#m3">userrec::host</a>. +<p> +Definition at line <a class="el" href="users_8h-source.html#l00110">110</a> of file <a class="el" href="users_8h-source.html">users.h</a>. </td> + </tr> +</table> +<a name="m6" doxytag="userrec::fd"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> int userrec::fd + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +The users file descriptor. +<p> +If this is zero, the socket has been closed and the core has not yet realised and removed the record from memory. +<p> +Definition at line <a class="el" href="users_8h-source.html#l00120">120</a> of file <a class="el" href="users_8h-source.html">users.h</a>. +<p> +Referenced by <a class="el" href="users_8cpp-source.html#l00023">userrec()</a>. </td> + </tr> +</table> +<a name="m5" doxytag="userrec::fullname"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> char userrec::fullname[128] + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +The users full name. +<p> + +<p> +Definition at line <a class="el" href="users_8h-source.html#l00114">114</a> of file <a class="el" href="users_8h-source.html">users.h</a>. </td> + </tr> +</table> +<a name="m23" doxytag="userrec::haspassed"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> bool userrec::haspassed + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +True if a correct password has been given using PASS command. +<p> +If the user is a member of a connection class that does not require a password, the value stored here is of no use. +<p> +Definition at line <a class="el" href="users_8h-source.html#l00209">209</a> of file <a class="el" href="users_8h-source.html">users.h</a>. +<p> +Referenced by <a class="el" href="users_8cpp-source.html#l00023">userrec()</a>. </td> + </tr> +</table> +<a name="m3" doxytag="userrec::host"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> char userrec::host[256] + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +The users hostname, or ip address in string form. +<p> + +<p> +Definition at line <a class="el" href="users_8h-source.html#l00105">105</a> of file <a class="el" href="users_8h-source.html">users.h</a>. </td> + </tr> +</table> +<a name="m2" doxytag="userrec::ident"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> char userrec::ident[64] + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +The users ident reply. +<p> + +<p> +Definition at line <a class="el" href="users_8h-source.html#l00101">101</a> of file <a class="el" href="users_8h-source.html">users.h</a>. </td> + </tr> +</table> +<a name="m11" doxytag="userrec::idle_lastmsg"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> time_t userrec::idle_lastmsg + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +The time the user last sent a message. +<p> +See also <a class="el" href="classuserrec.html#m9">userrec::lastping</a> and <a class="el" href="classuserrec.html#m10">userrec::signon</a> +<p> +Definition at line <a class="el" href="users_8h-source.html#l00147">147</a> of file <a class="el" href="users_8h-source.html">users.h</a>. +<p> +Referenced by <a class="el" href="users_8cpp-source.html#l00023">userrec()</a>. </td> + </tr> +</table> +<a name="m8" doxytag="userrec::inbuf"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> char userrec::inbuf[MAXBUF] + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +The users input buffer. +<p> +Used by the C recv() function. +<p> +Definition at line <a class="el" href="users_8h-source.html#l00131">131</a> of file <a class="el" href="users_8h-source.html">users.h</a>. </td> + </tr> +</table> +<a name="o0" doxytag="userrec::invites"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="users_8h.html#a6">InvitedList</a> userrec::invites<code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +A list of channels the user has a pending invite to. +<p> + +<p> +Definition at line <a class="el" href="users_8h-source.html#l00086">86</a> of file <a class="el" href="users_8h-source.html">users.h</a>. +<p> +Referenced by <a class="el" href="users_8cpp-source.html#l00072">InviteTo()</a>, <a class="el" href="users_8cpp-source.html#l00061">IsInvited()</a>, <a class="el" href="users_8cpp-source.html#l00079">RemoveInvite()</a>, and <a class="el" href="users_8cpp-source.html#l00023">userrec()</a>. </td> + </tr> +</table> +<a name="m1" doxytag="userrec::ip"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> unsigned long userrec::ip + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +The users ip address in network order. +<p> + +<p> +Definition at line <a class="el" href="users_8h-source.html#l00097">97</a> of file <a class="el" href="users_8h-source.html">users.h</a>. +<p> +Referenced by <a class="el" href="users_8cpp-source.html#l00023">userrec()</a>. </td> + </tr> +</table> +<a name="m9" doxytag="userrec::lastping"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> time_t userrec::lastping + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +The last time the user was pinged by the core. +<p> +When this value is more than 120 seconds difference from 'time(NULL)', a ping is sent to the client. If the user has an outstanding PING request the next time this event occurs after 4 total minutes, they are disconnected. +<p> +Definition at line <a class="el" href="users_8h-source.html#l00138">138</a> of file <a class="el" href="users_8h-source.html">users.h</a>. +<p> +Referenced by <a class="el" href="users_8cpp-source.html#l00023">userrec()</a>. </td> + </tr> +</table> +<a name="m7" doxytag="userrec::modes"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> char userrec::modes[32] + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +The user's mode string. +<p> +This may contain any of the following RFC characters: o, w, s, i Your module may define other mode characters as it sees fit. +<p> +Definition at line <a class="el" href="users_8h-source.html#l00126">126</a> of file <a class="el" href="users_8h-source.html">users.h</a>. </td> + </tr> +</table> +<a name="m0" doxytag="userrec::nick"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> char userrec::nick[NICKMAX] + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +The users nickname. +<p> +An invalid nickname indicates an unregistered connection prior to the NICK command. +<p> +Definition at line <a class="el" href="users_8h-source.html#l00093">93</a> of file <a class="el" href="users_8h-source.html">users.h</a>. </td> + </tr> +</table> +<a name="m12" doxytag="userrec::nping"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> time_t userrec::nping + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +True if the user replied to their last ping. +<p> +If this is true, the user can be sent another ping at the specified time, otherwise they will be discnnected. See also <a class="el" href="classuserrec.html#m9">userrec::lastping</a> +<p> +Definition at line <a class="el" href="users_8h-source.html#l00153">153</a> of file <a class="el" href="users_8h-source.html">users.h</a>. +<p> +Referenced by <a class="el" href="users_8cpp-source.html#l00023">userrec()</a>. </td> + </tr> +</table> +<a name="m17" doxytag="userrec::port"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> int userrec::port + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +The port that the user connected to. +<p> + +<p> +Definition at line <a class="el" href="users_8h-source.html#l00178">178</a> of file <a class="el" href="users_8h-source.html">users.h</a>. +<p> +Referenced by <a class="el" href="users_8cpp-source.html#l00023">userrec()</a>. </td> + </tr> +</table> +<a name="m13" doxytag="userrec::registered"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> int userrec::registered + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Bit 1 is set if the user sent a NICK command, bit 2 is set if the user sent a USER command. +<p> +If both bits are set then the connection is awaiting MOTD. Sending of MOTD sets bit 3, and makes the value of <a class="el" href="classuserrec.html#m13">userrec::registered</a> == 7, showing a fully established client session. +<p> +Definition at line <a class="el" href="users_8h-source.html#l00159">159</a> of file <a class="el" href="users_8h-source.html">users.h</a>. +<p> +Referenced by <a class="el" href="users_8cpp-source.html#l00023">userrec()</a>. </td> + </tr> +</table> +<a name="m22" doxytag="userrec::result"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> char userrec::result[256] + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Stores the result of the last GetFullHost or GetRealHost call. +<p> +You may use this to increase the speed of use of this class. +<p> +Definition at line <a class="el" href="users_8h-source.html#l00203">203</a> of file <a class="el" href="users_8h-source.html">users.h</a>. +<p> +Referenced by <a class="el" href="users_8cpp-source.html#l00048">GetFullHost()</a>, and <a class="el" href="users_8cpp-source.html#l00055">GetFullRealHost()</a>. </td> + </tr> +</table> +<a name="m15" doxytag="userrec::server"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> char userrec::server[256] + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +The server the user is connected to. +<p> + +<p> +Definition at line <a class="el" href="users_8h-source.html#l00169">169</a> of file <a class="el" href="users_8h-source.html">users.h</a>. </td> + </tr> +</table> +<a name="m10" doxytag="userrec::signon"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> time_t userrec::signon + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +The users signon time. +<p> + +<p> +Definition at line <a class="el" href="users_8h-source.html#l00142">142</a> of file <a class="el" href="users_8h-source.html">users.h</a>. +<p> +Referenced by <a class="el" href="users_8cpp-source.html#l00023">userrec()</a>. </td> + </tr> +</table> +<hr>The documentation for this class was generated from the following files:<ul> +<li><a class="el" href="users_8h-source.html">users.h</a><li><a class="el" href="users_8cpp-source.html">users.cpp</a></ul> +<hr><address style="align: right;"><small>Generated on Wed Jan 22 20:56:48 2003 for InspIRCd by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border=0 +width=110 height=53></a>1.3-rc2 </small></address> +</body> +</html> diff --git a/docs/module-doc/doxygen.css b/docs/module-doc/doxygen.css new file mode 100644 index 000000000..8cb8b2e5b --- /dev/null +++ b/docs/module-doc/doxygen.css @@ -0,0 +1,49 @@ +H1 { text-align: center; } +CAPTION { font-weight: bold } +A.qindex {} +A.qindexRef {} +A.el { text-decoration: none; font-weight: bold } +A.elRef { font-weight: bold } +A.code { text-decoration: none; font-weight: normal; color: #4444ee } +A.codeRef { font-weight: normal; color: #4444ee } +A:hover { text-decoration: none; background-color: #f2f2ff } +DL.el { margin-left: -1cm } +DIV.fragment { width: 100%; border: none; background-color: #eeeeee } +DIV.ah { background-color: black; font-weight: bold; color: #ffffff; margin-bottom: 3px; margin-top: 3px } +TD.md { background-color: #f2f2ff; font-weight: bold; } +TD.mdname1 { background-color: #f2f2ff; font-weight: bold; color: #602020; } +TD.mdname { background-color: #f2f2ff; font-weight: bold; color: #602020; width: 600px; } +DIV.groupHeader { margin-left: 16px; margin-top: 12px; margin-bottom: 6px; font-weight: bold } +DIV.groupText { margin-left: 16px; font-style: italic; font-size: smaller } +BODY { background: white; color: black } +TD.indexkey { + background-color: #eeeeff; + font-weight: bold; + padding-right : 10px; + padding-top : 2px; + padding-left : 10px; + padding-bottom : 2px; + margin-left : 0px; + margin-right : 0px; + margin-top : 2px; + margin-bottom : 2px +} +TD.indexvalue { + background-color: #eeeeff; + font-style: italic; + padding-right : 10px; + padding-top : 2px; + padding-left : 10px; + padding-bottom : 2px; + margin-left : 0px; + margin-right : 0px; + margin-top : 2px; + margin-bottom : 2px +} +span.keyword { color: #008000 } +span.keywordtype { color: #604020 } +span.keywordflow { color: #e08000 } +span.comment { color: #800000 } +span.preprocessor { color: #806020 } +span.stringliteral { color: #002080 } +span.charliteral { color: #008080 } diff --git a/docs/module-doc/doxygen.png b/docs/module-doc/doxygen.png Binary files differnew file mode 100644 index 000000000..5bb475e23 --- /dev/null +++ b/docs/module-doc/doxygen.png diff --git a/docs/module-doc/files.html b/docs/module-doc/files.html new file mode 100644 index 000000000..ba6de9b92 --- /dev/null +++ b/docs/module-doc/files.html @@ -0,0 +1,21 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>File Index</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.3-rc2 --> +<center> +<a class="qindex" href="main.html">Main Page</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center> +<hr><h1>InspIRCd File List</h1>Here is a list of all files with brief descriptions:<table> + <tr><td class="indexkey"><a class="el" href="channels_8h.html">channels.h</a> <a href="channels_8h-source.html">[code]</a></td><td class="indexvalue"></td></tr> + <tr><td class="indexkey"><a class="el" href="modules_8cpp.html">modules.cpp</a> <a href="modules_8cpp-source.html">[code]</a></td><td class="indexvalue"></td></tr> + <tr><td class="indexkey"><a class="el" href="modules_8h.html">modules.h</a> <a href="modules_8h-source.html">[code]</a></td><td class="indexvalue"></td></tr> + <tr><td class="indexkey"><a class="el" href="users_8cpp.html">users.cpp</a> <a href="users_8cpp-source.html">[code]</a></td><td class="indexvalue"></td></tr> + <tr><td class="indexkey"><a class="el" href="users_8h.html">users.h</a> <a href="users_8h-source.html">[code]</a></td><td class="indexvalue"></td></tr> +</table> +<hr><address style="align: right;"><small>Generated on Wed Jan 22 20:56:46 2003 for InspIRCd by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border=0 +width=110 height=53></a>1.3-rc2 </small></address> +</body> +</html> diff --git a/docs/module-doc/ftv2blank.png b/docs/module-doc/ftv2blank.png Binary files differnew file mode 100644 index 000000000..3f626d64f --- /dev/null +++ b/docs/module-doc/ftv2blank.png diff --git a/docs/module-doc/ftv2doc.png b/docs/module-doc/ftv2doc.png Binary files differnew file mode 100644 index 000000000..2d16532a6 --- /dev/null +++ b/docs/module-doc/ftv2doc.png diff --git a/docs/module-doc/ftv2folderclosed.png b/docs/module-doc/ftv2folderclosed.png Binary files differnew file mode 100644 index 000000000..fc9426819 --- /dev/null +++ b/docs/module-doc/ftv2folderclosed.png diff --git a/docs/module-doc/ftv2folderopen.png b/docs/module-doc/ftv2folderopen.png Binary files differnew file mode 100644 index 000000000..30e9a2c37 --- /dev/null +++ b/docs/module-doc/ftv2folderopen.png diff --git a/docs/module-doc/ftv2lastnode.png b/docs/module-doc/ftv2lastnode.png Binary files differnew file mode 100644 index 000000000..f1fc64e48 --- /dev/null +++ b/docs/module-doc/ftv2lastnode.png diff --git a/docs/module-doc/ftv2link.png b/docs/module-doc/ftv2link.png Binary files differnew file mode 100644 index 000000000..f2549516c --- /dev/null +++ b/docs/module-doc/ftv2link.png diff --git a/docs/module-doc/ftv2mlastnode.png b/docs/module-doc/ftv2mlastnode.png Binary files differnew file mode 100644 index 000000000..0de7e451f --- /dev/null +++ b/docs/module-doc/ftv2mlastnode.png diff --git a/docs/module-doc/ftv2mnode.png b/docs/module-doc/ftv2mnode.png Binary files differnew file mode 100644 index 000000000..72f185b0b --- /dev/null +++ b/docs/module-doc/ftv2mnode.png diff --git a/docs/module-doc/ftv2node.png b/docs/module-doc/ftv2node.png Binary files differnew file mode 100644 index 000000000..c23e9f943 --- /dev/null +++ b/docs/module-doc/ftv2node.png diff --git a/docs/module-doc/ftv2plastnode.png b/docs/module-doc/ftv2plastnode.png Binary files differnew file mode 100644 index 000000000..1bc6181ab --- /dev/null +++ b/docs/module-doc/ftv2plastnode.png diff --git a/docs/module-doc/ftv2pnode.png b/docs/module-doc/ftv2pnode.png Binary files differnew file mode 100644 index 000000000..2f6070ca2 --- /dev/null +++ b/docs/module-doc/ftv2pnode.png diff --git a/docs/module-doc/ftv2vertline.png b/docs/module-doc/ftv2vertline.png Binary files differnew file mode 100644 index 000000000..f5a03787b --- /dev/null +++ b/docs/module-doc/ftv2vertline.png diff --git a/docs/module-doc/functions.html b/docs/module-doc/functions.html new file mode 100644 index 000000000..668617b78 --- /dev/null +++ b/docs/module-doc/functions.html @@ -0,0 +1,191 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>Compound Member Index</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.3-rc2 --> +<center> +<a class="qindex" href="main.html">Main Page</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center> +<hr><h1>InspIRCd Compound Members</h1><center> +<a href="#index_a">a</a> | <a href="#index_b">b</a> | <a href="#index_c">c</a> | <a href="#index_d">d</a> | <a href="#index_e">e</a> | <a href="#index_f">f</a> | <a href="#index_g">g</a> | <a href="#index_h">h</a> | <a href="#index_i">i</a> | <a href="#index_k">k</a> | <a href="#index_l">l</a> | <a href="#index_m">m</a> | <a href="#index_n">n</a> | <a href="#index_o">o</a> | <a href="#index_p">p</a> | <a href="#index_r">r</a> | <a href="#index_s">s</a> | <a href="#index_t">t</a> | <a href="#index_u">u</a> | <a href="#index_v">v</a> | <a href="#index_~">~</a></center> + +<p> +Here is a list of all class members with links to the classes they belong to:<h3><a name="index_a">- a -</a> +</h3><ul> +<li>Admin() +: <a class="el" href="classAdmin.html#a0">Admin</a><li>awaymsg +: <a class="el" href="classuserrec.html#m16">userrec</a></ul> +<h3><a name="index_b">- b -</a> +</h3><ul> +<li>bans +: <a class="el" href="classchanrec.html#m14">chanrec</a><li>Build +: <a class="el" href="classVersion.html#m3">Version</a><li>bytes_in +: <a class="el" href="classuserrec.html#m18">userrec</a><li>bytes_out +: <a class="el" href="classuserrec.html#m19">userrec</a></ul> +<h3><a name="index_c">- c -</a> +</h3><ul> +<li>c_private +: <a class="el" href="classchanrec.html#m13">chanrec</a><li>ChanMode() +: <a class="el" href="classServer.html#a15">Server</a><li>channel +: <a class="el" href="classInvited.html#m0">Invited</a>, <a class="el" href="classucrec.html#m1">ucrec</a><li>chanrec() +: <a class="el" href="classchanrec.html#a0">chanrec</a><li>chans +: <a class="el" href="classuserrec.html#m14">userrec</a><li>cmds_in +: <a class="el" href="classuserrec.html#m20">userrec</a><li>cmds_out +: <a class="el" href="classuserrec.html#m21">userrec</a><li>CommonChannels() +: <a class="el" href="classServer.html#a9">Server</a><li>ConfigReader() +: <a class="el" href="classConfigReader.html#a1">ConfigReader</a><li>created +: <a class="el" href="classchanrec.html#m3">chanrec</a><li>CreateModule() +: <a class="el" href="classModuleFactory.html#a2">ModuleFactory</a><li>custom_modes +: <a class="el" href="classchanrec.html#m1">chanrec</a></ul> +<h3><a name="index_d">- d -</a> +</h3><ul> +<li>data +: <a class="el" href="classHostItem.html#m2">HostItem</a><li>Debug() +: <a class="el" href="classServer.html#a3">Server</a><li>dhost +: <a class="el" href="classuserrec.html#m4">userrec</a></ul> +<h3><a name="index_e">- e -</a> +</h3><ul> +<li>Email +: <a class="el" href="classAdmin.html#m1">Admin</a><li>Enumerate() +: <a class="el" href="classConfigReader.html#a4">ConfigReader</a></ul> +<h3><a name="index_f">- f -</a> +</h3><ul> +<li>fc +: <a class="el" href="classFileReader.html#o0">FileReader</a><li>fd +: <a class="el" href="classuserrec.html#m6">userrec</a><li>FileReader() +: <a class="el" href="classFileReader.html#a1">FileReader</a><li>FileSize() +: <a class="el" href="classFileReader.html#a5">FileReader</a><li>FindChannel() +: <a class="el" href="classServer.html#a14">Server</a><li>FindNick() +: <a class="el" href="classServer.html#a13">Server</a><li>fname +: <a class="el" href="classConfigReader.html#n0">ConfigReader</a><li>fullname +: <a class="el" href="classuserrec.html#m5">userrec</a></ul> +<h3><a name="index_g">- g -</a> +</h3><ul> +<li>GetAdmin() +: <a class="el" href="classServer.html#a18">Server</a><li>GetFullHost() +: <a class="el" href="classuserrec.html#a2">userrec</a><li>GetFullRealHost() +: <a class="el" href="classuserrec.html#a3">userrec</a><li>GetLine() +: <a class="el" href="classFileReader.html#a4">FileReader</a><li>GetNetworkName() +: <a class="el" href="classServer.html#a17">Server</a><li>GetServerName() +: <a class="el" href="classServer.html#a16">Server</a><li>GetVersion() +: <a class="el" href="classModule.html#a2">Module</a></ul> +<h3><a name="index_h">- h -</a> +</h3><ul> +<li>haspassed +: <a class="el" href="classuserrec.html#m23">userrec</a><li>host +: <a class="el" href="classuserrec.html#m3">userrec</a>, <a class="el" href="classConnectClass.html#m1">ConnectClass</a><li>HostItem() +: <a class="el" href="classHostItem.html#a0">HostItem</a></ul> +<h3><a name="index_i">- i -</a> +</h3><ul> +<li>ident +: <a class="el" href="classuserrec.html#m2">userrec</a><li>idle_lastmsg +: <a class="el" href="classuserrec.html#m11">userrec</a><li>inbuf +: <a class="el" href="classuserrec.html#m8">userrec</a><li>inviteonly +: <a class="el" href="classchanrec.html#m10">chanrec</a><li>invites +: <a class="el" href="classuserrec.html#o0">userrec</a><li>InviteTo() +: <a class="el" href="classuserrec.html#a5">userrec</a><li>ip +: <a class="el" href="classuserrec.html#m1">userrec</a><li>IsInvited() +: <a class="el" href="classuserrec.html#a4">userrec</a><li>IsNick() +: <a class="el" href="classServer.html#a12">Server</a></ul> +<h3><a name="index_k">- k -</a> +</h3><ul> +<li>key +: <a class="el" href="classchanrec.html#m7">chanrec</a></ul> +<h3><a name="index_l">- l -</a> +</h3><ul> +<li>lastping +: <a class="el" href="classuserrec.html#m9">userrec</a><li>limit +: <a class="el" href="classchanrec.html#m6">chanrec</a><li>LoadFile() +: <a class="el" href="classFileReader.html#a3">FileReader</a></ul> +<h3><a name="index_m">- m -</a> +</h3><ul> +<li>Major +: <a class="el" href="classVersion.html#m0">Version</a><li>Minor +: <a class="el" href="classVersion.html#m1">Version</a><li>moderated +: <a class="el" href="classchanrec.html#m11">chanrec</a><li>modes +: <a class="el" href="classuserrec.html#m7">userrec</a><li>Module() +: <a class="el" href="classModule.html#a0">Module</a><li>ModuleFactory() +: <a class="el" href="classModuleFactory.html#a0">ModuleFactory</a></ul> +<h3><a name="index_n">- n -</a> +</h3><ul> +<li>name +: <a class="el" href="classchanrec.html#m0">chanrec</a><li>Name +: <a class="el" href="classAdmin.html#m0">Admin</a><li>nick +: <a class="el" href="classuserrec.html#m0">userrec</a><li>Nick +: <a class="el" href="classAdmin.html#m2">Admin</a><li>noexternal +: <a class="el" href="classchanrec.html#m9">chanrec</a><li>nping +: <a class="el" href="classuserrec.html#m12">userrec</a></ul> +<h3><a name="index_o">- o -</a> +</h3><ul> +<li>OnUserConnect() +: <a class="el" href="classModule.html#a3">Module</a><li>OnUserJoin() +: <a class="el" href="classModule.html#a5">Module</a><li>OnUserPart() +: <a class="el" href="classModule.html#a6">Module</a><li>OnUserQuit() +: <a class="el" href="classModule.html#a4">Module</a></ul> +<h3><a name="index_p">- p -</a> +</h3><ul> +<li>pass +: <a class="el" href="classConnectClass.html#m2">ConnectClass</a><li>port +: <a class="el" href="classuserrec.html#m17">userrec</a></ul> +<h3><a name="index_r">- r -</a> +</h3><ul> +<li>ReadValue() +: <a class="el" href="classConfigReader.html#a3">ConfigReader</a><li>registered +: <a class="el" href="classuserrec.html#m13">userrec</a><li>RemoveInvite() +: <a class="el" href="classuserrec.html#a6">userrec</a><li>result +: <a class="el" href="classuserrec.html#m22">userrec</a><li>Revision +: <a class="el" href="classVersion.html#m2">Version</a></ul> +<h3><a name="index_s">- s -</a> +</h3><ul> +<li>secret +: <a class="el" href="classchanrec.html#m12">chanrec</a><li>Send() +: <a class="el" href="classServer.html#a4">Server</a><li>SendChannel() +: <a class="el" href="classServer.html#a8">Server</a><li>SendCommon() +: <a class="el" href="classServer.html#a10">Server</a><li>SendFrom() +: <a class="el" href="classServer.html#a6">Server</a><li>SendOpers() +: <a class="el" href="classServer.html#a2">Server</a><li>SendServ() +: <a class="el" href="classServer.html#a5">Server</a><li>SendTo() +: <a class="el" href="classServer.html#a7">Server</a><li>SendWallops() +: <a class="el" href="classServer.html#a11">Server</a><li>Server() +: <a class="el" href="classServer.html#a0">Server</a><li>server +: <a class="el" href="classuserrec.html#m15">userrec</a><li>set_by +: <a class="el" href="classHostItem.html#m1">HostItem</a><li>set_time +: <a class="el" href="classHostItem.html#m0">HostItem</a><li>setby +: <a class="el" href="classchanrec.html#m5">chanrec</a><li>signon +: <a class="el" href="classuserrec.html#m10">userrec</a></ul> +<h3><a name="index_t">- t -</a> +</h3><ul> +<li>topic +: <a class="el" href="classchanrec.html#m2">chanrec</a><li>topiclock +: <a class="el" href="classchanrec.html#m8">chanrec</a><li>topicset +: <a class="el" href="classchanrec.html#m4">chanrec</a><li>type +: <a class="el" href="classConnectClass.html#m0">ConnectClass</a></ul> +<h3><a name="index_u">- u -</a> +</h3><ul> +<li>uc_modes +: <a class="el" href="classucrec.html#m0">ucrec</a><li>ucrec() +: <a class="el" href="classucrec.html#a0">ucrec</a><li>userrec() +: <a class="el" href="classuserrec.html#a0">userrec</a></ul> +<h3><a name="index_v">- v -</a> +</h3><ul> +<li>Verify() +: <a class="el" href="classConfigReader.html#a5">ConfigReader</a><li>Version() +: <a class="el" href="classVersion.html#a0">Version</a></ul> +<h3><a name="index_~">- ~ -</a> +</h3><ul> +<li>~chanrec() +: <a class="el" href="classchanrec.html#a1">chanrec</a><li>~ConfigReader() +: <a class="el" href="classConfigReader.html#a2">ConfigReader</a><li>~FileReader() +: <a class="el" href="classFileReader.html#a2">FileReader</a><li>~HostItem() +: <a class="el" href="classHostItem.html#a1">HostItem</a><li>~Module() +: <a class="el" href="classModule.html#a1">Module</a><li>~ModuleFactory() +: <a class="el" href="classModuleFactory.html#a1">ModuleFactory</a><li>~Server() +: <a class="el" href="classServer.html#a1">Server</a><li>~ucrec() +: <a class="el" href="classucrec.html#a1">ucrec</a><li>~userrec() +: <a class="el" href="classuserrec.html#a1">userrec</a></ul> +<hr><address style="align: right;"><small>Generated on Wed Jan 22 20:56:47 2003 for InspIRCd by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border=0 +width=110 height=53></a>1.3-rc2 </small></address> +</body> +</html> diff --git a/docs/module-doc/globals.html b/docs/module-doc/globals.html new file mode 100644 index 000000000..6a9878c0d --- /dev/null +++ b/docs/module-doc/globals.html @@ -0,0 +1,57 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>File Member Index</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.3-rc2 --> +<center> +<a class="qindex" href="main.html">Main Page</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center> +<hr><h1>InspIRCd File Members</h1><center> +<a href="#index_b">b</a> | <a href="#index_c">c</a> | <a href="#index_e">e</a> | <a href="#index_f">f</a> | <a href="#index_i">i</a> | <a href="#index_s">s</a> | <a href="#index_u">u</a></center> + +<p> +Here is a list of all file members with links to the files they belong to:<h3><a name="index_b">- b -</a> +</h3><ul> +<li>BanList +: <a class="el" href="channels_8h.html#a5">channels.h</a></ul> +<h3><a name="index_c">- c -</a> +</h3><ul> +<li>CC_ALLOW +: <a class="el" href="users_8h.html#a4">users.h</a><li>CC_DENY +: <a class="el" href="users_8h.html#a5">users.h</a><li>ClassVector +: <a class="el" href="users_8h.html#a7">users.h</a></ul> +<h3><a name="index_e">- e -</a> +</h3><ul> +<li>ExemptList +: <a class="el" href="channels_8h.html#a6">channels.h</a></ul> +<h3><a name="index_f">- f -</a> +</h3><ul> +<li>file_cache +: <a class="el" href="modules_8h.html#a1">modules.h</a><li>FOREACH_MOD +: <a class="el" href="modules_8h.html#a0">modules.h</a></ul> +<h3><a name="index_i">- i -</a> +</h3><ul> +<li>InvitedList +: <a class="el" href="users_8h.html#a6">users.h</a><li>InviteList +: <a class="el" href="channels_8h.html#a7">channels.h</a></ul> +<h3><a name="index_s">- s -</a> +</h3><ul> +<li>STATUS_HOP +: <a class="el" href="users_8h.html#a1">users.h</a><li>STATUS_NORMAL +: <a class="el" href="users_8h.html#a3">users.h</a><li>STATUS_OP +: <a class="el" href="users_8h.html#a0">users.h</a><li>STATUS_VOICE +: <a class="el" href="users_8h.html#a2">users.h</a></ul> +<h3><a name="index_u">- u -</a> +</h3><ul> +<li>UCMODE_FOUNDER +: <a class="el" href="channels_8h.html#a4">channels.h</a><li>UCMODE_HOP +: <a class="el" href="channels_8h.html#a2">channels.h</a><li>UCMODE_OP +: <a class="el" href="channels_8h.html#a0">channels.h</a><li>UCMODE_PROTECT +: <a class="el" href="channels_8h.html#a3">channels.h</a><li>UCMODE_VOICE +: <a class="el" href="channels_8h.html#a1">channels.h</a></ul> +<hr><address style="align: right;"><small>Generated on Wed Jan 22 20:56:49 2003 for InspIRCd by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border=0 +width=110 height=53></a>1.3-rc2 </small></address> +</body> +</html> diff --git a/docs/module-doc/hierarchy.html b/docs/module-doc/hierarchy.html new file mode 100644 index 000000000..35e1d316c --- /dev/null +++ b/docs/module-doc/hierarchy.html @@ -0,0 +1,34 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>Hierarchical Index</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.3-rc2 --> +<center> +<a class="qindex" href="main.html">Main Page</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center> +<hr><h1>InspIRCd Class Hierarchy</h1>This inheritance list is sorted roughly, but not completely, alphabetically:<ul> +<li><a class="el" href="classAdmin.html">Admin</a> +<li><a class="el" href="classchanrec.html">chanrec</a> +<li><a class="el" href="classConfigReader.html">ConfigReader</a> +<li><a class="el" href="classConnectClass.html">ConnectClass</a> +<li><a class="el" href="classFileReader.html">FileReader</a> +<li><a class="el" href="classHostItem.html">HostItem</a> +<ul> +<li><a class="el" href="classBanItem.html">BanItem</a> +<li><a class="el" href="classExemptItem.html">ExemptItem</a> +<li><a class="el" href="classInviteItem.html">InviteItem</a> +</ul> +<li><a class="el" href="classInvited.html">Invited</a> +<li><a class="el" href="classModule.html">Module</a> +<li><a class="el" href="classModuleFactory.html">ModuleFactory</a> +<li><a class="el" href="classServer.html">Server</a> +<li><a class="el" href="classucrec.html">ucrec</a> +<li><a class="el" href="classuserrec.html">userrec</a> +<li><a class="el" href="classVersion.html">Version</a> +</ul> +<hr><address style="align: right;"><small>Generated on Wed Jan 22 20:56:47 2003 for InspIRCd by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border=0 +width=110 height=53></a>1.3-rc2 </small></address> +</body> +</html> diff --git a/docs/module-doc/index.html b/docs/module-doc/index.html new file mode 100644 index 000000000..752d21b2d --- /dev/null +++ b/docs/module-doc/index.html @@ -0,0 +1,7 @@ +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>InspIRCd</title></head> +<frameset cols="250,*"> + <frame src="tree.html" name="treefrm"> + <frame src="main.html" name="basefrm"> +</frameset> +</html> diff --git a/docs/module-doc/main.html b/docs/module-doc/main.html new file mode 100644 index 000000000..2080402f5 --- /dev/null +++ b/docs/module-doc/main.html @@ -0,0 +1,16 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>Main Page</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.3-rc2 --> +<center> +<a class="qindex" href="main.html">Main Page</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center> +<hr><h1>InspIRCd Documentation</h1> +<p> +<hr><address style="align: right;"><small>Generated on Wed Jan 22 20:56:46 2003 for InspIRCd by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border=0 +width=110 height=53></a>1.3-rc2 </small></address> +</body> +</html> diff --git a/docs/module-doc/modules_8cpp-source.html b/docs/module-doc/modules_8cpp-source.html new file mode 100644 index 000000000..b651919d5 --- /dev/null +++ b/docs/module-doc/modules_8cpp-source.html @@ -0,0 +1,249 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>modules.cpp Source File</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.3-rc2 --> +<center> +<a class="qindex" href="main.html">Main Page</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center> +<hr><h1>modules.cpp</h1><a href="modules_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <span class="comment">/*</span> +00002 <span class="comment"></span> +00003 <span class="comment">$Log$ +00003 <span class="comment">Revision 1.1 2003/01/23 19:45:58 brain +00003 <span class="comment">Initial revision +00003 <span class="comment"> +00003 <span class="comment">Revision 1.9 2003/01/22 20:59:12 brain +00003 <span class="comment">Added FileReader class documentation +00003 <span class="comment"></span> +00004 <span class="comment">Revision 1.7 2003/01/22 20:49:16 brain</span> +00005 <span class="comment">Added FileReader file-caching class</span> +00006 <span class="comment">Changed m_randquote to use FileReader class</span> +00007 <span class="comment"></span> +00008 <span class="comment">Revision 1.6 2003/01/21 20:31:24 brain</span> +00009 <span class="comment">Modified to add documentation</span> +00010 <span class="comment">Added ConfigReader class for modules</span> +00011 <span class="comment"></span> +00012 <span class="comment">Revision 1.5 2003/01/13 22:30:50 brain</span> +00013 <span class="comment">Added Admin class (holds /admin info for modules)</span> +00014 <span class="comment">Added methods to Server class</span> +00015 <span class="comment"></span> +00016 <span class="comment"></span> +00017 <span class="comment">*/</span> +00018 +00019 +00020 +00021 <span class="preprocessor">#include <typeinfo></span> +00022 <span class="preprocessor">#include <iostream.h></span> +00023 <span class="preprocessor">#include "globals.h"</span> +00024 <span class="preprocessor">#include "<a class="code" href="modules_8h.html">modules.h</a>"</span> +00025 <span class="preprocessor">#include "inspircd_io.h"</span> +00026 +00027 <span class="comment">// version is a simple class for holding a modules version number</span> +00028 +<a name="l00029"></a><a class="code" href="classVersion.html#a0">00029</a> <a class="code" href="classVersion.html#a0">Version::Version</a>(<span class="keywordtype">int</span> major, <span class="keywordtype">int</span> minor, <span class="keywordtype">int</span> revision, <span class="keywordtype">int</span> build) : Major(major), Minor(minor), Revision(revision), Build(build) { }; +00030 +00031 <span class="comment">// admin is a simple class for holding a server's administrative info</span> +00032 +<a name="l00033"></a><a class="code" href="classAdmin.html#a0">00033</a> <a class="code" href="classAdmin.html#a0">Admin::Admin</a>(string name, string email, string nick) : Name(name), Email(email), Nick(nick) { }; +00034 +00035 <span class="comment">//</span> +00036 <span class="comment">// Announce to the world that the Module base</span> +00037 <span class="comment">// class has been created or destroyed</span> +00038 <span class="comment">//</span> +00039 +<a name="l00040"></a><a class="code" href="classModule.html#a0">00040</a> <a class="code" href="classModule.html#a0">Module::Module</a>() { } +<a name="l00041"></a><a class="code" href="classModule.html#a1">00041</a> <a class="code" href="classModule.html#a1">Module::~Module</a>() { } +<a name="l00042"></a><a class="code" href="classModule.html#a3">00042</a> <span class="keywordtype">void</span> <a class="code" href="classModule.html#a3">Module::OnUserConnect</a>(<a class="code" href="classuserrec.html">userrec</a>* user) { } +<a name="l00043"></a><a class="code" href="classModule.html#a4">00043</a> <span class="keywordtype">void</span> <a class="code" href="classModule.html#a4">Module::OnUserQuit</a>(<a class="code" href="classuserrec.html">userrec</a>* user) { } +<a name="l00044"></a><a class="code" href="classModule.html#a5">00044</a> <span class="keywordtype">void</span> <a class="code" href="classModule.html#a5">Module::OnUserJoin</a>(<a class="code" href="classuserrec.html">userrec</a>* user, <a class="code" href="classchanrec.html">chanrec</a>* channel) { } +<a name="l00045"></a><a class="code" href="classModule.html#a6">00045</a> <span class="keywordtype">void</span> <a class="code" href="classModule.html#a6">Module::OnUserPart</a>(<a class="code" href="classuserrec.html">userrec</a>* user, <a class="code" href="classchanrec.html">chanrec</a>* channel) { } +<a name="l00046"></a><a class="code" href="classModule.html#a2">00046</a> <a class="code" href="classVersion.html">Version</a> <a class="code" href="classModule.html#a2">Module::GetVersion</a>() { <span class="keywordflow">return</span> <a class="code" href="classVersion.html">Version</a>(1,0,0,0); } +00047 +00048 <span class="comment">// server is a wrapper class that provides methods to all of the C-style</span> +00049 <span class="comment">// exports in the core</span> +00050 <span class="comment">//</span> +00051 +<a name="l00052"></a><a class="code" href="classServer.html#a0">00052</a> <a class="code" href="classServer.html#a0">Server::Server</a>() +00053 { +00054 } +00055 +<a name="l00056"></a><a class="code" href="classServer.html#a1">00056</a> <a class="code" href="classServer.html#a1">Server::~Server</a>() +00057 { +00058 } +00059 +<a name="l00060"></a><a class="code" href="classServer.html#a2">00060</a> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a2">Server::SendOpers</a>(string s) +00061 { +00062 WriteOpers(<span class="stringliteral">"%s"</span>,s.c_str()); +00063 } +00064 +<a name="l00065"></a><a class="code" href="classServer.html#a3">00065</a> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a3">Server::Debug</a>(string s) +00066 { +00067 debug(<span class="stringliteral">"%s"</span>,s.c_str()); +00068 } +00069 +<a name="l00070"></a><a class="code" href="classServer.html#a4">00070</a> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a4">Server::Send</a>(<span class="keywordtype">int</span> Socket, string s) +00071 { +00072 Write(Socket,<span class="stringliteral">"%s"</span>,s.c_str()); +00073 } +00074 +<a name="l00075"></a><a class="code" href="classServer.html#a5">00075</a> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a5">Server::SendServ</a>(<span class="keywordtype">int</span> Socket, string s) +00076 { +00077 WriteServ(Socket,<span class="stringliteral">"%s"</span>,s.c_str()); +00078 } +00079 +<a name="l00080"></a><a class="code" href="classServer.html#a6">00080</a> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a6">Server::SendFrom</a>(<span class="keywordtype">int</span> Socket, <a class="code" href="classuserrec.html">userrec</a>* User, string s) +00081 { +00082 WriteFrom(Socket,User,<span class="stringliteral">"%s"</span>,s.c_str()); +00083 } +00084 +<a name="l00085"></a><a class="code" href="classServer.html#a7">00085</a> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a7">Server::SendTo</a>(<a class="code" href="classuserrec.html">userrec</a>* Source, <a class="code" href="classuserrec.html">userrec</a>* Dest, string s) +00086 { +00087 WriteTo(Source,Dest,<span class="stringliteral">"%s"</span>,s.c_str()); +00088 } +00089 +<a name="l00090"></a><a class="code" href="classServer.html#a8">00090</a> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a8">Server::SendChannel</a>(<a class="code" href="classuserrec.html">userrec</a>* User, <a class="code" href="classchanrec.html">chanrec</a>* Channel, string s,<span class="keywordtype">bool</span> IncludeSender) +00091 { +00092 <span class="keywordflow">if</span> (IncludeSender) +00093 { +00094 WriteChannel(Channel,User,<span class="stringliteral">"%s"</span>,s.c_str()); +00095 } +00096 <span class="keywordflow">else</span> +00097 { +00098 ChanExceptSender(Channel,User,<span class="stringliteral">"%s"</span>,s.c_str()); +00099 } +00100 } +00101 +<a name="l00102"></a><a class="code" href="classServer.html#a9">00102</a> <span class="keywordtype">bool</span> <a class="code" href="classServer.html#a9">Server::CommonChannels</a>(<a class="code" href="classuserrec.html">userrec</a>* u1, <a class="code" href="classuserrec.html">userrec</a>* u2) +00103 { +00104 <span class="keywordflow">return</span> (common_channels(u1,u2) != 0); +00105 } +00106 +<a name="l00107"></a><a class="code" href="classServer.html#a10">00107</a> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a10">Server::SendCommon</a>(<a class="code" href="classuserrec.html">userrec</a>* User, string text,<span class="keywordtype">bool</span> IncludeSender) +00108 { +00109 <span class="keywordflow">if</span> (IncludeSender) +00110 { +00111 WriteCommon(User,<span class="stringliteral">"%s"</span>,text.c_str()); +00112 } +00113 <span class="keywordflow">else</span> +00114 { +00115 WriteCommonExcept(User,<span class="stringliteral">"%s"</span>,text.c_str()); +00116 } +00117 } +00118 +<a name="l00119"></a><a class="code" href="classServer.html#a11">00119</a> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a11">Server::SendWallops</a>(<a class="code" href="classuserrec.html">userrec</a>* User, string text) +00120 { +00121 WriteWallOps(User,<span class="stringliteral">"%s"</span>,text.c_str()); +00122 } +00123 +<a name="l00124"></a><a class="code" href="classServer.html#a12">00124</a> <span class="keywordtype">bool</span> <a class="code" href="classServer.html#a12">Server::IsNick</a>(string nick) +00125 { +00126 <span class="keywordflow">return</span> (isnick(nick.c_str()) != 0); +00127 } +00128 +<a name="l00129"></a><a class="code" href="classServer.html#a13">00129</a> <a class="code" href="classuserrec.html">userrec</a>* <a class="code" href="classServer.html#a13">Server::FindNick</a>(string nick) +00130 { +00131 <span class="keywordflow">return</span> Find(nick); +00132 } +00133 +<a name="l00134"></a><a class="code" href="classServer.html#a14">00134</a> <a class="code" href="classchanrec.html">chanrec</a>* <a class="code" href="classServer.html#a14">Server::FindChannel</a>(string channel) +00135 { +00136 <span class="keywordflow">return</span> FindChan(channel.c_str()); +00137 } +00138 +<a name="l00139"></a><a class="code" href="classServer.html#a15">00139</a> string <a class="code" href="classServer.html#a15">Server::ChanMode</a>(<a class="code" href="classuserrec.html">userrec</a>* User, <a class="code" href="classchanrec.html">chanrec</a>* Chan) +00140 { +00141 string mode = cmode(User,Chan); +00142 <span class="keywordflow">return</span> mode; +00143 } +00144 +<a name="l00145"></a><a class="code" href="classServer.html#a16">00145</a> string <a class="code" href="classServer.html#a16">Server::GetServerName</a>() +00146 { +00147 <span class="keywordflow">return</span> getservername(); +00148 } +00149 +<a name="l00150"></a><a class="code" href="classServer.html#a17">00150</a> string <a class="code" href="classServer.html#a17">Server::GetNetworkName</a>() +00151 { +00152 <span class="keywordflow">return</span> getnetworkname(); +00153 } +00154 +<a name="l00155"></a><a class="code" href="classServer.html#a18">00155</a> <a class="code" href="classAdmin.html">Admin</a> <a class="code" href="classServer.html#a18">Server::GetAdmin</a>() +00156 { +00157 <span class="keywordflow">return</span> <a class="code" href="classAdmin.html">Admin</a>(getadminname(),getadminemail(),getadminnick()); +00158 } +00159 +00160 +<a name="l00161"></a><a class="code" href="classConfigReader.html#a0">00161</a> <a class="code" href="classConfigReader.html#a0">ConfigReader::ConfigReader</a>() +00162 { +00163 <a class="code" href="classConfigReader.html#n0">fname</a> = CONFIG_FILE; +00164 } +00165 +00166 +<a name="l00167"></a><a class="code" href="classConfigReader.html#a2">00167</a> <a class="code" href="classConfigReader.html#a2">ConfigReader::~ConfigReader</a>() +00168 { +00169 } +00170 +00171 +<a name="l00172"></a><a class="code" href="classConfigReader.html#a1">00172</a> <a class="code" href="classConfigReader.html#a0">ConfigReader::ConfigReader</a>(string filename) : fname(filename) { }; +00173 +<a name="l00174"></a><a class="code" href="classConfigReader.html#a3">00174</a> string <a class="code" href="classConfigReader.html#a3">ConfigReader::ReadValue</a>(string tag, string name, <span class="keywordtype">int</span> index) +00175 { +00176 <span class="keywordtype">char</span> val[MAXBUF]; +00177 ReadConf(<a class="code" href="classConfigReader.html#n0">fname</a>.c_str(),tag.c_str(),name.c_str(),index,val); +00178 string s = val; +00179 <span class="keywordflow">return</span> s; +00180 } +00181 +00182 +<a name="l00183"></a><a class="code" href="classConfigReader.html#a4">00183</a> <span class="keywordtype">int</span> <a class="code" href="classConfigReader.html#a4">ConfigReader::Enumerate</a>(string tag) +00184 { +00185 <span class="keywordflow">return</span> EnumConf(<a class="code" href="classConfigReader.html#n0">fname</a>.c_str(),tag.c_str()); +00186 } +00187 +00188 +<a name="l00189"></a><a class="code" href="classConfigReader.html#a5">00189</a> <span class="keywordtype">bool</span> <a class="code" href="classConfigReader.html#a5">ConfigReader::Verify</a>() +00190 { +00191 <span class="keywordflow">return</span> <span class="keyword">true</span>; +00192 } +00193 +00194 +<a name="l00195"></a><a class="code" href="classFileReader.html#a1">00195</a> <a class="code" href="classFileReader.html#a0">FileReader::FileReader</a>(string filename) +00196 { +00197 <a class="code" href="modules_8h.html#a1">file_cache</a> c; +00198 readfile(c,filename.c_str()); +00199 this-><a class="code" href="classFileReader.html#o0">fc</a> = c; +00200 } +00201 +<a name="l00202"></a><a class="code" href="classFileReader.html#a0">00202</a> <a class="code" href="classFileReader.html#a0">FileReader::FileReader</a>() +00203 { +00204 } +00205 +<a name="l00206"></a><a class="code" href="classFileReader.html#a3">00206</a> <span class="keywordtype">void</span> <a class="code" href="classFileReader.html#a3">FileReader::LoadFile</a>(string filename) +00207 { +00208 <a class="code" href="modules_8h.html#a1">file_cache</a> c; +00209 readfile(c,filename.c_str()); +00210 this-><a class="code" href="classFileReader.html#o0">fc</a> = c; +00211 } +00212 +<a name="l00213"></a><a class="code" href="classFileReader.html#a2">00213</a> <a class="code" href="classFileReader.html#a2">FileReader::~FileReader</a>() +00214 { +00215 } +00216 +<a name="l00217"></a><a class="code" href="classFileReader.html#a4">00217</a> string <a class="code" href="classFileReader.html#a4">FileReader::GetLine</a>(<span class="keywordtype">int</span> x) +00218 { +00219 <span class="keywordflow">if</span> ((x<0) || (x><a class="code" href="classFileReader.html#o0">fc</a>.size())) +00220 <span class="keywordflow">return</span> <span class="stringliteral">""</span>; +00221 <span class="keywordflow">return</span> <a class="code" href="classFileReader.html#o0">fc</a>[x]; +00222 } +00223 +<a name="l00224"></a><a class="code" href="classFileReader.html#a5">00224</a> <span class="keywordtype">int</span> <a class="code" href="classFileReader.html#a5">FileReader::FileSize</a>() +00225 { +00226 <span class="keywordflow">return</span> <a class="code" href="classFileReader.html#o0">fc</a>.size(); +00227 } +00228 +00229 +</pre></div><hr><address style="align: right;"><small>Generated on Wed Jan 22 20:56:47 2003 for InspIRCd by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border=0 +width=110 height=53></a>1.3-rc2 </small></address> +</body> +</html> diff --git a/docs/module-doc/modules_8cpp.html b/docs/module-doc/modules_8cpp.html new file mode 100644 index 000000000..cfa3fa3a3 --- /dev/null +++ b/docs/module-doc/modules_8cpp.html @@ -0,0 +1,24 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>modules.cpp File Reference</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.3-rc2 --> +<center> +<a class="qindex" href="main.html">Main Page</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center> +<hr><h1>modules.cpp File Reference</h1><code>#include <typeinfo></code><br> +<code>#include <iostream.h></code><br> +<code>#include "globals.h"</code><br> +<code>#include "<a class="el" href="modules_8h-source.html">modules.h</a>"</code><br> +<code>#include "inspircd_io.h"</code><br> + +<p> +<a href="modules_8cpp-source.html">Go to the source code of this file.</a><table border=0 cellpadding=0 cellspacing=0> +<tr><td></td></tr> +</table> +<hr><address style="align: right;"><small>Generated on Wed Jan 22 20:56:47 2003 for InspIRCd by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border=0 +width=110 height=53></a>1.3-rc2 </small></address> +</body> +</html> diff --git a/docs/module-doc/modules_8h-source.html b/docs/module-doc/modules_8h-source.html new file mode 100644 index 000000000..9f80e2ea5 --- /dev/null +++ b/docs/module-doc/modules_8h-source.html @@ -0,0 +1,159 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>modules.h Source File</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.3-rc2 --> +<center> +<a class="qindex" href="main.html">Main Page</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center> +<hr><h1>modules.h</h1><a href="modules_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <span class="comment">/*</span> +00002 <span class="comment"></span> +00003 <span class="comment">$Log$ +00003 <span class="comment">Revision 1.1 2003/01/23 19:45:58 brain +00003 <span class="comment">Initial revision +00003 <span class="comment"> +00003 <span class="comment">Revision 1.9 2003/01/22 20:59:12 brain +00003 <span class="comment">Added FileReader class documentation +00003 <span class="comment"></span> +00004 <span class="comment">Revision 1.11 2003/01/22 20:49:16 brain</span> +00005 <span class="comment">Added FileReader file-caching class</span> +00006 <span class="comment">Changed m_randquote to use FileReader class</span> +00007 <span class="comment"></span> +00008 <span class="comment">Revision 1.10 2003/01/22 00:57:27 brain</span> +00009 <span class="comment">Changes to documentation</span> +00010 <span class="comment"></span> +00011 <span class="comment">Revision 1.9 2003/01/22 00:44:26 brain</span> +00012 <span class="comment">Added documentation comments</span> +00013 <span class="comment"></span> +00014 <span class="comment">Revision 1.8 2003/01/21 20:31:24 brain</span> +00015 <span class="comment">Modified to add documentation</span> +00016 <span class="comment">Added ConfigReader class for modules</span> +00017 <span class="comment"></span> +00018 <span class="comment">Revision 1.7 2003/01/15 22:47:44 brain</span> +00019 <span class="comment">Changed user and channel structs to classes (finally)</span> +00020 <span class="comment"></span> +00021 <span class="comment">Revision 1.6 2003/01/13 22:30:50 brain</span> +00022 <span class="comment">Added Admin class (holds /admin info for modules)</span> +00023 <span class="comment">Added methods to Server class</span> +00024 <span class="comment"></span> +00025 <span class="comment"></span> +00026 <span class="comment">*/</span> +00027 +00028 +00029 <span class="preprocessor">#ifndef __PLUGIN_H</span> +00030 <span class="preprocessor"></span><span class="preprocessor">#define __PLUGIN_H</span> +00031 <span class="preprocessor"></span> +00032 <span class="preprocessor">#include "dynamic.h"</span> +00033 <span class="preprocessor">#include <string></span> +00034 <span class="preprocessor">#include <deque></span> +00035 +<a name="l00038"></a><a class="code" href="modules_8h.html#a1">00038</a> <span class="keyword">typedef</span> deque<string> <a class="code" href="modules_8h.html#a1">file_cache</a>; +00039 +00040 +00041 <span class="comment">// This #define allows us to call a method in all</span> +00042 <span class="comment">// loaded modules in a readable simple way, e.g.:</span> +00043 <span class="comment">// 'FOREACH_MOD OnConnect(user);'</span> +00044 +<a name="l00045"></a><a class="code" href="modules_8h.html#a0">00045</a> <span class="preprocessor">#define FOREACH_MOD for (int i = 0; i <= MODCOUNT; i++) modules[i]-></span> +00046 <span class="preprocessor"></span> +00047 <span class="comment">// class Version holds the version information of a Module, returned</span> +00048 <span class="comment">// by Module::GetVersion (thanks RD)</span> +00049 +<a name="l00054"></a><a class="code" href="classVersion.html">00054</a> <span class="keyword">class </span><a class="code" href="classVersion.html">Version</a> +00055 { +00056 <span class="keyword">public</span>: +<a name="l00057"></a><a class="code" href="classVersion.html#m2">00057</a> <span class="keyword">const</span> <span class="keywordtype">int</span> <a class="code" href="classVersion.html#m0">Major</a>, <a class="code" href="classVersion.html#m1">Minor</a>, <a class="code" href="classVersion.html#m2">Revision</a>, <a class="code" href="classVersion.html#m3">Build</a>; +00058 <a class="code" href="classVersion.html#a0">Version</a>(<span class="keywordtype">int</span> major, <span class="keywordtype">int</span> minor, <span class="keywordtype">int</span> revision, <span class="keywordtype">int</span> build); +00059 }; +00060 +00061 +<a name="l00067"></a><a class="code" href="classAdmin.html">00067</a> <span class="keyword">class </span><a class="code" href="classAdmin.html">Admin</a> +00068 { +00069 <span class="keyword">public</span>: +<a name="l00070"></a><a class="code" href="classAdmin.html#m2">00070</a> <span class="keyword">const</span> string <a class="code" href="classAdmin.html#m0">Name</a>, <a class="code" href="classAdmin.html#m1">Email</a>, <a class="code" href="classAdmin.html#m2">Nick</a>; +00071 <a class="code" href="classAdmin.html#a0">Admin</a>(string name,string email,string nick); +00072 }; +00073 +<a name="l00079"></a><a class="code" href="classModule.html">00079</a> <span class="keyword">class </span><a class="code" href="classModule.html">Module</a> +00080 { +00081 <span class="keyword">public</span>: +00085 <a class="code" href="classModule.html#a0">Module</a>(); +00089 <span class="keyword">virtual</span> <a class="code" href="classModule.html#a1">~Module</a>(); +00094 <span class="keyword">virtual</span> <a class="code" href="classVersion.html">Version</a> <a class="code" href="classModule.html#a2">GetVersion</a>(); +00098 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classModule.html#a3">OnUserConnect</a>(<a class="code" href="classuserrec.html">userrec</a>* user); +00102 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classModule.html#a4">OnUserQuit</a>(<a class="code" href="classuserrec.html">userrec</a>* user); +00107 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classModule.html#a5">OnUserJoin</a>(<a class="code" href="classuserrec.html">userrec</a>* user, <a class="code" href="classchanrec.html">chanrec</a>* channel); +00112 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classModule.html#a6">OnUserPart</a>(<a class="code" href="classuserrec.html">userrec</a>* user, <a class="code" href="classchanrec.html">chanrec</a>* channel); +00113 }; +00114 +00115 +<a name="l00121"></a><a class="code" href="classServer.html">00121</a> <span class="keyword">class </span><a class="code" href="classServer.html">Server</a> +00122 { +00123 <span class="keyword">public</span>: +00127 <a class="code" href="classServer.html#a0">Server</a>(); +00131 <span class="keyword">virtual</span> <a class="code" href="classServer.html#a1">~Server</a>(); +00132 +00136 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a2">SendOpers</a>(string s); +00141 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a3">Debug</a>(string s); +00146 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a4">Send</a>(<span class="keywordtype">int</span> Socket, string s); +00151 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a5">SendServ</a>(<span class="keywordtype">int</span> Socket, string s); +00156 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a6">SendFrom</a>(<span class="keywordtype">int</span> Socket, <a class="code" href="classuserrec.html">userrec</a>* User, string s); +00161 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a7">SendTo</a>(<a class="code" href="classuserrec.html">userrec</a>* Source, <a class="code" href="classuserrec.html">userrec</a>* Dest, string s); +00168 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a8">SendChannel</a>(<a class="code" href="classuserrec.html">userrec</a>* User, <a class="code" href="classchanrec.html">chanrec</a>* Channel, string s,<span class="keywordtype">bool</span> IncludeSender); +00173 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classServer.html#a9">CommonChannels</a>(<a class="code" href="classuserrec.html">userrec</a>* u1, <a class="code" href="classuserrec.html">userrec</a>* u2); +00181 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a10">SendCommon</a>(<a class="code" href="classuserrec.html">userrec</a>* User, string text,<span class="keywordtype">bool</span> IncludeSender); +00186 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a11">SendWallops</a>(<a class="code" href="classuserrec.html">userrec</a>* User, string text); +00187 +00191 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classServer.html#a12">IsNick</a>(string nick); +00195 <span class="keyword">virtual</span> <a class="code" href="classuserrec.html">userrec</a>* <a class="code" href="classServer.html#a13">FindNick</a>(string nick); +00199 <span class="keyword">virtual</span> <a class="code" href="classchanrec.html">chanrec</a>* <a class="code" href="classServer.html#a14">FindChannel</a>(string channel); +00204 <span class="keyword">virtual</span> string <a class="code" href="classServer.html#a15">ChanMode</a>(<a class="code" href="classuserrec.html">userrec</a>* User, <a class="code" href="classchanrec.html">chanrec</a>* Chan); +00207 <span class="keyword">virtual</span> string <a class="code" href="classServer.html#a16">GetServerName</a>(); +00210 <span class="keyword">virtual</span> string <a class="code" href="classServer.html#a17">GetNetworkName</a>(); +00216 <span class="keyword">virtual</span> <a class="code" href="classAdmin.html">Admin</a> <a class="code" href="classServer.html#a18">GetAdmin</a>(); +00217 +00218 }; +00219 +<a name="l00226"></a><a class="code" href="classConfigReader.html">00226</a> <span class="keyword">class </span><a class="code" href="classConfigReader.html">ConfigReader</a> +00227 { +00228 <span class="keyword">protected</span>: +<a name="l00231"></a><a class="code" href="classConfigReader.html#n0">00231</a> string <a class="code" href="classConfigReader.html#n0">fname</a>; +00232 <span class="keyword">public</span>: +00237 <a class="code" href="classConfigReader.html#a0">ConfigReader</a>(); <span class="comment">// default constructor reads ircd.conf</span> +00241 <span class="comment"></span> <a class="code" href="classConfigReader.html#a0">ConfigReader</a>(string filename); <span class="comment">// read a module-specific config</span> +00245 <span class="comment"></span> <a class="code" href="classConfigReader.html#a2">~ConfigReader</a>(); +00250 string <a class="code" href="classConfigReader.html#a3">ReadValue</a>(string tag, string name, <span class="keywordtype">int</span> index); +00257 <span class="keywordtype">int</span> <a class="code" href="classConfigReader.html#a4">Enumerate</a>(string tag); +00261 <span class="keywordtype">bool</span> <a class="code" href="classConfigReader.html#a5">Verify</a>(); +00262 }; +00263 +00264 +00265 +<a name="l00271"></a><a class="code" href="classFileReader.html">00271</a> <span class="keyword">class </span><a class="code" href="classFileReader.html">FileReader</a> +00272 { +<a name="l00273"></a><a class="code" href="classFileReader.html#o0">00273</a> <a class="code" href="modules_8h.html#a1">file_cache</a> <a class="code" href="classFileReader.html#o0">fc</a>; +00274 <span class="keyword">public</span>: +00279 <a class="code" href="classFileReader.html#a0">FileReader</a>(); +00285 <a class="code" href="classFileReader.html#a0">FileReader</a>(string filename); +00289 <a class="code" href="classFileReader.html#a2">~FileReader</a>(); +00295 <span class="keywordtype">void</span> <a class="code" href="classFileReader.html#a3">LoadFile</a>(string filename); +00300 string <a class="code" href="classFileReader.html#a4">GetLine</a>(<span class="keywordtype">int</span> x); +00306 <span class="keywordtype">int</span> <a class="code" href="classFileReader.html#a5">FileSize</a>(); +00307 }; +00308 +00309 +<a name="l00316"></a><a class="code" href="classModuleFactory.html">00316</a> <span class="keyword">class </span><a class="code" href="classModuleFactory.html">ModuleFactory</a> +00317 { +00318 <span class="keyword">public</span>: +<a name="l00319"></a><a class="code" href="classModuleFactory.html#a0">00319</a> <a class="code" href="classModuleFactory.html#a0">ModuleFactory</a>() { } +<a name="l00320"></a><a class="code" href="classModuleFactory.html#a1">00320</a> <span class="keyword">virtual</span> <a class="code" href="classModuleFactory.html#a1">~ModuleFactory</a>() { } +00325 <span class="keyword">virtual</span> <a class="code" href="classModule.html">Module</a> * <a class="code" href="classModuleFactory.html#a2">CreateModule</a>() = 0; +00326 }; +00327 +00328 <span class="preprocessor">#endif</span> +</pre></div><hr><address style="align: right;"><small>Generated on Wed Jan 22 20:56:47 2003 for InspIRCd by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border=0 +width=110 height=53></a>1.3-rc2 </small></address> +</body> +</html> diff --git a/docs/module-doc/modules_8h.html b/docs/module-doc/modules_8h.html new file mode 100644 index 000000000..6c9237a27 --- /dev/null +++ b/docs/module-doc/modules_8h.html @@ -0,0 +1,96 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>modules.h File Reference</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.3-rc2 --> +<center> +<a class="qindex" href="main.html">Main Page</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center> +<hr><h1>modules.h File Reference</h1><code>#include "dynamic.h"</code><br> +<code>#include <string></code><br> +<code>#include <deque></code><br> + +<p> +<a href="modules_8h-source.html">Go to the source code of this file.</a><table border=0 cellpadding=0 cellspacing=0> +<tr><td></td></tr> +<tr><td colspan=2><br><h2>Compounds</h2></td></tr> +<tr><td nowrap align=right valign=top>class </td><td valign=bottom><a class="el" href="classAdmin.html">Admin</a></td></tr> +<tr><td> </td><td><font size=-1><em>Holds /ADMIN data This class contains the admin details of the local server.</em> <a href="classAdmin.html#_details">More...</a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>class </td><td valign=bottom><a class="el" href="classConfigReader.html">ConfigReader</a></td></tr> +<tr><td> </td><td><font size=-1><em>Allows reading of values from configuration files This class allows a module to read from either the main configuration file (inspircd.conf) or from a module-specified configuration file.</em> <a href="classConfigReader.html#_details">More...</a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>class </td><td valign=bottom><a class="el" href="classFileReader.html">FileReader</a></td></tr> +<tr><td> </td><td><font size=-1><em>Caches a text file into memory and can be used to retrieve lines from it.</em> <a href="classFileReader.html#_details">More...</a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>class </td><td valign=bottom><a class="el" href="classModule.html">Module</a></td></tr> +<tr><td> </td><td><font size=-1><em>Base class for all InspIRCd modules This class is the base class for InspIRCd modules.</em> <a href="classModule.html#_details">More...</a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>class </td><td valign=bottom><a class="el" href="classModuleFactory.html">ModuleFactory</a></td></tr> +<tr><td> </td><td><font size=-1><em>Instantiates classes inherited from <a class="el" href="classModule.html">Module</a> This class creates a class inherited from type <a class="el" href="classModule.html">Module</a>, using new.</em> <a href="classModuleFactory.html#_details">More...</a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>class </td><td valign=bottom><a class="el" href="classServer.html">Server</a></td></tr> +<tr><td> </td><td><font size=-1><em>Allows server output and query functions This class contains methods which allow a module to query the state of the irc server, and produce output to users and other servers.</em> <a href="classServer.html#_details">More...</a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>class </td><td valign=bottom><a class="el" href="classVersion.html">Version</a></td></tr> +<tr><td> </td><td><font size=-1><em>Holds a module's Version information The four members (set by the constructor only) indicate details as to the version number of a module.</em> <a href="classVersion.html#_details">More...</a><em></em></font><br><br></td></tr> +<tr><td colspan=2><br><h2>Defines</h2></td></tr> +<tr><td nowrap align=right valign=top>#define </td><td valign=bottom><a class="el" href="modules_8h.html#a0">FOREACH_MOD</a> for (int i = 0; i <= MODCOUNT; i++) modules[i]-></td></tr> +<tr><td colspan=2><br><h2>Typedefs</h2></td></tr> +<tr><td nowrap align=right valign=top>typedef deque< string > </td><td valign=bottom><a class="el" href="modules_8h.html#a1">file_cache</a></td></tr> +<tr><td> </td><td><font size=-1><em>Low level definition of a <a class="el" href="classFileReader.html">FileReader</a> classes file cache area.</em> <a href="#a1"></a><em></em></font><br><br></td></tr> +</table> +<hr><h2>Define Documentation</h2> +<a name="a0" doxytag="modules.h::FOREACH_MOD"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> #define FOREACH_MOD for (int i = 0; i <= MODCOUNT; i++) modules[i]-> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="modules_8h-source.html#l00045">45</a> of file <a class="el" href="modules_8h-source.html">modules.h</a>. </td> + </tr> +</table> +<hr><h2>Typedef Documentation</h2> +<a name="a1" doxytag="modules.h::file_cache"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> typedef deque<string> file_cache + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Low level definition of a <a class="el" href="classFileReader.html">FileReader</a> classes file cache area. +<p> + +<p> +Definition at line <a class="el" href="modules_8h-source.html#l00038">38</a> of file <a class="el" href="modules_8h-source.html">modules.h</a>. +<p> +Referenced by <a class="el" href="modules_8cpp-source.html#l00195">FileReader::FileReader()</a>, and <a class="el" href="modules_8cpp-source.html#l00206">FileReader::LoadFile()</a>. </td> + </tr> +</table> +<hr><address style="align: right;"><small>Generated on Wed Jan 22 20:56:47 2003 for InspIRCd by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border=0 +width=110 height=53></a>1.3-rc2 </small></address> +</body> +</html> diff --git a/docs/module-doc/tree.html b/docs/module-doc/tree.html new file mode 100644 index 000000000..ca32b1db7 --- /dev/null +++ b/docs/module-doc/tree.html @@ -0,0 +1,11 @@ +<html><head> +<link rel="stylesheet" href="doxygen.css"> +<script src="treeview.js"></script> +<script src="tree.js"></script> +<script> +initializeDocument() +</script> +</head> +<body bgcolor="#ffffff"> +</body> +</html> diff --git a/docs/module-doc/tree.js b/docs/module-doc/tree.js new file mode 100644 index 000000000..ff40787d6 --- /dev/null +++ b/docs/module-doc/tree.js @@ -0,0 +1,44 @@ +foldersTree = gFld("<b>InspIRCd</b>", "", "") + insDoc(foldersTree, gLnk("Main Page", "", "main.html")) +aux1 = insFld(foldersTree, gFld("File List", "", "files.html")) + insDoc(aux1, gLnk("channels.h", "", "channels_8h.html")) + insDoc(aux1, gLnk("modules.cpp", "", "modules_8cpp.html")) + insDoc(aux1, gLnk("modules.h", "", "modules_8h.html")) + insDoc(aux1, gLnk("users.cpp", "", "users_8cpp.html")) + insDoc(aux1, gLnk("users.h", "", "users_8h.html")) +aux1 = insFld(foldersTree, gFld("Compound List", "", "annotated.html")) + insDoc(aux1, gLnk("Admin", "", "classAdmin.html")) + insDoc(aux1, gLnk("BanItem", "", "classBanItem.html")) + insDoc(aux1, gLnk("chanrec", "", "classchanrec.html")) + insDoc(aux1, gLnk("ConfigReader", "", "classConfigReader.html")) + insDoc(aux1, gLnk("ConnectClass", "", "classConnectClass.html")) + insDoc(aux1, gLnk("ExemptItem", "", "classExemptItem.html")) + insDoc(aux1, gLnk("FileReader", "", "classFileReader.html")) + insDoc(aux1, gLnk("HostItem", "", "classHostItem.html")) + insDoc(aux1, gLnk("Invited", "", "classInvited.html")) + insDoc(aux1, gLnk("InviteItem", "", "classInviteItem.html")) + insDoc(aux1, gLnk("Module", "", "classModule.html")) + insDoc(aux1, gLnk("ModuleFactory", "", "classModuleFactory.html")) + insDoc(aux1, gLnk("Server", "", "classServer.html")) + insDoc(aux1, gLnk("ucrec", "", "classucrec.html")) + insDoc(aux1, gLnk("userrec", "", "classuserrec.html")) + insDoc(aux1, gLnk("Version", "", "classVersion.html")) +aux1 = insFld(foldersTree, gFld("Class Hierarchy", "", "hierarchy.html")) + insDoc(aux1, gLnk("Admin", "", "classAdmin.html")) + insDoc(aux1, gLnk("chanrec", "", "classchanrec.html")) + insDoc(aux1, gLnk("ConfigReader", "", "classConfigReader.html")) + insDoc(aux1, gLnk("ConnectClass", "", "classConnectClass.html")) + insDoc(aux1, gLnk("FileReader", "", "classFileReader.html")) + aux2 = insFld(aux1, gFld("HostItem", "", "classHostItem.html")) + insDoc(aux2, gLnk("BanItem", "", "classBanItem.html")) + insDoc(aux2, gLnk("ExemptItem", "", "classExemptItem.html")) + insDoc(aux2, gLnk("InviteItem", "", "classInviteItem.html")) + insDoc(aux1, gLnk("Invited", "", "classInvited.html")) + insDoc(aux1, gLnk("Module", "", "classModule.html")) + insDoc(aux1, gLnk("ModuleFactory", "", "classModuleFactory.html")) + insDoc(aux1, gLnk("Server", "", "classServer.html")) + insDoc(aux1, gLnk("ucrec", "", "classucrec.html")) + insDoc(aux1, gLnk("userrec", "", "classuserrec.html")) + insDoc(aux1, gLnk("Version", "", "classVersion.html")) + insDoc(foldersTree, gLnk("Compound Members", "", "functions.html")) + insDoc(foldersTree, gLnk("File Members", "", "globals.html")) diff --git a/docs/module-doc/treeview.js b/docs/module-doc/treeview.js new file mode 100644 index 000000000..6b5ef5110 --- /dev/null +++ b/docs/module-doc/treeview.js @@ -0,0 +1,500 @@ +//**************************************************************** +// You are free to copy the "Folder-Tree" script as long as you +// keep this copyright notice: +// Script found in: http://www.geocities.com/Paris/LeftBank/2178/ +// Author: Marcelino Alves Martins (martins@hks.com) December '97. +//**************************************************************** + +//Log of changes: +// 17 Feb 98 - Fix initialization flashing problem with Netscape +// +// 27 Jan 98 - Root folder starts open; support for USETEXTLINKS; +// make the ftien4 a js file +// +// DvH: Dec 2000 - Made some minor changes to support external +// references + +// Definition of class Folder +// ***************************************************************** + +function Folder(folderDescription, tagName, hreference) //constructor +{ + //constant data + this.desc = folderDescription + this.tagName = tagName + this.hreference = hreference + this.id = -1 + this.navObj = 0 + this.iconImg = 0 + this.nodeImg = 0 + this.isLastNode = 0 + + //dynamic data + this.isOpen = true + this.iconSrc = "ftv2folderopen.png" + this.children = new Array + this.nChildren = 0 + + //methods + this.initialize = initializeFolder + this.setState = setStateFolder + this.addChild = addChild + this.createIndex = createEntryIndex + this.hide = hideFolder + this.display = display + this.renderOb = drawFolder + this.totalHeight = totalHeight + this.subEntries = folderSubEntries + this.outputLink = outputFolderLink +} + +function setStateFolder(isOpen) +{ + var subEntries + var totalHeight + var fIt = 0 + var i=0 + + if (isOpen == this.isOpen) + return + + if (browserVersion == 2) + { + totalHeight = 0 + for (i=0; i < this.nChildren; i++) + totalHeight = totalHeight + this.children[i].navObj.clip.height + subEntries = this.subEntries() + if (this.isOpen) + totalHeight = 0 - totalHeight + for (fIt = this.id + subEntries + 1; fIt < nEntries; fIt++) + indexOfEntries[fIt].navObj.moveBy(0, totalHeight) + } + this.isOpen = isOpen + propagateChangesInState(this) +} + +function propagateChangesInState(folder) +{ + var i=0 + + if (folder.isOpen) + { + if (folder.nodeImg) + if (folder.isLastNode) + folder.nodeImg.src = "ftv2mlastnode.png" + else + folder.nodeImg.src = "ftv2mnode.png" + folder.iconImg.src = "ftv2folderopen.png" + for (i=0; i<folder.nChildren; i++) + folder.children[i].display() + } + else + { + if (folder.nodeImg) + if (folder.isLastNode) + folder.nodeImg.src = "ftv2plastnode.png" + else + folder.nodeImg.src = "ftv2pnode.png" + folder.iconImg.src = "ftv2folderclosed.png" + for (i=0; i<folder.nChildren; i++) + folder.children[i].hide() + } +} + +function hideFolder() +{ + if (browserVersion == 1 || browserVersion == 3) { + if (this.navObj.style.display == "none") + return + this.navObj.style.display = "none" + } else { + if (this.navObj.visibility == "hidden") + return + this.navObj.visibility = "hidden" + } + + this.setState(0) +} + +function initializeFolder(level, lastNode, leftSide) +{ +var j=0 +var i=0 +var numberOfFolders +var numberOfDocs +var nc + + nc = this.nChildren + + this.createIndex() + + var auxEv = "" + + if (browserVersion > 0) + auxEv = "<a href='javascript:clickOnNode("+this.id+")'>" + else + auxEv = "<a>" + + if (level>0) + if (lastNode) //the last 'brother' in the children array + { + this.renderOb(leftSide + auxEv + "<img name='nodeIcon" + this.id + "' src='ftv2mlastnode.png' width=16 height=22 border=0></a>") + leftSide = leftSide + "<img src='ftv2blank.png' width=16 height=22>" + this.isLastNode = 1 + } + else + { + this.renderOb(leftSide + auxEv + "<img name='nodeIcon" + this.id + "' src='ftv2mnode.png' width=16 height=22 border=0></a>") + leftSide = leftSide + "<img src='ftv2vertline.png' width=16 height=22>" + this.isLastNode = 0 + } + else + this.renderOb("") + + if (nc > 0) + { + level = level + 1 + for (i=0 ; i < this.nChildren; i++) + { + if (i == this.nChildren-1) + this.children[i].initialize(level, 1, leftSide) + else + this.children[i].initialize(level, 0, leftSide) + } + } +} + +function drawFolder(leftSide) +{ + if (browserVersion == 2) { + if (!doc.yPos) + doc.yPos=8 + doc.write("<layer id='folder" + this.id + "' top=" + doc.yPos + " visibility=hidden>") + } + if (browserVersion == 3) + { + doc.write("<div id='folder" + this.id + "' style='visibility:hide;'>") + } + + doc.write("\n<table ") + if (browserVersion == 1) + doc.write(" id='folder" + this.id + "' style='position:block;' ") + doc.write(" border=0 cellspacing=0 cellpadding=0>") + doc.write("\n<tr><td>") + doc.write(leftSide) + this.outputLink() + doc.write("<img name='folderIcon" + this.id + "' ") + doc.write("src='" + this.iconSrc+"' border=0></a>") + doc.write("</td>\n<td valign=middle nowrap>") + if (USETEXTLINKS) + { + this.outputLink() + doc.write(this.desc + "</a>") + } + else + doc.write(this.desc) + if (this.tagName!="") + { + doc.write(" [external]") + } + doc.write("</td>") + doc.write("\n</table>\n") + + if (browserVersion == 2) { + doc.write("</layer>") + } + if (browserVersion == 3) { + doc.write("</div>") + } + + if (browserVersion == 1) { + this.navObj = doc.all["folder"+this.id] + this.iconImg = doc.all["folderIcon"+this.id] + this.nodeImg = doc.all["nodeIcon"+this.id] + } else if (browserVersion == 2) { + this.navObj = doc.layers["folder"+this.id] + this.iconImg = this.navObj.document.images["folderIcon"+this.id] + this.nodeImg = this.navObj.document.images["nodeIcon"+this.id] + doc.yPos=doc.yPos+this.navObj.clip.height + } else if (browserVersion == 3) { + this.navObj = doc.getElementById("folder"+this.id) + this.iconImg = doc.images.namedItem("folderIcon"+this.id) + this.nodeImg = doc.images.namedItem("nodeIcon"+this.id) + } +} + +function outputFolderLink() +{ + if (this.hreference) + { + doc.write("<a ") + if (this.tagName) + { + doc.write("doxygen='" + this.tagName + "' "); + } + doc.write("href='" + this.hreference + "' TARGET=\"basefrm\" ") + if (browserVersion > 0) + doc.write("onClick='javascript:clickOnFolder("+this.id+")'") + doc.write(">") + } + else + doc.write("<a>") +} + +function addChild(childNode) +{ + this.children[this.nChildren] = childNode + this.nChildren++ + return childNode +} + +function folderSubEntries() +{ + var i = 0 + var se = this.nChildren + + for (i=0; i < this.nChildren; i++){ + if (this.children[i].children) //is a folder + se = se + this.children[i].subEntries() + } + + return se +} + + +// Definition of class Item (a document or link inside a Folder) +// ************************************************************* + +function Item(itemDescription, tagName, itemLink) // Constructor +{ + // constant data + this.desc = itemDescription + this.tagName = tagName + this.link = itemLink + this.id = -1 //initialized in initalize() + this.navObj = 0 //initialized in render() + this.iconImg = 0 //initialized in render() + this.iconSrc = "ftv2doc.png" + + // methods + this.initialize = initializeItem + this.createIndex = createEntryIndex + this.hide = hideItem + this.display = display + this.renderOb = drawItem + this.totalHeight = totalHeight +} + +function hideItem() +{ + if (browserVersion == 1 || browserVersion == 3) { + if (this.navObj.style.display == "none") + return + this.navObj.style.display = "none" + } else { + if (this.navObj.visibility == "hidden") + return + this.navObj.visibility = "hidden" + } +} + +function initializeItem(level, lastNode, leftSide) +{ + this.createIndex() + + if (level>0) + if (lastNode) //the last 'brother' in the children array + { + this.renderOb(leftSide + "<img src='ftv2lastnode.png' width=16 height=22>") + leftSide = leftSide + "<img src='ftv2blank.png' width=16 height=22>" + } + else + { + this.renderOb(leftSide + "<img src='ftv2node.png' width=16 height=22>") + leftSide = leftSide + "<img src='ftv2vertline.png' width=16 height=22>" + } + else + this.renderOb("") +} + +function drawItem(leftSide) +{ + if (browserVersion == 2) + doc.write("<layer id='item" + this.id + "' top=" + doc.yPos + " visibility=hidden>") + if (browserVersion == 3) + doc.write("<div id='item" + this.id + "' style='display:block;'>") + + doc.write("\n<table ") + if (browserVersion == 1) + doc.write(" id='item" + this.id + "' style='position:block;' ") + doc.write(" border=0 cellspacing=0 cellpadding=0>\n") + doc.write("<tr><td>") + doc.write(leftSide) + if (this.link!="") + { + doc.write("<a href=" + this.link + ">") + } + doc.write("<img id='itemIcon"+this.id+"' ") + doc.write("src='"+this.iconSrc+"' border=0>") + if (this.link!="") + { + doc.write("</a>") + } + doc.write("</td>\n<td valign=middle nowrap>") + if (USETEXTLINKS && this.link!="") + doc.write("<a href=" + this.link + ">" + this.desc + "</a>") + else + doc.write(this.desc) + if (this.tagName!="") + { + doc.write(" [external]"); + } + doc.write("\n</table>\n") + + if (browserVersion == 2) + doc.write("</layer>") + if (browserVersion == 3) + doc.write("</div>") + + if (browserVersion == 1) { + this.navObj = doc.all["item"+this.id] + this.iconImg = doc.all["itemIcon"+this.id] + } else if (browserVersion == 2) { + this.navObj = doc.layers["item"+this.id] + this.iconImg = this.navObj.document.images["itemIcon"+this.id] + doc.yPos=doc.yPos+this.navObj.clip.height + } else if (browserVersion == 3) { + this.navObj = doc.getElementById("item"+this.id) + this.iconImg = doc.images.namedItem("itemIcon"+this.id) + } +} + + +// Methods common to both objects (pseudo-inheritance) +// ******************************************************** + +function display() +{ + if (browserVersion == 1 || browserVersion == 3) + this.navObj.style.display = "block" + else + this.navObj.visibility = "show" +} + +function createEntryIndex() +{ + this.id = nEntries + indexOfEntries[nEntries] = this + nEntries++ +} + +// total height of subEntries open +function totalHeight() //used with browserVersion == 2 +{ + var h = this.navObj.clip.height + var i = 0 + + if (this.isOpen) //is a folder and _is_ open + for (i=0 ; i < this.nChildren; i++) + h = h + this.children[i].totalHeight() + + return h +} + + +// Events +// ********************************************************* + +function clickOnFolder(folderId) +{ + var clicked = indexOfEntries[folderId] + + if (!clicked.isOpen) + clickOnNode(folderId) + + return + + if (clicked.isSelected) + return +} + +function clickOnNode(folderId) +{ + var clickedFolder = 0 + var state = 0 + + clickedFolder = indexOfEntries[folderId] + state = clickedFolder.isOpen + + clickedFolder.setState(!state) //open<->close +} + +function initializeDocument() +{ + doc = document; + if (doc.all) + browserVersion = 1 //IE4 + else + if (doc.layers) + browserVersion = 2 //NS4 + else if(navigator.userAgent.toLowerCase().indexOf('gecko') != -1) + browserVersion = 3 //mozilla + else + browserVersion = 0 //other + + foldersTree.initialize(0, 1, "") + foldersTree.display() + + if (browserVersion > 0) + { + if(browserVersion != 3) + doc.write("<layer top="+indexOfEntries[nEntries-1].navObj.top+"> </layer>") + + // close the whole tree + clickOnNode(0) + // open the root folder + clickOnNode(0) + } +} + +// Auxiliary Functions for Folder-Treee backward compatibility +// ********************************************************* + +function gFld(description, tagName, hreference) +{ + folder = new Folder(description, tagName, hreference) + return folder +} + +function gLnk(description, tagName, linkData) +{ + fullLink = "" + + if (linkData!="") + { + fullLink = "'"+linkData+"' target=\"basefrm\"" + } + + linkItem = new Item(description, tagName, fullLink) + return linkItem +} + +function insFld(parentFolder, childFolder) +{ + return parentFolder.addChild(childFolder) +} + +function insDoc(parentFolder, document) +{ + parentFolder.addChild(document) +} + +// Global variables +// **************** + +USETEXTLINKS = 1 +indexOfEntries = new Array +nEntries = 0 +doc = document +browserVersion = 0 +selectedFolder=0 diff --git a/docs/module-doc/users_8cpp-source.html b/docs/module-doc/users_8cpp-source.html new file mode 100644 index 000000000..8575303e7 --- /dev/null +++ b/docs/module-doc/users_8cpp-source.html @@ -0,0 +1,109 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>users.cpp Source File</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.3-rc2 --> +<center> +<a class="qindex" href="main.html">Main Page</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center> +<hr><h1>users.cpp</h1><a href="users_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <span class="comment">/*</span> +00002 <span class="comment"></span> +00003 <span class="comment">$Log$ +00003 <span class="comment">Revision 1.1 2003/01/23 19:45:58 brain +00003 <span class="comment">Initial revision +00003 <span class="comment"> +00003 <span class="comment">Revision 1.6 2003/01/22 20:59:12 brain +00003 <span class="comment">Added FileReader class documentation +00003 <span class="comment"></span> +00004 <span class="comment">Revision 1.3 2003/01/17 13:21:38 brain</span> +00005 <span class="comment">Added CONNECT ALLOW and CONNECT DENY config tags</span> +00006 <span class="comment">Added PASS command</span> +00007 <span class="comment"></span> +00008 <span class="comment">Revision 1.2 2003/01/17 10:37:55 brain</span> +00009 <span class="comment">Added /INVITE command and relevent structures</span> +00010 <span class="comment"></span> +00011 <span class="comment">Revision 1.1 2003/01/16 01:10:04 brain</span> +00012 <span class="comment">forgot to add this</span> +00013 <span class="comment"></span> +00014 <span class="comment"></span> +00015 <span class="comment">*/</span> +00016 +00017 <span class="preprocessor">#include "inspircd_config.h"</span> +00018 <span class="preprocessor">#include "<a class="code" href="channels_8h.html">channels.h</a>"</span> +00019 <span class="preprocessor">#include "<a class="code" href="users_8h.html">users.h</a>"</span> +00020 <span class="preprocessor">#include "inspircd.h"</span> +00021 <span class="preprocessor">#include <stdio.h></span> +00022 +<a name="l00023"></a><a class="code" href="classuserrec.html#a0">00023</a> <a class="code" href="classuserrec.html#a0">userrec::userrec</a>() +00024 { +00025 <span class="comment">// the PROPER way to do it, AVOID bzero at *ALL* costs</span> +00026 strcpy(nick,<span class="stringliteral">""</span>); +00027 <a class="code" href="classuserrec.html#m1">ip</a> = 0; +00028 strcpy(ident,<span class="stringliteral">""</span>); +00029 strcpy(host,<span class="stringliteral">""</span>); +00030 strcpy(dhost,<span class="stringliteral">""</span>); +00031 strcpy(fullname,<span class="stringliteral">""</span>); +00032 strcpy(modes,<span class="stringliteral">""</span>); +00033 strcpy(inbuf,<span class="stringliteral">""</span>); +00034 strcpy(server,<span class="stringliteral">""</span>); +00035 strcpy(awaymsg,<span class="stringliteral">""</span>); +00036 <a class="code" href="classuserrec.html#m6">fd</a> = <a class="code" href="classuserrec.html#m9">lastping</a> = <a class="code" href="classuserrec.html#m10">signon</a> = <a class="code" href="classuserrec.html#m11">idle_lastmsg</a> = <a class="code" href="classuserrec.html#m12">nping</a> = <a class="code" href="classuserrec.html#m13">registered</a> = 0; +00037 <a class="code" href="classuserrec.html#m17">port</a> = <a class="code" href="classuserrec.html#m18">bytes_in</a> = <a class="code" href="classuserrec.html#m19">bytes_out</a> = <a class="code" href="classuserrec.html#m20">cmds_in</a> = <a class="code" href="classuserrec.html#m21">cmds_out</a> = 0; +00038 <a class="code" href="classuserrec.html#m23">haspassed</a> = <span class="keyword">false</span>; +00039 strcpy(result,<span class="stringliteral">""</span>); +00040 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < MAXCHANS; i++) +00041 { +00042 <a class="code" href="classuserrec.html#m14">chans</a>[i].<a class="code" href="classucrec.html#m1">channel</a> = NULL; +00043 } +00044 <a class="code" href="classuserrec.html#o0">invites</a>.clear(); +00045 } +00046 +00047 +<a name="l00048"></a><a class="code" href="classuserrec.html#a2">00048</a> <span class="keywordtype">char</span>* <a class="code" href="classuserrec.html#a2">userrec::GetFullHost</a>() +00049 { +00050 sprintf(result,<span class="stringliteral">"%s!%s@%s"</span>,nick,ident,dhost); +00051 <span class="keywordflow">return</span> <a class="code" href="classuserrec.html#m22">result</a>; +00052 } +00053 +00054 +<a name="l00055"></a><a class="code" href="classuserrec.html#a3">00055</a> <span class="keywordtype">char</span>* <a class="code" href="classuserrec.html#a3">userrec::GetFullRealHost</a>() +00056 { +00057 sprintf(result,<span class="stringliteral">"%s!%s@%s"</span>,nick,ident,host); +00058 <span class="keywordflow">return</span> <a class="code" href="classuserrec.html#m22">result</a>; +00059 } +00060 +<a name="l00061"></a><a class="code" href="classuserrec.html#a4">00061</a> <span class="keywordtype">bool</span> <a class="code" href="classuserrec.html#a4">userrec::IsInvited</a>(<span class="keywordtype">char</span>* channel) +00062 { +00063 <span class="keywordflow">for</span> (InvitedList::iterator i = <a class="code" href="classuserrec.html#o0">invites</a>.begin(); i != <a class="code" href="classuserrec.html#o0">invites</a>.end(); i++) +00064 { +00065 <span class="keywordflow">if</span> (!strcasecmp(i->channel,channel)) +00066 { +00067 <span class="keywordflow">return</span> <span class="keyword">true</span>; +00068 } +00069 } +00070 } +00071 +<a name="l00072"></a><a class="code" href="classuserrec.html#a5">00072</a> <span class="keywordtype">void</span> <a class="code" href="classuserrec.html#a5">userrec::InviteTo</a>(<span class="keywordtype">char</span>* channel) +00073 { +00074 <a class="code" href="classInvited.html">Invited</a> i; +00075 strcpy(i.<a class="code" href="classInvited.html#m0">channel</a>,channel); +00076 <a class="code" href="classuserrec.html#o0">invites</a>.push_back(i); +00077 } +00078 +<a name="l00079"></a><a class="code" href="classuserrec.html#a6">00079</a> <span class="keywordtype">void</span> <a class="code" href="classuserrec.html#a6">userrec::RemoveInvite</a>(<span class="keywordtype">char</span>* channel) +00080 { +00081 <span class="keywordflow">for</span> (InvitedList::iterator i = <a class="code" href="classuserrec.html#o0">invites</a>.begin(); i != <a class="code" href="classuserrec.html#o0">invites</a>.end(); i++) +00082 { +00083 <span class="keywordflow">if</span> (!strcasecmp(i->channel,channel)) +00084 { +00085 <a class="code" href="classuserrec.html#o0">invites</a>.erase(i); +00086 <span class="keywordflow">return</span>; +00087 } +00088 } +00089 } +</pre></div><hr><address style="align: right;"><small>Generated on Wed Jan 22 20:56:47 2003 for InspIRCd by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border=0 +width=110 height=53></a>1.3-rc2 </small></address> +</body> +</html> diff --git a/docs/module-doc/users_8cpp.html b/docs/module-doc/users_8cpp.html new file mode 100644 index 000000000..10c198675 --- /dev/null +++ b/docs/module-doc/users_8cpp.html @@ -0,0 +1,24 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>users.cpp File Reference</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.3-rc2 --> +<center> +<a class="qindex" href="main.html">Main Page</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center> +<hr><h1>users.cpp File Reference</h1><code>#include "inspircd_config.h"</code><br> +<code>#include "<a class="el" href="channels_8h-source.html">channels.h</a>"</code><br> +<code>#include "<a class="el" href="users_8h-source.html">users.h</a>"</code><br> +<code>#include "inspircd.h"</code><br> +<code>#include <stdio.h></code><br> + +<p> +<a href="users_8cpp-source.html">Go to the source code of this file.</a><table border=0 cellpadding=0 cellspacing=0> +<tr><td></td></tr> +</table> +<hr><address style="align: right;"><small>Generated on Wed Jan 22 20:56:47 2003 for InspIRCd by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border=0 +width=110 height=53></a>1.3-rc2 </small></address> +</body> +</html> diff --git a/docs/module-doc/users_8h-source.html b/docs/module-doc/users_8h-source.html new file mode 100644 index 000000000..446423af1 --- /dev/null +++ b/docs/module-doc/users_8h-source.html @@ -0,0 +1,158 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>users.h Source File</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.3-rc2 --> +<center> +<a class="qindex" href="main.html">Main Page</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center> +<hr><h1>users.h</h1><a href="users_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <span class="comment">/*</span> +00002 <span class="comment"></span> +00003 <span class="comment">$Log$ +00003 <span class="comment">Revision 1.1 2003/01/23 19:45:58 brain +00003 <span class="comment">Initial revision +00003 <span class="comment"> +00003 <span class="comment">Revision 1.6 2003/01/22 20:59:12 brain +00003 <span class="comment">Added FileReader class documentation +00003 <span class="comment"></span> +00004 <span class="comment">Revision 1.9 2003/01/22 00:44:26 brain</span> +00005 <span class="comment">Added documentation comments</span> +00006 <span class="comment"></span> +00007 <span class="comment">Revision 1.8 2003/01/21 21:11:17 brain</span> +00008 <span class="comment">Added documentation</span> +00009 <span class="comment"></span> +00010 <span class="comment">Revision 1.7 2003/01/17 13:21:38 brain</span> +00011 <span class="comment">Added CONNECT ALLOW and CONNECT DENY config tags</span> +00012 <span class="comment">Added PASS command</span> +00013 <span class="comment"></span> +00014 <span class="comment">Revision 1.6 2003/01/17 10:37:55 brain</span> +00015 <span class="comment">Added /INVITE command and relevent structures</span> +00016 <span class="comment"></span> +00017 <span class="comment">Revision 1.5 2003/01/16 20:11:56 brain</span> +00018 <span class="comment">fixed some ugly pointer bugs (thanks dblack and a|KK|y!)</span> +00019 <span class="comment"></span> +00020 <span class="comment">Revision 1.4 2003/01/15 22:47:44 brain</span> +00021 <span class="comment">Changed user and channel structs to classes (finally)</span> +00022 <span class="comment"></span> +00023 <span class="comment">Revision 1.3 2003/01/14 21:14:30 brain</span> +00024 <span class="comment">added /ISON command (for mIRC etc basic notify)</span> +00025 <span class="comment"></span> +00026 <span class="comment"></span> +00027 <span class="comment">*/</span> +00028 +00029 <span class="preprocessor">#include "inspircd_config.h"</span> +00030 <span class="preprocessor">#include "<a class="code" href="channels_8h.html">channels.h</a>"</span> +00031 +00032 <span class="preprocessor">#include <string></span> +00033 +00034 <span class="preprocessor">#ifndef __USERS_H__ </span> +00035 <span class="preprocessor"></span><span class="preprocessor">#define __USERS_H__ </span> +00036 <span class="preprocessor"></span> +<a name="l00037"></a><a class="code" href="users_8h.html#a0">00037</a> <span class="preprocessor">#define STATUS_OP 4</span> +<a name="l00038"></a><a class="code" href="users_8h.html#a1">00038</a> <span class="preprocessor"></span><span class="preprocessor">#define STATUS_HOP 2</span> +<a name="l00039"></a><a class="code" href="users_8h.html#a2">00039</a> <span class="preprocessor"></span><span class="preprocessor">#define STATUS_VOICE 1</span> +<a name="l00040"></a><a class="code" href="users_8h.html#a3">00040</a> <span class="preprocessor"></span><span class="preprocessor">#define STATUS_NORMAL 0</span> +00041 <span class="preprocessor"></span> +<a name="l00042"></a><a class="code" href="users_8h.html#a4">00042</a> <span class="preprocessor">#define CC_ALLOW 0</span> +<a name="l00043"></a><a class="code" href="users_8h.html#a5">00043</a> <span class="preprocessor"></span><span class="preprocessor">#define CC_DENY 1</span> +00044 <span class="preprocessor"></span> +<a name="l00047"></a><a class="code" href="classInvited.html">00047</a> <span class="keyword">class </span><a class="code" href="classInvited.html">Invited</a> +00048 { +00049 <span class="keyword">public</span>: +<a name="l00050"></a><a class="code" href="classInvited.html#m0">00050</a> <span class="keywordtype">char</span> <a class="code" href="classInvited.html#m0">channel</a>[CHANMAX]; +00051 }; +00052 +00053 +<a name="l00056"></a><a class="code" href="classConnectClass.html">00056</a> <span class="keyword">class </span><a class="code" href="classConnectClass.html">ConnectClass</a> +00057 { +00058 <span class="keyword">public</span>: +<a name="l00059"></a><a class="code" href="classConnectClass.html#m0">00059</a> <span class="keywordtype">int</span> <a class="code" href="classConnectClass.html#m0">type</a>; +<a name="l00060"></a><a class="code" href="classConnectClass.html#m1">00060</a> <span class="keywordtype">char</span> <a class="code" href="classConnectClass.html#m1">host</a>[MAXBUF]; +<a name="l00061"></a><a class="code" href="classConnectClass.html#m2">00061</a> <span class="keywordtype">char</span> <a class="code" href="classConnectClass.html#m2">pass</a>[MAXBUF]; +00062 }; +00063 +<a name="l00066"></a><a class="code" href="users_8h.html#a6">00066</a> <span class="keyword">typedef</span> vector<Invited> <a class="code" href="users_8h.html#a6">InvitedList</a>; +00067 +00068 +00069 +<a name="l00072"></a><a class="code" href="users_8h.html#a7">00072</a> <span class="keyword">typedef</span> vector<ConnectClass> <a class="code" href="users_8h.html#a7">ClassVector</a>; +00073 +<a name="l00080"></a><a class="code" href="classuserrec.html">00080</a> <span class="keyword">class </span><a class="code" href="classuserrec.html">userrec</a> +00081 { +00082 <span class="keyword">private</span>: +00083 +<a name="l00086"></a><a class="code" href="classuserrec.html#o0">00086</a> <a class="code" href="users_8h.html#a6">InvitedList</a> <a class="code" href="classuserrec.html#o0">invites</a>; +00087 <span class="keyword">public</span>: +00088 +<a name="l00093"></a><a class="code" href="classuserrec.html#m0">00093</a> <span class="keywordtype">char</span> <a class="code" href="classuserrec.html#m0">nick</a>[NICKMAX]; +00094 +<a name="l00097"></a><a class="code" href="classuserrec.html#m1">00097</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <a class="code" href="classuserrec.html#m1">ip</a>; +00098 +<a name="l00101"></a><a class="code" href="classuserrec.html#m2">00101</a> <span class="keywordtype">char</span> <a class="code" href="classuserrec.html#m2">ident</a>[64]; +00102 +<a name="l00105"></a><a class="code" href="classuserrec.html#m3">00105</a> <span class="keywordtype">char</span> <a class="code" href="classuserrec.html#m3">host</a>[256]; +00106 +<a name="l00110"></a><a class="code" href="classuserrec.html#m4">00110</a> <span class="keywordtype">char</span> <a class="code" href="classuserrec.html#m4">dhost</a>[256]; +00111 +<a name="l00114"></a><a class="code" href="classuserrec.html#m5">00114</a> <span class="keywordtype">char</span> <a class="code" href="classuserrec.html#m5">fullname</a>[128]; +00115 +<a name="l00120"></a><a class="code" href="classuserrec.html#m6">00120</a> <span class="keywordtype">int</span> <a class="code" href="classuserrec.html#m6">fd</a>; +00121 +<a name="l00126"></a><a class="code" href="classuserrec.html#m7">00126</a> <span class="keywordtype">char</span> <a class="code" href="classuserrec.html#m7">modes</a>[32]; +00127 +<a name="l00131"></a><a class="code" href="classuserrec.html#m8">00131</a> <span class="keywordtype">char</span> <a class="code" href="classuserrec.html#m8">inbuf</a>[MAXBUF]; +00132 +<a name="l00138"></a><a class="code" href="classuserrec.html#m9">00138</a> time_t <a class="code" href="classuserrec.html#m9">lastping</a>; +00139 +<a name="l00142"></a><a class="code" href="classuserrec.html#m10">00142</a> time_t <a class="code" href="classuserrec.html#m10">signon</a>; +00143 +<a name="l00147"></a><a class="code" href="classuserrec.html#m11">00147</a> time_t <a class="code" href="classuserrec.html#m11">idle_lastmsg</a>; +00148 +<a name="l00153"></a><a class="code" href="classuserrec.html#m12">00153</a> time_t <a class="code" href="classuserrec.html#m12">nping</a>; +00154 +<a name="l00159"></a><a class="code" href="classuserrec.html#m13">00159</a> <span class="keywordtype">int</span> <a class="code" href="classuserrec.html#m13">registered</a>; +00160 +<a name="l00165"></a><a class="code" href="classuserrec.html#m14">00165</a> <a class="code" href="classucrec.html">ucrec</a> <a class="code" href="classuserrec.html#m14">chans</a>[MAXCHANS]; +00166 +<a name="l00169"></a><a class="code" href="classuserrec.html#m15">00169</a> <span class="keywordtype">char</span> <a class="code" href="classuserrec.html#m15">server</a>[256]; +00170 +<a name="l00174"></a><a class="code" href="classuserrec.html#m16">00174</a> <span class="keywordtype">char</span> <a class="code" href="classuserrec.html#m16">awaymsg</a>[512]; +00175 +<a name="l00178"></a><a class="code" href="classuserrec.html#m17">00178</a> <span class="keywordtype">int</span> <a class="code" href="classuserrec.html#m17">port</a>; +00179 +<a name="l00183"></a><a class="code" href="classuserrec.html#m18">00183</a> <span class="keywordtype">long</span> <a class="code" href="classuserrec.html#m18">bytes_in</a>; +00184 +<a name="l00188"></a><a class="code" href="classuserrec.html#m19">00188</a> <span class="keywordtype">long</span> <a class="code" href="classuserrec.html#m19">bytes_out</a>; +00189 +<a name="l00193"></a><a class="code" href="classuserrec.html#m20">00193</a> <span class="keywordtype">long</span> <a class="code" href="classuserrec.html#m20">cmds_in</a>; +00194 +<a name="l00198"></a><a class="code" href="classuserrec.html#m21">00198</a> <span class="keywordtype">long</span> <a class="code" href="classuserrec.html#m21">cmds_out</a>; +00199 +<a name="l00203"></a><a class="code" href="classuserrec.html#m22">00203</a> <span class="keywordtype">char</span> <a class="code" href="classuserrec.html#m22">result</a>[256]; +00204 +<a name="l00209"></a><a class="code" href="classuserrec.html#m23">00209</a> <span class="keywordtype">bool</span> <a class="code" href="classuserrec.html#m23">haspassed</a>; +00210 +00211 <a class="code" href="classuserrec.html#a0">userrec</a>(); +00212 +<a name="l00213"></a><a class="code" href="classuserrec.html#a1">00213</a> <span class="keyword">virtual</span> <a class="code" href="classuserrec.html#a1">~userrec</a>() { } +00214 +00219 <span class="keyword">virtual</span> <span class="keywordtype">char</span>* <a class="code" href="classuserrec.html#a2">GetFullHost</a>(); +00220 +00226 <span class="keyword">virtual</span> <span class="keywordtype">char</span>* <a class="code" href="classuserrec.html#a3">GetFullRealHost</a>(); +00227 +00230 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classuserrec.html#a4">IsInvited</a>(<span class="keywordtype">char</span>* channel); +00231 +00234 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classuserrec.html#a5">InviteTo</a>(<span class="keywordtype">char</span>* channel); +00235 +00240 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classuserrec.html#a6">RemoveInvite</a>(<span class="keywordtype">char</span>* channel); +00241 +00242 }; +00243 +00244 +00245 <span class="preprocessor">#endif</span> +</pre></div><hr><address style="align: right;"><small>Generated on Wed Jan 22 20:56:47 2003 for InspIRCd by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border=0 +width=110 height=53></a>1.3-rc2 </small></address> +</body> +</html> diff --git a/docs/module-doc/users_8h.html b/docs/module-doc/users_8h.html new file mode 100644 index 000000000..2593a2dcb --- /dev/null +++ b/docs/module-doc/users_8h.html @@ -0,0 +1,239 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>users.h File Reference</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.3-rc2 --> +<center> +<a class="qindex" href="main.html">Main Page</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center> +<hr><h1>users.h File Reference</h1><code>#include "inspircd_config.h"</code><br> +<code>#include "<a class="el" href="channels_8h-source.html">channels.h</a>"</code><br> +<code>#include <string></code><br> + +<p> +<a href="users_8h-source.html">Go to the source code of this file.</a><table border=0 cellpadding=0 cellspacing=0> +<tr><td></td></tr> +<tr><td colspan=2><br><h2>Compounds</h2></td></tr> +<tr><td nowrap align=right valign=top>class </td><td valign=bottom><a class="el" href="classConnectClass.html">ConnectClass</a></td></tr> +<tr><td> </td><td><font size=-1><em>Holds information relevent to <connect allow> and <connect deny> tags in the config file.</em> <a href="classConnectClass.html#_details">More...</a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>class </td><td valign=bottom><a class="el" href="classInvited.html">Invited</a></td></tr> +<tr><td> </td><td><font size=-1><em>Holds a channel name to which a user has been invited.</em> <a href="classInvited.html#_details">More...</a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>class </td><td valign=bottom><a class="el" href="classuserrec.html">userrec</a></td></tr> +<tr><td> </td><td><font size=-1><em>Holds all information about a user This class stores all information about a user connected to the irc server.</em> <a href="classuserrec.html#_details">More...</a><em></em></font><br><br></td></tr> +<tr><td colspan=2><br><h2>Defines</h2></td></tr> +<tr><td nowrap align=right valign=top>#define </td><td valign=bottom><a class="el" href="users_8h.html#a0">STATUS_OP</a> 4</td></tr> +<tr><td nowrap align=right valign=top>#define </td><td valign=bottom><a class="el" href="users_8h.html#a1">STATUS_HOP</a> 2</td></tr> +<tr><td nowrap align=right valign=top>#define </td><td valign=bottom><a class="el" href="users_8h.html#a2">STATUS_VOICE</a> 1</td></tr> +<tr><td nowrap align=right valign=top>#define </td><td valign=bottom><a class="el" href="users_8h.html#a3">STATUS_NORMAL</a> 0</td></tr> +<tr><td nowrap align=right valign=top>#define </td><td valign=bottom><a class="el" href="users_8h.html#a4">CC_ALLOW</a> 0</td></tr> +<tr><td nowrap align=right valign=top>#define </td><td valign=bottom><a class="el" href="users_8h.html#a5">CC_DENY</a> 1</td></tr> +<tr><td colspan=2><br><h2>Typedefs</h2></td></tr> +<tr><td nowrap align=right valign=top>typedef vector< <a class="el" href="classInvited.html">Invited</a> > </td><td valign=bottom><a class="el" href="users_8h.html#a6">InvitedList</a></td></tr> +<tr><td> </td><td><font size=-1><em>Holds a complete list of all channels to which a user has been invited and has not yet joined.</em> <a href="#a6"></a><em></em></font><br><br></td></tr> +<tr><td nowrap align=right valign=top>typedef vector< <a class="el" href="classConnectClass.html">ConnectClass</a> > </td><td valign=bottom><a class="el" href="users_8h.html#a7">ClassVector</a></td></tr> +<tr><td> </td><td><font size=-1><em>Holds a complete list of all allow and deny tags from the configuration file (connection classes).</em> <a href="#a7"></a><em></em></font><br><br></td></tr> +</table> +<hr><h2>Define Documentation</h2> +<a name="a4" doxytag="users.h::CC_ALLOW"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> #define CC_ALLOW 0 + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="users_8h-source.html#l00042">42</a> of file <a class="el" href="users_8h-source.html">users.h</a>. </td> + </tr> +</table> +<a name="a5" doxytag="users.h::CC_DENY"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> #define CC_DENY 1 + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="users_8h-source.html#l00043">43</a> of file <a class="el" href="users_8h-source.html">users.h</a>. </td> + </tr> +</table> +<a name="a1" doxytag="users.h::STATUS_HOP"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> #define STATUS_HOP 2 + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="users_8h-source.html#l00038">38</a> of file <a class="el" href="users_8h-source.html">users.h</a>. </td> + </tr> +</table> +<a name="a3" doxytag="users.h::STATUS_NORMAL"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> #define STATUS_NORMAL 0 + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="users_8h-source.html#l00040">40</a> of file <a class="el" href="users_8h-source.html">users.h</a>. </td> + </tr> +</table> +<a name="a0" doxytag="users.h::STATUS_OP"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> #define STATUS_OP 4 + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="users_8h-source.html#l00037">37</a> of file <a class="el" href="users_8h-source.html">users.h</a>. </td> + </tr> +</table> +<a name="a2" doxytag="users.h::STATUS_VOICE"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> #define STATUS_VOICE 1 + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="users_8h-source.html#l00039">39</a> of file <a class="el" href="users_8h-source.html">users.h</a>. </td> + </tr> +</table> +<hr><h2>Typedef Documentation</h2> +<a name="a7" doxytag="users.h::ClassVector"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> typedef vector<<a class="el" href="classConnectClass.html">ConnectClass</a>> ClassVector + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Holds a complete list of all allow and deny tags from the configuration file (connection classes). +<p> + +<p> +Definition at line <a class="el" href="users_8h-source.html#l00072">72</a> of file <a class="el" href="users_8h-source.html">users.h</a>. </td> + </tr> +</table> +<a name="a6" doxytag="users.h::InvitedList"></a><p> +<table width="100%" cellpadding="2" cellspacing="0" border="0"> + <tr> + <td class="md"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> typedef vector<<a class="el" href="classInvited.html">Invited</a>> InvitedList + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Holds a complete list of all channels to which a user has been invited and has not yet joined. +<p> + +<p> +Definition at line <a class="el" href="users_8h-source.html#l00066">66</a> of file <a class="el" href="users_8h-source.html">users.h</a>. </td> + </tr> +</table> +<hr><address style="align: right;"><small>Generated on Wed Jan 22 20:56:47 2003 for InspIRCd by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border=0 +width=110 height=53></a>1.3-rc2 </small></address> +</body> +</html> diff --git a/include/channels.h b/include/channels.h new file mode 100644 index 000000000..c9cdd7b31 --- /dev/null +++ b/include/channels.h @@ -0,0 +1,199 @@ +/* + +$Log$ +Revision 1.1 2003/01/23 19:45:58 brain +Initial revision + +Revision 1.7 2003/01/22 00:44:26 brain +Added documentation comments + +Revision 1.6 2003/01/21 21:11:17 brain +Added documentation + +Revision 1.5 2003/01/16 20:11:55 brain +fixed some ugly pointer bugs (thanks dblack and a|KK|y!) + +Revision 1.4 2003/01/15 22:47:44 brain +Changed user and channel structs to classes (finally) + + +*/ + +#include "inspircd_config.h" +#include <time.h> +#include <vector> + +#ifndef __CHANNELS_H__ +#define __CHANNELS_H__ + +/** Holds an entry for a ban list, exemption list, or invite list. + * This class contains a single element in a channel list, such as a banlist. + */ +class HostItem +{ + public: + time_t set_time; + char set_by[NICKMAX]; + char data[MAXBUF]; + + HostItem() { /* stub */ } + virtual ~HostItem() { /* stub */ } +}; + +// banlist is inherited from HostList mainly for readability +// reasons only + +/** A subclass of HostItem designed to hold channel bans (+b) + */ +class BanItem : public HostItem +{ +}; + +// same with this... + +/** A subclass of HostItem designed to hold channel exempts (+e) + */ +class ExemptItem : public HostItem +{ +}; + +// and this... + +/** A subclass of HostItem designed to hold channel invites (+I) + */ +class InviteItem : public HostItem +{ +}; + + +/** Holds a complete ban list + */ +typedef vector<BanItem> BanList; + +/** Holds a complete exempt list + */ +typedef vector<ExemptItem> ExemptList; + +/** Holds a complete invite list + */ +typedef vector<InviteItem> InviteList; + +/** Holds all relevent information for a channel. + * This class represents a channel, and contains its name, modes, time created, topic, topic set time, + * etc, and an instance of the BanList type. + */ +class chanrec +{ + public: + /** The channels name. + */ + char name[CHANMAX]; /* channel name */ + /** Custom modes for the channel. + * Plugins may use this field in any way they see fit. + */ + char custom_modes[MAXMODES]; /* modes handled by modules */ + /** Channel topic. + * If this is an empty string, no channel topic is set. + */ + char topic[MAXBUF]; + /** Creation time. + */ + time_t created; + /** Time topic was set. + * If no topic was ever set, this will be equal to chanrec::created + */ + time_t topicset; + /** The last user to set the topic. + * If this member is an empty string, no topic was ever set. + */ + char setby[NICKMAX]; + + /** Contains the channel user limit. + * If this value is zero, there is no limit in place. + */ + long limit; + + /** Contains the channel key. + * If this value is an empty string, there is no channel key in place. + */ + char key[32]; + + /** Nonzero if the mode +t is set. + */ + short int topiclock; + + /** Nonzero if the mode +n is set. + */ + short int noexternal; + + /** Nonzero if the mode +i is set. + */ + short int inviteonly; + + /** Nonzero if the mode +m is set. + */ + short int moderated; + + /** Nonzero if the mode +s is set. + * This value cannot be set at the same time as chanrec::c_private + */ + short int secret; + + /** Nonzero if the mode +p is set. + * This value cannot be set at the same time as chanrec::secret + */ + short int c_private; + + /** The list of all bans set on the channel. + */ + BanList bans; + + /** Creates a channel record and initialises it with default values + */ + chanrec() + { + strcpy(name,""); + strcpy(custom_modes,""); + strcpy(topic,""); + strcpy(setby,""); + strcpy(key,""); + created = topicset = limit = 0; + topiclock = noexternal = inviteonly = moderated = secret = c_private = false; + } + + virtual ~chanrec() { /* stub */ } +}; + +/* used to hold a channel and a users modes on that channel, e.g. +v, +h, +o + * needs to come AFTER struct chanrec */ + +#define UCMODE_OP 1 +#define UCMODE_VOICE 2 +#define UCMODE_HOP 4 +#define UCMODE_PROTECT 8 +#define UCMODE_FOUNDER 16 + +/** Holds a user's modes on a channel + * This class associates a users privilages with a channel by creating a pointer link between + * a userrec and chanrec class. The uc_modes member holds a bitmask of which privilages the user + * has on the channel, such as op, voice, etc. + */ +class ucrec +{ + public: + /** Contains a bitmask of the UCMODE_OP ... UCMODE_FOUNDER values. + * If this value is zero, the user has no privilages upon the channel. + */ + long uc_modes; + + /** Points to the channel record where the given modes apply. + * If the record is not in use, this value will be NULL. + */ + chanrec *channel; + + ucrec() { /* stub */ } + virtual ~ucrec() { /* stub */ } +}; + +#endif + diff --git a/include/ctables.h b/include/ctables.h new file mode 100644 index 000000000..78eb150d9 --- /dev/null +++ b/include/ctables.h @@ -0,0 +1,53 @@ +/* +------------------------------------+ + * | Inspire Internet Relay Chat Daemon | + * +------------------------------------+ + * + * Inspire is copyright (C) 2002-2003 ChatSpike-Dev. + * E-mail: + * <brain@chatspike.net> + * <Craig@chatspike.net> + * + * Written by Craig Edwards, Craig McLure, and others. + * This program is free but copyrighted software; see + * the file COPYING for details. + * + * --------------------------------------------------- + + $Log$ + Revision 1.1 2003/01/23 19:45:58 brain + Initial revision + + Revision 1.3 2003/01/15 22:47:44 brain + Changed user and channel structs to classes (finally) + + Revision 1.2 2003/01/09 21:09:50 brain + added '/stats M' command + + Revision 1.1 2003/01/07 01:02:14 brain + + definitions for command table types + + + * --------------------------------------------------- + */ +#include "inspircd_config.h" +#include "inspircd.h" + +#ifndef __CTABLES_H__ +#define __CTABLES_H__ + +typedef void (handlerfunc) (char**, int, userrec*); + +/* a structure that defines a command */ + +struct command_t { + char command[MAXBUF]; /* command name */ + handlerfunc *handler_function; /* handler function as in typedef */ + char flags_needed; /* user flags needed to execute the command or 0 */ + int min_params; /* minimum number of parameters command takes */ + long use_count; /* used by /stats m */ + long total_bytes; /* used by /stats m */ +}; + +#endif + diff --git a/include/dynamic.h b/include/dynamic.h new file mode 100644 index 000000000..b34f2358b --- /dev/null +++ b/include/dynamic.h @@ -0,0 +1,114 @@ +#ifndef __DLL_H +#define __DLL_H + +// +// class DLLManager is the simple ELF C++ Library manager. +// +// It tries to dynamically load the specified shared library +// when it is construted. +// +// You should call LastError() before doing anything. If it +// returns NULL there is no error. +// + + +class DLLManager +{ + public: + DLLManager( const char *fname ); + virtual ~DLLManager(); + + + bool GetSymbol( void **, const char *sym_name ); + + const char *LastError() + { + return err; + } + + protected: + void *h; + const char *err; +}; + + +// +// class DLLFactoryBase is the base class used for the DLLFactory +// template class. +// +// It inherits from the DLLManager class and must be constructed with +// the file name of the shared library and the function name within that +// library which will create the desired C++ factory class. +// If you do not provide func_name to the constructor, it defaults to +// the undecorated "C" symbol "factory0" +// +// factory_func will be set to a pointer to the requested factory creator +// function. If there was an error linking to the shared library, +// factory_func will be 0. +// +// You can call 'LastError()' to find the error message that occurred. +// +// + +class DLLFactoryBase : public DLLManager +{ + public: + DLLFactoryBase( + const char *fname, + const char *func_name=0 + ); + + virtual ~DLLFactoryBase(); + + void * (*factory_func)(void); +}; + + +// +// The DLLFactory template class inherits from DLLFactoryBase. +// The constructor takes the file name of the shared library +// and the undecorated "C" symbol name of the factory creator +// function. The factory creator function in your shared library +// MUST either return a pointer to an object that is a subclass +// of 'T' or it must return 0. +// +// If everything is cool, then 'factory' will point to the +// requested factory class. If not, it will be 0. +// +// Since the DLLFactory template ultimately inherits DLLManager, +// you can call LastError() to get any error code information +// +// The created factory is OWNED by the DLLFactory class. +// The created factory will get deleted when the DLLFactory class +// is deleted, because the DLL will get unloaded as well. +// + +template <class T> +class DLLFactory : public DLLFactoryBase +{ + public: + DLLFactory( + const char *fname, + const char *func_name=0 + ) : DLLFactoryBase( fname, func_name ) + { + if( factory_func ) + factory = (T *)factory_func(); + else + factory = 0; + } + + ~DLLFactory() + { + delete factory; + } + + T *factory; +}; + + + + + + +#endif diff --git a/include/globals.h b/include/globals.h new file mode 100644 index 000000000..93d5a448c --- /dev/null +++ b/include/globals.h @@ -0,0 +1,59 @@ +/* + +$Log$ +Revision 1.1 2003/01/23 19:45:58 brain +Initial revision + +Revision 1.5 2003/01/22 20:49:16 brain +Added FileReader file-caching class +Changed m_randquote to use FileReader class + +Revision 1.4 2003/01/15 22:47:44 brain +Changed user and channel structs to classes (finally) + +Revision 1.3 2003/01/13 22:30:50 brain +Added Admin class (holds /admin info for modules) +Added methods to Server class + + +*/ + + +#ifndef __WORLD_H +#define __WORLD_H + +// include the common header files + +#include <typeinfo> +#include <iostream.h> +#include <string> +#include <deque> +#include "users.h" +#include "channels.h" + +typedef deque<string> file_cache; + +void WriteOpers(char* text, ...); +void debug(char *text, ...); +void Write(int sock,char *text, ...); +void WriteServ(int sock, char* text, ...); +void WriteFrom(int sock, userrec *user,char* text, ...); +void WriteTo(userrec *source, userrec *dest,char *data, ...); +void WriteChannel(chanrec* Ptr, userrec* user, char* text, ...); +void ChanExceptSender(chanrec* Ptr, userrec* user, char* text, ...); +int common_channels(userrec *u, userrec *u2); +void WriteCommon(userrec *u, char* text, ...); +void WriteCommonExcept(userrec *u, char* text, ...); +void WriteWallOps(userrec *source, char* text, ...); +int isnick(const char *n); +userrec* Find(string nick); +chanrec* FindChan(const char* chan); +char* cmode(userrec *user, chanrec *chan); +string getservername(); +string getnetworkname(); +string getadminname(); +string getadminemail(); +string getadminnick(); +void readfile(file_cache &F, const char* fname); + +#endif diff --git a/include/inspircd.h b/include/inspircd.h new file mode 100644 index 000000000..dab7258f3 --- /dev/null +++ b/include/inspircd.h @@ -0,0 +1,94 @@ +/* + +$Log$ +Revision 1.1 2003/01/23 19:45:58 brain +Initial revision + +Revision 1.7 2003/01/22 20:49:16 brain +Added FileReader file-caching class +Changed m_randquote to use FileReader class + +Revision 1.6 2003/01/19 20:12:24 brain +Fixed ident max length to 10 + +Revision 1.5 2003/01/15 22:47:44 brain +Changed user and channel structs to classes (finally) + +Revision 1.4 2003/01/13 22:30:50 brain +Added Admin class (holds /admin info for modules) +Added methods to Server class + + +*/ + + +#include <string> +#include <stdio.h> +#include <syslog.h> +#include <stdlib.h> +#include <unistd.h> +#include <signal.h> +#include <time.h> +#include <netdb.h> +#include <string.h> +#include <ctype.h> +#include <errno.h> +#include <stdarg.h> +#include <assert.h> +#include <sys/param.h> +#include <sys/types.h> +#ifndef _LINUX_C_LIB_VERSION +#include <sys/socket.h> +#include <sys/stat.h> +#include <netinet/in.h> +#endif +#include <arpa/inet.h> +#include <string> +#include <deque> + +#include "inspircd_config.h" +#include "inspircd_io.h" +#include "inspircd_util.h" +#include "users.h" +#include "channels.h" + +#define ERROR -1 +#define TRUE 1 +#define FALSE 0 +#define IDENTMAX 9 +/* max sockets we can open */ +#define MAXSOCKS 64 + +typedef deque<string> file_cache; + +/* prototypes */ +int InspIRCd(void); +int InitConfig(void); +void Error(int status); +void send_error(char *s); +void ReadConfig(void); +void strlower(char *n); + +void WriteOpers(char* text, ...); +void debug(char *text, ...); +void Write(int sock,char *text, ...); +void WriteServ(int sock, char* text, ...); +void WriteFrom(int sock, userrec *user,char* text, ...); +void WriteTo(userrec *source, userrec *dest,char *data, ...); +void WriteChannel(chanrec* Ptr, userrec* user, char* text, ...); +void ChanExceptSender(chanrec* Ptr, userrec* user, char* text, ...); +int common_channels(userrec *u, userrec *u2); +void WriteCommon(userrec *u, char* text, ...); +void WriteCommonExcept(userrec *u, char* text, ...); +void WriteWallOps(userrec *source, char* text, ...); +int isnick(const char *n); +userrec* Find(string nick); +chanrec* FindChan(const char* chan); +char* cmode(userrec *user, chanrec *chan); +string getservername(); +string getnetworkname(); +string getadminname(); +string getadminemail(); +string getadminnick(); +void readfile(file_cache &F, const char* fname); + diff --git a/include/inspircd_io.h b/include/inspircd_io.h new file mode 100644 index 000000000..bdf9d3e18 --- /dev/null +++ b/include/inspircd_io.h @@ -0,0 +1,43 @@ +/* +------------------------------------+ + * | Inspire Internet Relay Chat Daemon | + * +------------------------------------+ + * + * Inspire is copyright (C) 2002-2003 ChatSpike-Dev. + * E-mail: + * <brain@chatspike.net> + * <Craig@chatspike.net> + * + * Written by Craig Edwards, Craig McLure, and others. + * This program is free but copyrighted software; see + * the file COPYING for details. + * + * --------------------------------------------------- + + $Log$ + Revision 1.1 2003/01/23 19:45:58 brain + Initial revision + + Revision 1.5 2003/01/21 20:31:24 brain + Modified to add documentation + Added ConfigReader class for modules + + Revision 1.4 2003/01/06 23:38:29 brain + + just playing with header tags + + + * --------------------------------------------------- + */ + +void Exit (int); +void Start (void); +int DaemonSeed (void); +int CheckConfig (void); +int OpenTCPSocket (void); +int BindSocket (int sockfd, struct sockaddr_in client, struct sockaddr_in server, int port, char* addr); + +int ConfValue(char* tag, char* var, int index, char *result); +int ReadConf(const char* filename,const char* tag, const char* var, int index, char *result); +int ConfValueEnum(char* tag); +int EnumConf(const char* filename,const char* tag); + diff --git a/include/inspircd_util.h b/include/inspircd_util.h new file mode 100644 index 000000000..f65594d34 --- /dev/null +++ b/include/inspircd_util.h @@ -0,0 +1,14 @@ +/* + +$Log$ +Revision 1.1 2003/01/23 19:45:58 brain +Initial revision + +Revision 1.2 2003/01/15 22:49:18 brain +Added log macros + + +*/ + +char * SafeStrncpy (char *, const char *, size_t ); +char * CleanIpAddr (char *, const char *); diff --git a/include/modules.h b/include/modules.h new file mode 100644 index 000000000..971f3ec26 --- /dev/null +++ b/include/modules.h @@ -0,0 +1,334 @@ +/* + +$Log$ +Revision 1.1 2003/01/23 19:45:58 brain +Initial revision + +Revision 1.12 2003/01/22 20:59:10 brain +Added FileReader class documentation + +Revision 1.11 2003/01/22 20:49:16 brain +Added FileReader file-caching class +Changed m_randquote to use FileReader class + +Revision 1.10 2003/01/22 00:57:27 brain +Changes to documentation + +Revision 1.9 2003/01/22 00:44:26 brain +Added documentation comments + +Revision 1.8 2003/01/21 20:31:24 brain +Modified to add documentation +Added ConfigReader class for modules + +Revision 1.7 2003/01/15 22:47:44 brain +Changed user and channel structs to classes (finally) + +Revision 1.6 2003/01/13 22:30:50 brain +Added Admin class (holds /admin info for modules) +Added methods to Server class + + +*/ + + +#ifndef __PLUGIN_H +#define __PLUGIN_H + +#include "dynamic.h" +#include <string> +#include <deque> + +/** Low level definition of a FileReader classes file cache area + */ +typedef deque<string> file_cache; + + +// This #define allows us to call a method in all +// loaded modules in a readable simple way, e.g.: +// 'FOREACH_MOD OnConnect(user);' + +#define FOREACH_MOD for (int i = 0; i <= MODCOUNT; i++) modules[i]-> + +// class Version holds the version information of a Module, returned +// by Module::GetVersion (thanks RD) + +/** Holds a module's Version information + * The four members (set by the constructor only) indicate details as to the version number + * of a module. A class of type Version is returned by the GetVersion method of the Module class. + */ +class Version +{ + public: + const int Major, Minor, Revision, Build; + Version(int major, int minor, int revision, int build); +}; + + +/** Holds /ADMIN data + * This class contains the admin details of the local server. It is constructed by class Server, + * and has three read-only values, Name, Email and Nick that contain the specified values for the + * server where the module is running. + */ +class Admin +{ + public: + const string Name, Email, Nick; + Admin(string name,string email,string nick); +}; + +/** Base class for all InspIRCd modules + * This class is the base class for InspIRCd modules. All modules must inherit from this class, + * its methods will be called when irc server events occur. class inherited from module must be + * instantiated by the ModuleFactory class (see relevent section) for the plugin to be initialised. + */ +class Module +{ + public: + /** Default constructor + * creates a module class + */ + Module(); + /** Default destructor + * destroys a module class + */ + virtual ~Module(); + /** Returns the version number of a Module. + * The method should return a Version object with its version information assigned via + * Version::Version + */ + virtual Version GetVersion(); + /** Called when a user connects. + * The details of the connecting user are available to you in the parameter userrec *user + */ + virtual void OnUserConnect(userrec* user); + /** Called when a user quits. + * The details of the exiting user are available to you in the parameter userrec *user + */ + virtual void OnUserQuit(userrec* user); + /** Called when a user joins a channel. + * The details of the joining user are available to you in the parameter userrec *user, + * and the details of the channel they have joined is available in the variable chanrec *channel + */ + virtual void OnUserJoin(userrec* user, chanrec* channel); + /** Called when a user parts a channel. + * The details of the leaving user are available to you in the parameter userrec *user, + * and the details of the channel they have left is available in the variable chanrec *channel + */ + virtual void OnUserPart(userrec* user, chanrec* channel); +}; + + +/** Allows server output and query functions + * This class contains methods which allow a module to query the state of the irc server, and produce + * output to users and other servers. All modules should instantiate at least one copy of this class, + * and use its member functions to perform their tasks. + */ +class Server +{ + public: + /** Default constructor. + * Creates a Server object. + */ + Server(); + /** Default destructor. + * Destroys a Server object. + */ + virtual ~Server(); + + /** Sends text to all opers. + * This method sends a server notice to all opers with the usermode +s. + */ + virtual void SendOpers(string s); + /** Sends a debug string. + * This method writes a line of text to the debug log. If debugging is disabled + * in the configuration, this command has no effect. + */ + virtual void Debug(string s); + /** Sends a line of text down a TCP/IP socket. + * This method writes a line of text to an established socket, cutting it to 510 characters + * plus a carriage return and linefeed if required. + */ + virtual void Send(int Socket, string s); + /** Sends text from the server to a socket. + * This method writes a line of text to an established socket, with the servername prepended + * as used by numerics (see RFC 1459) + */ + virtual void SendServ(int Socket, string s); + /** Sends text from a user to a socket. + * This method writes a line of text to an established socket, with the given user's nick/ident + * /host combination prepended, as used in PRIVSG etc commands (see RFC 1459) + */ + virtual void SendFrom(int Socket, userrec* User, string s); + /** Sends text from a user to another user. + * This method writes a line of text to a user, with a user's nick/ident + * /host combination prepended, as used in PRIVMSG etc commands (see RFC 1459) + */ + virtual void SendTo(userrec* Source, userrec* Dest, string s); + /** Sends text from a user to a channel (mulicast). + * This method writes a line of text to a channel, with the given user's nick/ident + * /host combination prepended, as used in PRIVMSG etc commands (see RFC 1459). If the + * IncludeSender flag is set, then the text is also sent back to the user from which + * it originated, as seen in MODE (see RFC 1459). + */ + virtual void SendChannel(userrec* User, chanrec* Channel, string s,bool IncludeSender); + /** Returns true if two users share a common channel. + * This method is used internally by the NICK and QUIT commands, and the Server::SendCommon + * method. + */ + virtual bool CommonChannels(userrec* u1, userrec* u2); + /** Sends text from a user to one or more channels (mulicast). + * This method writes a line of text to all users which share a common channel with a given + * user, with the user's nick/ident/host combination prepended, as used in PRIVMSG etc + * commands (see RFC 1459). If the IncludeSender flag is set, then the text is also sent + * back to the user from which it originated, as seen in NICK (see RFC 1459). Otherwise, it + * is only sent to the other recipients, as seen in QUIT. + */ + virtual void SendCommon(userrec* User, string text,bool IncludeSender); + /** Sends a WALLOPS message. + * This method writes a WALLOPS message to all users with the +w flag, originating from the + * specified user. + */ + virtual void SendWallops(userrec* User, string text); + + /** Returns true if a nick is valid. + * Nicks for unregistered connections will return false. + */ + virtual bool IsNick(string nick); + /** Attempts to look up a nick and return a pointer to it. + * This function will return NULL if the nick does not exist. + */ + virtual userrec* FindNick(string nick); + /** Attempts to look up a channel and return a pointer to it. + * This function will return NULL if the channel does not exist. + */ + virtual chanrec* FindChannel(string channel); + /** Attempts to look up a user's privilages on a channel. + * This function will return a string containing either @, %, +, or an empty string, + * representing the user's privilages upon the channel you specify. + */ + virtual string ChanMode(userrec* User, chanrec* Chan); + /** Returns the server name of the server where the module is loaded. + */ + virtual string GetServerName(); + /** Returns the network name, global to all linked servers. + */ + virtual string GetNetworkName(); + /** Returns the information of the server as returned by the /ADMIN command. + * See the Admin class for further information of the return value. The members + * Admin::Nick, Admin::Email and Admin::Name contain the information for the + * server where the module is loaded. + */ + virtual Admin GetAdmin(); + +}; + +/** Allows reading of values from configuration files + * This class allows a module to read from either the main configuration file (inspircd.conf) or from + * a module-specified configuration file. It may either be instantiated with one parameter or none. + * Constructing the class using one parameter allows you to specify a path to your own configuration + * file, otherwise, inspircd.conf is read. + */ +class ConfigReader +{ + protected: + /** The filename of the configuration file, as set by the constructor. + */ + string fname; + public: + /** Default constructor. + * This constructor initialises the ConfigReader class to read the inspircd.conf file + * as specified when running ./configure. + */ + ConfigReader(); // default constructor reads ircd.conf + /** Overloaded constructor. + * This constructor initialises the ConfigReader class to read a user-specified config file + */ + ConfigReader(string filename); // read a module-specific config + /** Default destructor. + * This method destroys the ConfigReader class. + */ + ~ConfigReader(); + /** Retrieves a value from the config file. + * This method retrieves a value from the config file. Where multiple copies of the tag + * exist in the config file, index indicates which of the values to retrieve. + */ + string ReadValue(string tag, string name, int index); + /** Counts the number of times a given tag appears in the config file. + * This method counts the number of times a tag appears in a config file, for use where + * there are several tags of the same kind, e.g. with opers and connect types. It can be + * used with the index value of ConfigReader::ReadValue to loop through all copies of a + * multiple instance tag. + */ + int Enumerate(string tag); + /** Returns true if a config file is valid. + * This method is unimplemented and will always return true. + */ + bool Verify(); +}; + + + +/** Caches a text file into memory and can be used to retrieve lines from it. + * This class contains methods for read-only manipulation of a text file in memory. + * Either use the constructor type with one parameter to load a file into memory + * at construction, or use the LoadFile method to load a file. + */ +class FileReader +{ + file_cache fc; + public: + /** Default constructor. + * This method does not load any file into memory, you must use the LoadFile method + * after constructing the class this way. + */ + FileReader(); + /** Secondary constructor. + * This method initialises the class with a file loaded into it ready for GetLine and + * and other methods to be called. If the file could not be loaded, FileReader::FileSize + * returns 0. + */ + FileReader(string filename); + /** Default destructor. + * This deletes the memory allocated to the file. + */ + ~FileReader(); + /** Used to load a file. + * This method loads a file into the class ready for GetLine and + * and other methods to be called. If the file could not be loaded, FileReader::FileSize + * returns 0. + */ + void LoadFile(string filename); + /** Retrieve one line from the file. + * This method retrieves one line from the text file. If an empty non-NULL string is returned, + * the index was out of bounds, or the line had no data on it. + */ + string GetLine(int x); + /** Returns the size of the file in lines. + * This method returns the number of lines in the read file. If it is 0, no lines have been + * read into memory, either because the file is empty or it does not exist, or cannot be + * opened due to permission problems. + */ + int FileSize(); +}; + + +/** Instantiates classes inherited from Module + * This class creates a class inherited from type Module, using new. This is to allow for modules + * to create many different variants of Module, dependent on architecture, configuration, etc. + * In most cases, the simple class shown in the example module m_foobar.so will suffice for most + * modules. + */ +class ModuleFactory +{ + public: + ModuleFactory() { } + virtual ~ModuleFactory() { } + /** Creates a new module. + * Your inherited class of ModuleFactory must return a pointer to your Module class + * using this method. + */ + virtual Module * CreateModule() = 0; +}; + +#endif diff --git a/include/users.h b/include/users.h new file mode 100644 index 000000000..dddda8dd6 --- /dev/null +++ b/include/users.h @@ -0,0 +1,248 @@ +/* + +$Log$ +Revision 1.1 2003/01/23 19:45:58 brain +Initial revision + +Revision 1.9 2003/01/22 00:44:26 brain +Added documentation comments + +Revision 1.8 2003/01/21 21:11:17 brain +Added documentation + +Revision 1.7 2003/01/17 13:21:38 brain +Added CONNECT ALLOW and CONNECT DENY config tags +Added PASS command + +Revision 1.6 2003/01/17 10:37:55 brain +Added /INVITE command and relevent structures + +Revision 1.5 2003/01/16 20:11:56 brain +fixed some ugly pointer bugs (thanks dblack and a|KK|y!) + +Revision 1.4 2003/01/15 22:47:44 brain +Changed user and channel structs to classes (finally) + +Revision 1.3 2003/01/14 21:14:30 brain +added /ISON command (for mIRC etc basic notify) + + +*/ + +#include "inspircd_config.h" +#include "channels.h" + +#include <string> + +#ifndef __USERS_H__ +#define __USERS_H__ + +#define STATUS_OP 4 +#define STATUS_HOP 2 +#define STATUS_VOICE 1 +#define STATUS_NORMAL 0 + +#define CC_ALLOW 0 +#define CC_DENY 1 + +/** Holds a channel name to which a user has been invited. + */ +class Invited +{ + public: + char channel[CHANMAX]; +}; + + +/** Holds information relevent to <connect allow> and <connect deny> tags in the config file. + */ +class ConnectClass +{ + public: + int type; + char host[MAXBUF]; + char pass[MAXBUF]; +}; + +/** Holds a complete list of all channels to which a user has been invited and has not yet joined. + */ +typedef vector<Invited> InvitedList; + + + +/** Holds a complete list of all allow and deny tags from the configuration file (connection classes) + */ +typedef vector<ConnectClass> ClassVector; + +/** Holds all information about a user + * This class stores all information about a user connected to the irc server. Everything about a + * connection is stored here primarily, from the user's socket ID (file descriptor) through to the + * user's nickname and hostname. Use the Find method of the server class to locate a specific user + * by nickname. + */ +class userrec +{ + private: + + /** A list of channels the user has a pending invite to. + */ + InvitedList invites; + public: + + /** The users nickname. + * An invalid nickname indicates an unregistered connection prior to the NICK command. + */ + + char nick[NICKMAX]; + + /** The users ip address in network order. + */ + unsigned long ip; + + /** The users ident reply. + */ + char ident[64]; + + /** The users hostname, or ip address in string form. + */ + char host[256]; + + /** The host displayed to non-opers (used for cloaking etc). + * This usually matches the value of userrec::host. + */ + char dhost[256]; + + /** The users full name. + */ + char fullname[128]; + + /** The users file descriptor. + * If this is zero, the socket has been closed and the core has not yet + * realised and removed the record from memory. + */ + int fd; + + /** The user's mode string. + * This may contain any of the following RFC characters: o, w, s, i + * Your module may define other mode characters as it sees fit. + */ + char modes[32]; + + /** The users input buffer. + * Used by the C recv() function. + */ + char inbuf[MAXBUF]; + + /** The last time the user was pinged by the core. + * When this value is more than 120 seconds difference from 'time(NULL)', a ping is sent + * to the client. If the user has an outstanding PING request the next time this + * event occurs after 4 total minutes, they are disconnected. + */ + time_t lastping; + + /** The users signon time. + */ + time_t signon; + + /** The time the user last sent a message. + * See also userrec::lastping and userrec::signon + */ + time_t idle_lastmsg; + + /** True if the user replied to their last ping. + * If this is true, the user can be sent another ping at the specified time, otherwise + * they will be discnnected. See also userrec::lastping + */ + time_t nping; + + /** Bit 1 is set if the user sent a NICK command, bit 2 is set if the user sent a USER command. + * If both bits are set then the connection is awaiting MOTD. Sending of MOTD sets bit 3, and + * makes the value of userrec::registered == 7, showing a fully established client session. + */ + int registered; + + /** A list of the channels the user is currently on. + * If any of these values are NULL, the record is not in use and may be associated with + * a channel by the JOIN command. see RFC 1459. + */ + ucrec chans[MAXCHANS]; + + /** The server the user is connected to. + */ + char server[256]; + + /** The user's away message. + * If this string is empty, the user is not marked as away. + */ + char awaymsg[512]; + + /** The port that the user connected to. + */ + int port; + + /** Stores the number of incoming bytes from the connection. + * Used by /STATS + */ + long bytes_in; + + /** Stores the number of outgoing bytes to the connection. + * Used by /STATS + */ + long bytes_out; + + /** Stores the number of incoming commands from the connection. + * Used by /STATS + */ + long cmds_in; + + /** Stores the number of outgoing commands to the connection. + * Used by /STATS + */ + long cmds_out; + + /** Stores the result of the last GetFullHost or GetRealHost call. + * You may use this to increase the speed of use of this class. + */ + char result[256]; + + /** True if a correct password has been given using PASS command. + * If the user is a member of a connection class that does not require a password, + * the value stored here is of no use. + */ + bool haspassed; + + userrec(); + + virtual ~userrec() { } + + /** Returns the full displayed host of the user + * This member function returns the hostname of the user as seen by other users + * on the server, in nick!ident&at;host form. + */ + virtual char* GetFullHost(); + + /** Returns the full real host of the user + * This member function returns the hostname of the user as seen by other users + * on the server, in nick!ident&at;host form. If any form of hostname cloaking is in operation, + * e.g. through a module, then this method will ignore it and return the true hostname. + */ + virtual char* GetFullRealHost(); + + /** Returns true if a user is invited to a channel. + */ + virtual bool IsInvited(char* channel); + + /** Adds a channel to a users invite list (invites them to a channel) + */ + virtual void InviteTo(char* channel); + + /** Removes a channel from a users invite list. + * This member function is called on successfully joining an invite only channel + * to which the user has previously been invited, to clear the invitation. + */ + virtual void RemoveInvite(char* channel); + +}; + + +#endif diff --git a/include/wildcard.h b/include/wildcard.h new file mode 100644 index 000000000..ab6e6d71e --- /dev/null +++ b/include/wildcard.h @@ -0,0 +1,7 @@ +#include <string> +#include "inspircd_config.h" + +void Delete(char* str,int pos); +void Insert(char* substr,char* str,int pos); +bool match(char* literal, char* mask); + diff --git a/makeconf b/makeconf new file mode 100755 index 000000000..7df9226bc --- /dev/null +++ b/makeconf @@ -0,0 +1,693 @@ +#!/bin/sh +# InspIRCd Configuration Creator +# +# Copyright 2003 The ChatSpike Development Team +# <Craig@chatspike.net> +# <brain@chatspike.net> +# +# $Id$ +# +######################################################## + +echo "Configuring Default Values" + +PERL=`which perl` +if [ "$PERL" = "" ] ; then + echo "You require perl to run this program." + exit; +fi + +ME=`pwd` +SERV_NAME="my.server.name" +SERV_DESC="My InspIRCd Server" +SERV_NET="MyNetwork" + +ADMIN_NAME="My Name" +ADMIN_NICK="MyNick" +ADMIN_MAIL="My@E-Mail.Address" + +DIE_PASS="DieNow" +RESTART_PASS="RestartNow" +DIE_WAIT="5" + +CONNECT_ALLOW="*" +CONNECT_PASS="ServerPass" + +VHOST_DOMAIN="inspircd.org" + +OPER_NICK="Fred" +OPER_PASS="mysecret" +OPER_HOST="*@*" +OPER_TYPE="NetAdmin" + +FILES_MOTD="$ME/conf/inspire.motd" +FILES_RULE="$ME/conf/inspire.rules" + +OP_PREFIX="Quit: " +OP_DEBUG="off" +OP_HALFY="yes" +OP_PROTE="yes" +OP_FOUND="yes" + +rm -f makeconf.temp + +c="" +n="" + +if [ "`eval echo -n 'a'`" = "-n a" ] ; then + c="\c" + else + n="-n" +fi + +clear +echo -e "'\033[1;33m####\033[0;37m:'\033[1;33m##\033[0;37m::: \033[1;33m##\033[0;37m::'\033[1;33m######\033[0;37m::'\033[1;33m########\033[0;37m::'\033[1;33m####\033[0;37m:'\033[1;33m########\033[0;37m:::'\033[1;33m######\033[0;37m::'\033[1;33m########\033[0;37m::" +echo -e ". \033[1;33m##\033[0;37m:: \033[1;33m###\033[0;37m:: \033[1;33m##\033[0;37m:'\033[1;33m##\033[0;37m... \033[1;33m##\033[0;37m: \033[1;33m##\033[0;37m.... \033[1;33m##\033[0;37m:. \033[1;33m##\033[0;37m:: \033[1;33m##\033[0;37m.... \033[1;33m##\033[0;37m:'\033[1;33m##\033[0;37m... \033[1;33m##\033[0;37m: \033[1;33m##\033[0;37m.... \033[1;33m##\033[0;37m:" +echo -e ": \033[1;33m##\033[0;37m:: \033[1;33m####\033[0;37m: \033[1;33m##\033[0;37m: \033[1;33m##\033[0;37m:::..:: \033[1;33m##\033[0;37m:::: \033[1;33m##\033[0;37m:: \033[1;33m##\033[0;37m:: \033[1;33m##\033[0;37m:::: \033[1;33m##\033[0;37m: \033[1;33m##\033[0;37m:::..:: \033[1;33m##\033[0;37m:::: \033[1;33m##\033[0;37m:" +echo -e ": \033[1;33m##\033[0;37m:: \033[1;33m##\033[0;37m \033[1;33m##\033[0;37m \033[1;33m##\033[0;37m:. \033[1;33m######\033[0;37m:: \033[1;33m########\033[0;37m::: \033[1;33m##\033[0;37m:: \033[1;33m########\033[0;37m:: \033[1;33m##\033[0;37m::::::: \033[1;33m##\033[0;37m:::: \033[1;33m##\033[0;37m:" +echo -e ": \033[1;33m##\033[0;37m:: \033[1;33m##\033[0;37m. \033[1;33m####\033[0;37m::..... \033[1;33m##\033[0;37m: \033[1;33m##\033[0;37m.....:::: \033[1;33m##\033[0;37m:: \033[1;33m##\033[0;37m.. \033[1;33m##\033[0;37m::: \033[1;33m##\033[0;37m::::::: \033[1;33m##\033[0;37m:::: \033[1;33m##\033[0;37m:" +echo -e ": \033[1;33m##\033[0;37m:: \033[1;33m##\033[0;37m:. \033[1;33m###\033[0;37m:'\033[1;33m##\033[0;37m::: \033[1;33m##\033[0;37m: \033[1;33m##\033[0;37m::::::::: \033[1;33m##\033[0;37m:: \033[1;33m##\033[0;37m::. \033[1;33m##\033[0;37m:: \033[1;33m##\033[0;37m::: \033[1;33m##\033[0;37m: \033[1;33m##\033[0;37m:::: \033[1;33m##\033[0;37m:" +echo -e "'\033[1;33m####\033[0;37m: \033[1;33m##\033[0;37m::. \033[1;33m##\033[0;37m:. \033[1;33m######\033[0;37m:: \033[1;33m##\033[0;37m::::::::'\033[1;33m####\033[0;37m: \033[1;33m##\033[0;37m:::. \033[1;33m##\033[0;37m:. \033[1;33m######\033[0;37m:: \033[1;33m########\033[0;37m::" +echo -e "\033[0;37m\033[0;37m....::..::::..:::......:::..:::::::::....::..:::::..:::......:::........:::" +echo "" +echo -e "\033[1;37mWelcome to the inspircd.conf file maker!!" +echo -e "\033[0;37m" +echo -e "*** Although with most values, hitting \033[1;37m<RETURN>\033[0;37m will use the default, ***" +echo "*** others are not like this. Where possible, Please fill in all the ***" +echo "*** values manually. Once complete, you *WILL* be required to edit ***" +echo "*** the created file manually, to ensure values are correct. Enjoy! ***" +echo -e "*** Between the [\033[1;32mBRACKETS\033[0;37m] will be default / example values to help ***" + +echo "" +echo "" + +echo "The first Part of this is the server Configuration. Here we will take" +echo "Details, Such as the servers name, Description, and The administrators" +echo "information. Once complete, the Screen will clear, and stage 2 will begin" + +echo "" +echo "Enter Servers Name" +echo -e $n "[\033[1;32m$SERV_NAME\033[0;37m] -> $c" +read cc +if [ "$cc" ] ; then + SERV_NAME=$cc +fi + + +echo "" +echo "Enter Server Description" +echo -e $n "[\033[1;32m$SERV_DESC\033[0;37m] -> $c" +read cc +if [ "$cc" ] ; then + SERV_DESC=$cc +fi + + +echo "" +echo "Enter Your Network Name" +echo -e $n "[\033[1;32m$SERV_NET\033[0;37m] -> $c" +read cc +if [ "$cc" ] ; then + SERV_NET=$cc +fi + + +echo "" +echo "" + +echo "" +echo "Enter Administrators Full Name" +echo -e $n "[\033[1;32m$ADMIN_NAME\033[0;37m] -> $c" +read cc +if [ "$cc" ] ; then + ADMIN_NAME=$cc +fi + + +echo "" +echo "Enter Administrators NickName" +echo -e $n "[\033[1;32m$ADMIN_NICK\033[0;37m] -> $c" +read cc +if [ "$cc" ] ; then + ADMIN_NICK=$cc +fi + + +echo "" +echo "Enter Administrators Email Address" +echo -e $n "[\033[1;32m$ADMIN_MAIL\033[0;37m] -> $c" +read cc +if [ "$cc" ] ; then + ADMIN_MAIL=$cc +fi + + +echo "Section Complete, Writing Config File Header." + +### +# Config file header Here! +### + +echo "########################################################################" >> makeconf.temp +echo "# #" >> makeconf.temp +echo "# --------------------------- #" >> makeconf.temp +echo "# InspIRCd Configuration File #" >> makeconf.temp +echo "# --------------------------- #" >> makeconf.temp +echo "# #" >> makeconf.temp +echo "##################################||####################################" >> makeconf.temp +echo " #||#" >> makeconf.temp +echo "##################################||####################################" >> makeconf.temp +echo "# #" >> makeconf.temp +echo "# This is an example of the config file for InspIRCd. #" >> makeconf.temp +echo "# Change the options to suit your network #" >> makeconf.temp +echo "# #" >> makeconf.temp +echo "# Written by : makeconf (Craig@inspircd.org) #" >> makeconf.temp +echo "# #" >> makeconf.temp +echo "########################################################################" >> makeconf.temp +echo "" >> makeconf.temp +echo "" >> makeconf.temp + +### +# Complete, server tag now +### + +echo "#-#-#-#-#-#-#-#-#-#-#-#- SERVER DESCRIPTION -#-#-#-#-#-#-#-#-#-#-#-#-" >> makeconf.temp +echo "<server name=\"$SERV_NAME\"" >> makeconf.temp +echo " description=\"$SERV_DESC\"" >> makeconf.temp +echo " network=\"$SERV_NET\">" >> makeconf.temp +echo "" >> makeconf.temp +echo "" >> makeconf.temp + +### +# Admin Tag.. +### + +echo "#-#-#-#-#-#-#-#-#-#-#-#- ADMIN INFORMATION -#-#-#-#-#-#-#-#-#-#-#-#" >> makeconf.temp +echo "<admin name=\"$ADMIN_NAME\"" >> makeconf.temp +echo " nick=\"$ADMIN_NICK\"" >> makeconf.temp +echo " email=\"$ADMIN_MAIL\">" >> makeconf.temp +echo "" >> makeconf.temp +echo "" >> makeconf.temp + +### +# Complete. +### + +clear +echo "Congratulations, you have successfully Configured your Server and Administrator" +echo "Information Correctly. Proceeding to Servers Port Configuration." + +echo "" +echo "" + +echo "Now its time to specify which IP and ports you wish to run the IRCd on." +echo "When asked please enter the IP Address, and ports. As a note, you may" +echo "Leave the IP Address blank to bind to all avaliable interfaces." +echo "" +echo "To end, either type \"done\" as the IP, or leave the Port Blank." +echo "" + +### +# Write Config Header.. +### + +echo "#-#-#-#-#-#-#-#-#-#-#-#-#-#-#- RTFM LINE -#-#-#-#-#-#-#-#-#-#-#-#-#-#" >> makeconf.temp +echo "# #" >> makeconf.temp +echo "# Just remove this... Its here to make you read through this file #" >> makeconf.temp +echo "# properly after running \"makeconf\" #" >> makeconf.temp +echo "" >> makeconf.temp +echo "<die value=\"tut tut, someone didnt check their config file properly\">" >> makeconf.temp +echo "" >> makeconf.temp +echo "" >> makeconf.temp + + +echo "#-#-#-#-#-#-#-#-#-#-#-#- PORT CONFIGURATION -#-#-#-#-#-#-#-#-#-#-#-" >> makeconf.temp + +### +# Ok, done.. Proceed :) +### + +BOUND_PORT="" +ok=0 +default=0 +while [ $ok -eq 0 ] ; do + echo "Enter the IP" + echo $n "[] -> $c" + read cc + if [ "$cc" == "done" ] ; then + ok=1 + else + BIND_IP=$cc + fi + if [ "$ok" != "1" ] ; then + echo -e "Ports Already Bound: \033[1;32m$BOUND_PORT\033[0;37m" + echo "Enter Port to Bind to $BIND_IP" + echo $n "[] -> $c" + read cc + if [ ! "$cc" ] ; then + ok=1 + else + default=1 + BOUND_PORT="$BOUND_PORT $cc" + echo "<bind address=\"$BIND_IP\" port=\"$cc\">" >> makeconf.temp + fi + fi +done + +if [ "$default" == "0" ] ; then + echo "<bind address=\"\" port=\"6667\">" >> makeconf.temp +fi + +### +# OoOok.. Finishing section +### + +echo "" >> makeconf.temp +echo "" >> makeconf.temp + +### +# Finished, Port Configuration Complete :D +### + + +clear +if [ "$default" == "0" ] ; then + echo "<bind address=\"\" port=\"6667\">" >> makeconf.temp + echo "" + echo "" +fi +echo "See? that wasnt so hard, The next bit is easier, just more important." + +echo "" +echo "" +echo "I now need you to specify Passwords which will shut down, and restart" +echo "your server, these are _IMPORTANT_ and i will not allow you to use the" +echo "default passwords, you must use your own." +ok=0 +while [ $ok -eq 0 ] ; do + echo "" + echo "Enter the password to Kill the IRCd" + echo -e $n "[\033[1;32m$DIE_PASS\033[0;37m] -> $c" + read cc + if [ ! "$cc" ] ; then + echo "" + echo "You _MUST_ specify your Own Password, try again." + else + DIE_PASS=$cc + ok=1 + fi +done + +echo "" +echo "" +ok=0 +while [ $ok -eq 0 ] ; do + echo "" + echo "Now Enter the Password you will use to Restart." + echo -e $n "[\033[1;32m$RESTART_PASS\033[0;37m] -> $c" + read cc + if [ ! "$cc" ] ; then + echo "" + echo "You _MUST_ specify your Own Password, try again." + else + RESTART_PASS=$cc + ok=1 + fi +done + +echo "" +echo "Enter the Pause Between Issuing a DIE/RESTART request to the IRCd Actually doing it [in Seconds]" +echo -e $n "[\033[1;32m$DIE_WAIT\033[0;37m] -> $c" +read cc +if [ "$cc" ] ; then + DIE_WAIT=$cc +fi + +### +# Now Write the config.. What phun +### + +echo "#-#-#-#-#-#-#-#-#-#- DIE/RESTART CONFIGURATION -#-#-#-#-#-#-#-#-#-#-" >> makeconf.temp +echo "<power diepass=\"$DIE_PASS\"" >> makeconf.temp +echo " restartpass=\"$RESTART_PASS\"" >> makeconf.temp +echo " pause=\"$DIE_WAIT\">" >> makeconf.temp +echo "" >> makeconf.temp +echo "" >> makeconf.temp + +### +# <Insert done comment here> +### +clear +echo "ok, seeing as we managed that, we have to Arrange a list of people allowed to connect :)" +echo "" +echo "" + +echo "This section allows you to Specify who is allowed Access to the IRCd. IP Addresses only Please" +echo "Although you can choose to use wildcards if you please. The default is * with no password." +echo "Type \"done\" at the IP Address, or leave it blank to finish, you do _NOT_ have to specify" +echo "any passwords" +echo "" + + +### +# Just another Friendly Header :p +### + +echo "#-#-#-#-#-#-#-#-#-#- CONNECTIONS CONFIGURATION -#-#-#-#-#-#-#-#-#-#-" >> makeconf.temp + +ok=0 +default=0 + +while [ $ok -eq 0 ] ; do + echo "" + echo "Enter The IP Address" + echo -e $n "[\033[1;32m$CONNECT_ALLOW\033[0;37m] -> $c" + read cc + if [ "$cc" == "done" ] ; then + ok=1 + elif [ ! "$cc" ] ; then + ok=1 + else + ALLOW_IP=$cc + fi + if [ "$ok" != "1" ] ; then + echo "Enter Password [If Applicable]" + echo $n "[] -> $c" + read cc + if [ ! "$cc" ] ; then + default=1 + echo "<connect allow=\"$ALLOW_IP\">" >> makeconf.temp + else + echo "<connect allow=\"$ALLOW_IP\" password=\"$cc\">" >> makeconf.temp + fi + fi +done +if [ "$default" == "0" ] ; then + echo "<connect allow=\"*\">" >> makeconf.temp +fi + +### +# Insert Line Break before deny +### + +echo "" >> makeconf.temp + + +### +# Another part done +### + +if [ "$default" == "0" ] ; then + echo "No allow lines Specified, using defaults." +fi +echo "" +echo "" +echo "Now For the denies.. These will prevent users accessing the server, once again," +echo "entering nothing, or \"done\" will complete the cycle, and allow you to continue" +echo "" +echo "Enter the IP Address" +ok=0 +while [ $ok -eq 0 ] ; do + echo -e $n "[\033[1;32m$CONNECT_ALLOW\033[0;37m] -> $c" + read cc + if [ "$cc" == "done" ] ; then + ok=1 + elif [ ! "$cc" ] ; then + ok=1 + else + echo "<connect deny=\"$cc\">" >> makeconf.temp + fi +done + +### +# Footer Now +### + +echo "" >> makeconf.temp +echo "" >> makeconf.temp + +clear +echo "Ok, now thats finished, we come to oper Classes And Compositions. Due to the Nature" +echo "of this, this Script will set the default tags, if you wish to change them, you will" +echo "have to edit the Finished config manually, in most cases they shouldnt be changed." + +echo "" +echo "" +echo "Before we do that thou, i need to ask for the Domain name of your server, for example," +echo "chatspike.net. This will be used To generate your vhosts." +echo -e $n "[\033[1;32m$VHOST_DOMAIN\033[0;37m] -> $c" +read cc +if [ "$cc" ] ; then + VHOST_DOMAIN=$cc +fi + +echo "#-#-#-#-#-#-#-#-#-#-#-#- CLASS CONFIGURATION -#-#-#-#-#-#-#-#-#-#-#-" >> makeconf.temp +echo "<class name=\"Shutdown\" commands=\"DIE RESTART REHASH\">" >> makeconf.temp +echo "<class name=\"ServerLink\" commands=\"CONNECT SQUIT\">" >> makeconf.temp +echo "<class name=\"BanControl\" commands=\"KILL GLINE KLINE ZLINE QLINE SHUN\">" >> makeconf.temp +echo "<class name=\"OperChat\" commands=\"WALLOPS CHATOPS\">" >> makeconf.temp +echo "<class name=\"HostCloak\" commands=\"SETHOST SETIDENT SETNAME\">" >> makeconf.temp +echo "" >> makeconf.temp +echo "" >> makeconf.temp +echo "#-#-#-#-#-#-#-#-#-#-#-#- OPERATOR COMPOSITION -#-#-#-#-#-#-#-#-#-#-#" >> makeconf.temp +echo "<type name=\"NetAdmin\" classes=\"OperChat BanControl HostCloak Shutdown ServerLink\" host=\"netadmin.$VHOST_DOMAIN\">" >> makeconf.temp +echo "<type name=\"GlobalOp\" classes=\"OperChat BanControl HostCloak ServerLink\" host=\"ircop.$VHOST_DOMAIN\">" >> makeconf.temp +echo "<type name=\"LocalOp\" classes=\"OperChat BanControl HostCloak\" host=\"local.$VHOST_DOMAIN\">" >> makeconf.temp +echo "<type name=\"Helper\" classes=\"HostCloak\" host=\"helper.$VHOST_DOMAIN\">" >> makeconf.temp +echo "" >> makeconf.temp +echo "" >> makeconf.temp +clear +echo "Yay, now comes the fun Part, time to specify Opers." + +echo "" +echo "" +echo "Ok, heres the deal, gonna ask you four questions, all require answering. They are as follows:" +echo "1) The Opers Login, This part will replace <login> in /oper <login> <password>" +echo "2) The Opers Password, This will replace <password> in /oper <login> <password>" +echo "3) The Opers Host, The oper must be connecting from this host for /oper to work [user@host]" +echo "4) The Opers Class, currently all avaliable are: \"NetAdmin\", \"GlobalOp\", \"LocalOp\" and \"Helper\"" +echo "" +echo "You may re-configure the classes later, and if you enter nothing for part one, we will proceed to the next step" + + +### +# Stolen another few lines >;) +### + +echo "#-#-#-#-#-#-#-#-#-#-#- OPERATOR CONFIGURATION -#-#-#-#-#-#-#-#-#-#-#" >> makeconf.temp + +### +# Done :p +### + +ok=0 +while [ $ok -eq 0 ] ; do + echo "Enter the opers login name" + echo -e $n "[\033[1;32m$OPER_NICK\033[0;37m] -> $c" + read cc + if [ ! "$cc" ] ; then + ok=1 + else + OPER_LOGIN=$cc + fi + if [ $ok -eq 0 ] ; then + ok2=0 + while [ $ok2 -eq 0 ] ; do + echo "Enter the Opers Password" + echo -e $n "[\033[1;32m$OPER_PASS\033[0;37m] -> $c" + read cc + if [ ! "$cc" ] ; then + echo "You _MUST_ Enter a password" + else + OPER_PASS=$cc + ok2=1 + fi + done + echo "Enter Opers Host [Format User@host]" + echo -e $n "[\033[1;32m$OPER_HOST\033[0;37m] -> $c" + read cc + if [ ! "$cc" ] ; then + OPER_HOST=$OPER_HOST + else + OPER_HOST=$cc + fi + echo "Enter Opers Type [Avaliable: NetAdmin, GlobalOp, LocalOp and Helper] CHOOSE ONLY ONE" + echo -e $n "[\033[1;32m$OPER_TYPE\033[0;37m] -> $c" + read cc + if [ ! "$cc" ] ; then + OPER_TYPE=$OPER_TYPE + else + OPER_TYPE=$cc + fi + echo "Coming for a re-run" + + echo "<oper name=\"$OPER_LOGIN\"" >> makeconf.temp + echo " password=\"$OPER_PASS\"" >> makeconf.temp + echo " host=\"$OPER_HOST\"" >> makeconf.temp + echo " type=\"$OPER_TYPE\">" >> makeconf.temp + + fi +done + +echo "" >> makeconf.temp +echo "" >> makeconf.temp + +echo "#-#-#-#-#-#-#-#-#-#-#-#-#-#-#- RTFM LINE -#-#-#-#-#-#-#-#-#-#-#-#-#-#" >> makeconf.temp +echo "# You should know what to do here.. if not.. RTFM!! muahahahahaha #" >> makeconf.temp +echo "" >> makeconf.temp +echo "<die value=\"And god came down from the heavens and smote down the noob.\">" >> makeconf.temp +echo "" >> makeconf.temp +echo "" >> makeconf.temp + + +clear +echo "Congratulations, Your Opers are configured!" +echo "" +echo "" +echo "Right, i have guessed where you Message of the Day and Rules Files will be." +echo "If these are correct, just hit return, else, type in the correct Location." +echo "" +echo "First The Message of the day." +echo -e $n "[\033[1;32m$FILES_MOTD\033[0;37m] -> $c" +read cc +if [ "$cc" ] ; then + FILES_MOTD=$cc +fi +echo "" +echo "Right, now the Rules file." +echo -e $n "[\033[1;32m$FILES_RULE\033[0;37m] -> $c" +read cc +if [ "$cc" ] ; then + FILES_RULE=$cc +fi + +echo "#-#-#-#-#-#-#-#-#-#- MISCELLANEOUS CONFIGURATION -#-#-#-#-#-#-#-#-#-" >> makeconf.temp +echo "<files motd=\"$FILES_MOTD\"" >> makeconf.temp +echo " rules=\"$FILES_RULE\">" >> makeconf.temp +echo "" >> makeconf.temp +echo "" >> makeconf.temp +clear +echo "Module Time!!" +echo "" +echo "" +echo "Enter the Names of the modules you wish to load, one at a time, below." +echo "Type in the name, hit return, type in another one, etc. Once complete, just hit return to end." +echo "" +echo "The Following Modules are avaliable:" +echo "" +MODLINE="" +for module in m_*.cpp ; do + mod=`perl -e '$a='$module';print substr($a,0,length($a)-3)'` + dmod=`perl -e '$a="'$mod.so'";while (length($a)<30) { $a = "$a ";}; print $a;'` + desc=`perl -e 'open (F, "<'$module'");local($/)=undef;$blah=<F>;$blah=~/\$ModDesc(.*)\*\//;print substr($1,13,length($1));close F;'` + echo -e "\033[1;32m$dmod\033[0;37m$desc" +done +echo "" + +### +# Module Header :p +### + +echo "#-#-#-#-#-#-#-#-#-#-#-#-#- MODULE OPTIONS -#-#-#-#-#-#-#-#-#-#-#-#-#" >> makeconf.temp + +### +# End header +### +ok=0 +while [ "$ok" -eq 0 ] ; do +echo $n "[] -> $c" +read cc +if [ "$cc" ] ; then + echo "<module name=\"$cc\">" >> makeconf.temp +else + ok=1 +fi +done + +echo "" >> makeconf.temp +echo "" >> makeconf.temp + +clear + +echo "This is it, The final set of Variables.. Then your config is complete." +echo "" +echo "" +echo "These are just a few tiny Simple things, well explained.. BEGIN!" +echo "" +echo "Quit Prefix, This comes before all users Quits, it can be what you like." +echo -e $n "[\033[1;32m$OP_PREFIX\033[0;37m] -> $c" +read cc +if [ $cc ] ; then + OP_PREFIX=$cc +fi + +echo "" +echo "Debug [on / off] Switch on or off Extensive IRCd loggin to ircd.log" +echo -e $n "[\033[1;32m$OP_DEBUG\033[0;37m] -> $c" +read cc +if [ "$cc" ] ; then + OP_DEBUG=$cc +fi + +echo "" +echo "Enable Halfops [Channel Mode +h], [yes/no]" +echo -e $n "[\033[1;32m$OP_HALFY\033[0;37m] -> $c" +read cc +if [ "$cc" ] ; then + OP_HALFY=$cc +fi + +echo "" +echo "Enable User Channel Protection [Channel Mode +a] [yes/no]" +echo -e $n "[\033[1;32m$OP_PROTE\033[0;37m] -> $c" +read cc +if [ "$cc" ] ; then + OP_PROTE=$cc +fi + +echo "" +echo "Enable Channel Founder? [Channel Mode +q] [yes/no]" +echo -e $n "[\033[1;32m$OP_FOUND\033[0;37m] -> $c" +read cc +if [ "$cc" ] ; then + OP_DEBUG=$cc +fi + +echo "#-#-#-#-#-#-#-#-#-#-#-#-#- SERVER OPTIONS -#-#-#-#-#-#-#-#-#-#-#-#-#" >> makeconf.temp +echo "<options prefixquit=\"$OP_PREFIX\"" >> makeconf.temp +echo " debug=\"$OP_DEBUG\"" >> makeconf.temp +echo " allowhalfop=\"$OP_HALFY\"" >> makeconf.temp +echo " allowprotect=\"$OP_PROTE\"" >> makeconf.temp +echo " allowfounder=\"$OP_FOUND\">" >> makeconf.temp +echo "" >> makeconf.temp +echo "" >> makeconf.temp + +ME=`pwd` +DIR=$ME/conf/inspircd.conf +echo "" +echo "LAST QUESTION!!" +echo "Where am i gonna be placed? [eg. $DIR]" +echo -e $n "[\033[1;32m$DIR\033[0;37m] -> $c" +read cc +if [ "$cc" ] ; then + DIR=$cc +fi + +echo "#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#- YAWN -#-#-#-#-#-#-#-#-#-#-#-#-#-#-#" >> makeconf.temp +echo "# #" >> makeconf.temp +echo "# You should already know what to do here :) #" >> makeconf.temp +echo "" >> makeconf.temp +echo "<die value=\"All l33t noobs must edit their configs.\">" >> makeconf.temp +echo "" >> makeconf.temp +echo "" >> makeconf.temp +echo "#########################################################################" >> makeconf.temp +echo "# #" >> makeconf.temp +echo "# -InspIRCd Development and Coding Team- #" >> makeconf.temp +echo "# www.inspircd.org #" >> makeconf.temp +echo "# #" >> makeconf.temp +echo "#########################################################################" >> makeconf.temp + + + + +mv makeconf.temp $DIR diff --git a/src/dynamic.cpp b/src/dynamic.cpp new file mode 100644 index 000000000..e9cddcbbf --- /dev/null +++ b/src/dynamic.cpp @@ -0,0 +1,70 @@ +#include "globals.h" +#include <dlfcn.h> +#include "dynamic.h" + + + +DLLManager::DLLManager( const char *fname ) +{ + // Try to open the library now and get any error message. + + h=dlopen( fname, RTLD_NOW ); + err=dlerror(); +} + +DLLManager::~DLLManager() +{ + // close the library if it isn't null + if( h!=0 ) + dlclose(h); +} + + +bool DLLManager::GetSymbol( + void **v, + const char *sym_name + ) +{ + // try extract a symbol from the library + // get any error message is there is any + + if( h!=0 ) + { + *v = dlsym( h, sym_name ); + err=dlerror(); + if( err==0 ) + return true; + else + return false; + } + else + { + return false; + } + +} + + +DLLFactoryBase::DLLFactoryBase( + const char *fname, + const char *factory=0 + ) : DLLManager(fname) +{ + // try get the factory function if there is no error yet + + factory_func=0; + + if( LastError()==0 ) + { + GetSymbol( (void **)&factory_func, factory ? factory : "init_module" ); + } + +} + + +DLLFactoryBase::~DLLFactoryBase() +{ +} + + + diff --git a/src/inspircd b/src/inspircd Binary files differnew file mode 100644 index 000000000..e2bea5dd2 --- /dev/null +++ b/src/inspircd diff --git a/src/inspircd.cpp b/src/inspircd.cpp new file mode 100644 index 000000000..b942e5700 --- /dev/null +++ b/src/inspircd.cpp @@ -0,0 +1,4209 @@ +/* +------------------------------------+ + * | Inspire Internet Relay Chat Daemon | + * +------------------------------------+ + * + * Inspire is copyright (C) 2002-2003 ChatSpike-Dev. + * E-mail: + * <brain@chatspike.net> + * <Craig@chatspike.net> + * + * Written by Craig Edwards, Craig McLure, and others. + * This program is free but copyrighted software; see + * the file COPYING for details. + * + * --------------------------------------------------- + + $Log$ + Revision 1.1 2003/01/23 19:45:58 brain + Initial revision + + Revision 1.56 2003/01/22 20:49:16 brain + Added FileReader file-caching class + Changed m_randquote to use FileReader class + + Revision 1.55 2003/01/21 16:56:19 brain + Fixed a few minor bugs + + Revision 1.54 2003/01/21 02:07:10 brain + optimisations galore! + + Revision 1.53 2003/01/21 00:18:40 brain + fixed random crash on kill_link (AGAIN) - was /stats + improved speed 10x (because i can...) + + Revision 1.52 2003/01/19 20:12:24 brain + Fixed ident max length to 10 + + Revision 1.51 2003/01/18 22:02:11 brain + fixed multiple /MODE +l bugs (thanks to akky and BOFH bugging meh!) + + Revision 1.50 2003/01/18 01:19:14 brain + Added code to tidy up bans (e.g. max nick length) - i blame mIRC! + + Revision 1.49 2003/01/17 22:03:57 brain + Fixed dodgy mode glitches (the ones Craig loves to play with, awww) + + Revision 1.48 2003/01/17 21:20:43 brain + Implemented usermode +s + + Revision 1.47 2003/01/17 21:13:40 brain + Added channel modes, +k, +l, +i, +m etc + Added user and channel modes +i, +p, +s + + Revision 1.46 2003/01/17 18:44:27 brain + Implemented channel mode +m + + Revision 1.45 2003/01/17 18:26:42 brain + added /TRACE command + + Revision 1.44 2003/01/17 15:21:03 brain + Fixed: /LUSERS cant count :P + + Revision 1.43 2003/01/17 13:21:38 brain + Added CONNECT ALLOW and CONNECT DENY config tags + Added PASS command + + Revision 1.42 2003/01/17 10:37:55 brain + Added /INVITE command and relevent structures + + Revision 1.41 2003/01/16 20:11:55 brain + fixed some ugly pointer bugs (thanks dblack and a|KK|y!) + + Revision 1.40 2003/01/16 08:31:44 brain + Fixed parameter error in QUIT code (was showing junk chars on BSD) + + Revision 1.39 2003/01/15 22:47:44 brain + Changed user and channel structs to classes (finally) + + Revision 1.38 2003/01/15 20:56:58 brain + Added wildcard support + Added channel bans + + Revision 1.37 2003/01/15 16:08:42 brain + Attempted to fix closed client sessions not being detected + + Revision 1.36 2003/01/15 09:36:13 brain + added pause= value to /die and /restart in config + + Revision 1.35 2003/01/14 22:08:31 brain + attemted to fix weird crash on /kill + + Revision 1.34 2003/01/14 21:44:25 brain + Added /USERS stub + Added /SUMMON stub + Changed optimisation to -O3 (much faster!) + + Revision 1.33 2003/01/14 21:14:30 brain + added /ISON command (for mIRC etc basic notify) + + Revision 1.32 2003/01/14 20:55:02 brain + Fixed more param crunching bugs + Added /AWAY + + Revision 1.31 2003/01/14 00:46:02 brain + Added m_cloaking.so module, provides host masking + + Revision 1.30 2003/01/13 22:30:50 brain + Added Admin class (holds /admin info for modules) + Added methods to Server class + + Revision 1.29 2003/01/13 00:43:29 brain + Added Server class + Added more code to example module demonstrating use of Server class + + Revision 1.28 2003/01/12 17:40:44 brain + ./configure improved by Craig (better prompts, dir creation) + '/stats z' added detail + + Revision 1.27 2003/01/12 16:49:53 brain + Added '/stats z' + + Revision 1.26 2003/01/12 15:01:18 brain + Added hostname/ip caching to speed up connects + + Revision 1.25 2003/01/11 21:39:57 brain + Made ircd cache message of the day in a vector (faster!) + Added support for multiple lines of /NAMES on large channels + + Revision 1.24 2003/01/11 19:00:10 brain + Added /USERHOST command + + Revision 1.23 2003/01/11 17:57:28 brain + Added '/STATS O' + Added more module error checking + + Revision 1.22 2003/01/11 00:48:44 brain + removed random debug output + + Revision 1.21 2003/01/11 00:06:46 brain + Fixed random crash on nickchange + Fine tuned ability to handle >300 users + + Revision 1.20 2003/01/09 22:24:59 brain + added '/stats L' (connect-info) + + Revision 1.19 2003/01/09 21:38:51 brain + '/stats u' support added (server uptime) + + Revision 1.18 2003/01/09 21:09:50 brain + added '/stats M' command + + Revision 1.17 2003/01/08 22:11:38 brain + + Added extra dynamic module support, new methods to Module class + + Revision 1.16 2003/01/08 17:48:48 brain + + fixed "user lingering" problem in kill_link + + Revision 1.15 2003/01/07 23:17:51 brain + + Fixed wallops and command parameter counting bugs + + Revision 1.14 2003/01/07 20:47:34 brain + + Fixes random crash on nickchange (must keep classfactory pointers!) + + Revision 1.13 2003/01/07 19:57:56 brain + + Dynamix module support, preliminary release + + Revision 1.12 2003/01/07 01:01:30 brain + + Changed command table to a vector of command_t types + + Revision 1.11 2003/01/06 23:43:30 brain + + extra debug output + + Revision 1.10 2003/01/06 23:38:29 brain + + just playing with header tags + + + * --------------------------------------------------- + */ + +/* Now with added unF! ;) */ + +#include "inspircd.h" +#include "inspircd_io.h" +#include "inspircd_util.h" +#include "inspircd_config.h" +#include <unistd.h> +#include <fcntl.h> +#include <sys/errno.h> +#include <sys/ioctl.h> +#include <sys/utsname.h> +#include <cstdio> +#include <time.h> +#include <string> +#include <hash_map.h> +#include <sstream> +#include <vector> +#include <errno.h> +#include <deque> +#include "users.h" +#include "ctables.h" +#include "globals.h" +#include "modules.h" +#include "dynamic.h" +#include "wildcard.h" + +using namespace std; + +char ServerName[MAXBUF]; +char Network[MAXBUF]; +char ServerDesc[MAXBUF]; +char AdminName[MAXBUF]; +char AdminEmail[MAXBUF]; +char AdminNick[MAXBUF]; +char diepass[MAXBUF]; +char restartpass[MAXBUF]; +char motd[MAXBUF]; +char rules[MAXBUF]; +char list[MAXBUF]; +char PrefixQuit[MAXBUF]; +char DieValue[MAXBUF]; +int debugging = 0; +int MODCOUNT = -1; +int DieDelay = 5; +time_t startup_time = time(NULL); + +template<> struct hash<in_addr> +{ + size_t operator()(const struct in_addr &a) const + { + size_t q; + memcpy(&q,&a,sizeof(size_t)); + return q; + } +}; + +template<> struct hash<string> +{ + size_t operator()(const string &s) const + { + char a[MAXBUF]; + static struct hash<const char *> strhash; + strcpy(a,s.c_str()); + strlower(a); + return strhash(a); + } +}; + + + +struct StrHashComp +{ + + bool operator()(const string& s1, const string& s2) const + { + char a[MAXBUF],b[MAXBUF]; + strcpy(a,s1.c_str()); + strcpy(b,s2.c_str()); + return (strcasecmp(a,b) == 0); + } + +}; + +struct InAddr_HashComp +{ + + bool operator()(const in_addr &s1, const in_addr &s2) const + { + size_t q; + size_t p; + + memcpy(&q,&s1,sizeof(size_t)); + memcpy(&p,&s2,sizeof(size_t)); + + return (q == p); + } + +}; + + +typedef hash_map<string, userrec*, hash<string>, StrHashComp> user_hash; +typedef hash_map<string, chanrec*, hash<string>, StrHashComp> chan_hash; +typedef hash_map<in_addr,string*, hash<in_addr>, InAddr_HashComp> address_cache; +typedef deque<command_t> command_table; +typedef DLLFactory<ModuleFactory> ircd_module; + +user_hash clientlist; +chan_hash chanlist; +command_table cmdlist; +file_cache MOTD; +file_cache RULES; +address_cache IP; +vector<Module*> modules(255); +vector<ircd_module*> factory(255); +ClassVector Classes; + +struct linger linger = { 0 }; +char bannerBuffer[MAXBUF]; +int boundPortCount = 0; + +/* prototypes */ + +int has_channel(userrec *u, chanrec *c); +int usercount(chanrec *c); +int usercount_i(chanrec *c); +void update_stats_l(int fd,int data_out); +char* Passwd(userrec *user); +bool IsDenied(userrec *user); + + +void safedelete(userrec *p) +{ + if (p) + { + debug("deleting %s %s %s %s",p->nick,p->ident,p->dhost,p->fullname); + debug("safedelete(userrec*): pointer is safe to delete"); + delete p; + } + else + { + debug("safedelete(userrec*): unsafe pointer operation squished"); + } +} + +void safedelete(chanrec *p) +{ + if (p) + { + delete p; + debug("safedelete(chanrec*): pointer is safe to delete"); + } + else + { + debug("safedelete(chanrec*): unsafe pointer operation squished"); + } +} + + +/* chop a string down to 512 characters and preserve linefeed (irc max + * line length) */ + +void chop(char* str) +{ + if (strlen(str) > 512) + { + str[510] = '\r'; + str[511] = '\n'; + str[512] = '\0'; + } +} + + +string getservername() +{ + return ServerName; +} + +string getnetworkname() +{ + return Network; +} + +string getadminname() +{ + return AdminName; +} + +string getadminemail() +{ + return AdminEmail; +} + +string getadminnick() +{ + return AdminNick; +} + +void debug(char *text, ...) +{ + char textbuffer[MAXBUF]; + va_list argsPtr; + FILE *f; + time_t rawtime; + struct tm * timeinfo; + + time(&rawtime); + timeinfo = localtime (&rawtime); + + if (debugging) + { + f = fopen("ircd.log","a+"); + if (f) + { + char b[MAXBUF]; + va_start (argsPtr, text); + vsnprintf(textbuffer, MAXBUF, text, argsPtr); + va_end(argsPtr); + strcpy(b,asctime(timeinfo)); + b[strlen(b)-1] = ':'; + fprintf(f,"%s %s\n",b,textbuffer); + fclose(f); + } + else + { + printf("Can't write log file, bailing!!!"); + Exit(ERROR); + } + } +} + +void readfile(file_cache &F, const char* fname) +{ + FILE* file; + char linebuf[MAXBUF]; + + debug("readfile: loading %s",fname); + F.clear(); + file = fopen(fname,"r"); + if (file) + { + while (!feof(file)) + { + fgets(linebuf,sizeof(linebuf),file); + linebuf[strlen(linebuf)-1]='\0'; + if (!strcmp(linebuf,"")) + { + strcpy(linebuf," "); + } + if (!feof(file)) + { + F.push_back(linebuf); + } + } + fclose(file); + } + else + { + debug("readfile: failed to load file: %s",fname); + } + debug("readfile: loaded %s, %d lines",fname,F.size()); +} + +void ReadConfig(void) +{ + char dbg[MAXBUF],pauseval[MAXBUF],Value[MAXBUF]; + ConnectClass c; + + ConfValue("server","name",0,ServerName); + ConfValue("server","description",0,ServerDesc); + ConfValue("server","network",0,Network); + ConfValue("admin","name",0,AdminName); + ConfValue("admin","email",0,AdminEmail); + ConfValue("admin","nick",0,AdminNick); + ConfValue("files","motd",0,motd); + ConfValue("files","rules",0,rules); + ConfValue("power","diepass",0,diepass); + ConfValue("power","pause",0,pauseval); + ConfValue("power","restartpass",0,restartpass); + ConfValue("options","prefixquit",0,PrefixQuit); + ConfValue("die","value",0,DieValue); + ConfValue("options","debug",0,dbg); + debugging = 0; + if (!strcmp(dbg,"on")) + { + debugging = 1; + } + DieDelay = atoi(pauseval); + readfile(MOTD,motd); + readfile(RULES,rules); + debug("Reading connect classes"); + Classes.clear(); + for (int i = 0; i < ConfValueEnum("connect"); i++) + { + strcpy(Value,""); + ConfValue("connect","allow",i,Value); + if (strcmp(Value,"")) + { + strcpy(c.host,Value); + c.type = CC_ALLOW; + strcpy(Value,""); + ConfValue("connect","password",i,Value); + strcpy(c.pass,Value); + Classes.push_back(c); + debug("Read connect class type ALLOW, host=%s password=%s",c.host,c.pass); + } + else + { + ConfValue("connect","deny",i,Value); + strcpy(c.host,Value); + c.type = CC_DENY; + Classes.push_back(c); + debug("Read connect class type DENY, host=%s",c.host); + } + + } +} + +void Blocking(int s) +{ + int flags; + debug("Blocking: %d",s); + flags = fcntl(s, F_GETFL, 0); + fcntl(s, F_SETFL, flags ^ O_NONBLOCK); +} + +void NonBlocking(int s) +{ + int flags; + debug("NonBlocking: %d",s); + flags = fcntl(s, F_GETFL, 0); + fcntl(s, F_SETFL, flags | O_NONBLOCK); +} + + +int CleanAndResolve (char *resolvedHost, const char *unresolvedHost) +{ + struct hostent *hostPtr = NULL; + struct in_addr addr; + + memset (resolvedHost, '\0',MAXBUF); + if(unresolvedHost == NULL) + return(ERROR); + if ((inet_aton(unresolvedHost,&addr)) == 0) + return(ERROR); + hostPtr = gethostbyaddr ((char *)&addr.s_addr,sizeof(addr.s_addr),AF_INET); + if (hostPtr != NULL) + snprintf(resolvedHost,MAXBUF,"%s",hostPtr->h_name); + else + snprintf(resolvedHost,MAXBUF,"%s",unresolvedHost); + return (TRUE); +} + +/* write formatted text to a socket, in same format as printf */ + +void Write(int sock,char *text, ...) +{ + char textbuffer[MAXBUF]; + va_list argsPtr; + char tb[MAXBUF]; + + va_start (argsPtr, text); + vsnprintf(textbuffer, MAXBUF, text, argsPtr); + va_end(argsPtr); + sprintf(tb,"%s\r\n",textbuffer); + chop(tb); + write(sock,tb,strlen(tb)); + update_stats_l(sock,strlen(tb)); /* add one line-out to stats L for this fd */ +} + +/* write a server formatted numeric response to a single socket */ + +void WriteServ(int sock, char* text, ...) +{ + char textbuffer[MAXBUF],tb[MAXBUF]; + va_list argsPtr; + va_start (argsPtr, text); + + vsnprintf(textbuffer, MAXBUF, text, argsPtr); + va_end(argsPtr); + sprintf(tb,":%s %s\r\n",ServerName,textbuffer); + chop(tb); + write(sock,tb,strlen(tb)); + update_stats_l(sock,strlen(tb)); /* add one line-out to stats L for this fd */ +} + +/* write text from an originating user to originating user */ + +void WriteFrom(int sock, userrec *user,char* text, ...) +{ + char textbuffer[MAXBUF],tb[MAXBUF]; + va_list argsPtr; + va_start (argsPtr, text); + + vsnprintf(textbuffer, MAXBUF, text, argsPtr); + va_end(argsPtr); + sprintf(tb,":%s!%s@%s %s\r\n",user->nick,user->ident,user->dhost,textbuffer); + chop(tb); + write(sock,tb,strlen(tb)); + update_stats_l(sock,strlen(tb)); /* add one line-out to stats L for this fd */ +} + +/* write text to an destination user from a source user (e.g. user privmsg) */ + +void WriteTo(userrec *source, userrec *dest,char *data, ...) +{ + char textbuffer[MAXBUF],tb[MAXBUF]; + va_list argsPtr; + va_start (argsPtr, data); + if ((!dest) || (!source)) + { + return; + } + vsnprintf(textbuffer, MAXBUF, data, argsPtr); + va_end(argsPtr); + chop(tb); + WriteFrom(dest->fd,source,"%s",textbuffer); +} + +/* write formatted text from a source user to all users on a channel + * including the sender (NOT for privmsg, notice etc!) */ + +void WriteChannel(chanrec* Ptr, userrec* user, char* text, ...) +{ + char textbuffer[MAXBUF]; + va_list argsPtr; + va_start (argsPtr, text); + vsnprintf(textbuffer, MAXBUF, text, argsPtr); + va_end(argsPtr); + for (user_hash::const_iterator i = clientlist.begin(); i != clientlist.end(); i++) + { + if (has_channel(i->second,Ptr)) + { + WriteTo(user,i->second,"%s",textbuffer); + } + } +} + +/* write formatted text from a source user to all users on a channel except + * for the sender (for privmsg etc) */ + +void ChanExceptSender(chanrec* Ptr, userrec* user, char* text, ...) +{ + char textbuffer[MAXBUF]; + va_list argsPtr; + va_start (argsPtr, text); + vsnprintf(textbuffer, MAXBUF, text, argsPtr); + va_end(argsPtr); + + for (user_hash::const_iterator i = clientlist.begin(); i != clientlist.end(); i++) + { + if (has_channel(i->second,Ptr) && (user != i->second)) + { + WriteTo(user,i->second,"%s",textbuffer); + } + } +} + +int c_count(userrec* u) +{ + int z = 0; + for (int i =0; i != MAXCHANS; i++) + if (u->chans[i].channel) + z++; + return z; + +} + +/* return 0 or 1 depending if users u and u2 share one or more common channels + * (used by QUIT, NICK etc which arent channel specific notices) */ + +int common_channels(userrec *u, userrec *u2) +{ + int i = 0; + int z = 0; + + if ((!u) || (!u2)) + { + return 0; + } + for (i = 0; i != MAXCHANS; i++) + { + for (z = 0; z != MAXCHANS; z++) + { + if ((u->chans[i].channel == u2->chans[z].channel) && (u->chans[i].channel) && (u2->chans[z].channel) && (u->registered == 7) && (u2->registered == 7)) + { + if ((c_count(u)) && (c_count(u2))) + { + return 1; + } + } + } + } + return 0; +} + +/* write a formatted string to all users who share at least one common + * channel, including the source user e.g. for use in NICK */ + +void WriteCommon(userrec *u, char* text, ...) +{ + char textbuffer[MAXBUF]; + va_list argsPtr; + va_start (argsPtr, text); + vsnprintf(textbuffer, MAXBUF, text, argsPtr); + va_end(argsPtr); + + WriteFrom(u->fd,u,"%s",textbuffer); + + for (user_hash::const_iterator i = clientlist.begin(); i != clientlist.end(); i++) + { + if (common_channels(u,i->second) && (i->second != u)) + { + WriteFrom(i->second->fd,u,"%s",textbuffer); + } + } +} + +/* write a formatted string to all users who share at least one common + * channel, NOT including the source user e.g. for use in QUIT */ + +void WriteCommonExcept(userrec *u, char* text, ...) +{ + char textbuffer[MAXBUF]; + va_list argsPtr; + va_start (argsPtr, text); + vsnprintf(textbuffer, MAXBUF, text, argsPtr); + va_end(argsPtr); + + for (user_hash::const_iterator i = clientlist.begin(); i != clientlist.end(); i++) + { + if ((common_channels(u,i->second)) && (u != i->second)) + { + WriteFrom(i->second->fd,u,"%s",textbuffer); + } + } +} + +void WriteOpers(char* text, ...) +{ + char textbuffer[MAXBUF]; + va_list argsPtr; + va_start (argsPtr, text); + vsnprintf(textbuffer, MAXBUF, text, argsPtr); + va_end(argsPtr); + + for (user_hash::const_iterator i = clientlist.begin(); i != clientlist.end(); i++) + { + if (strchr(i->second->modes,'o')) + { + if (strchr(i->second->modes,'s')) + { + // send server notices to all with +s + // (TODO: needs SNOMASKs) + WriteServ(i->second->fd,"NOTICE %s :%s",i->second->nick,textbuffer); + } + } + } +} + +void WriteWallOps(userrec *source, char* text, ...) +{ + int i = 0; + char textbuffer[MAXBUF]; + va_list argsPtr; + va_start (argsPtr, text); + vsnprintf(textbuffer, MAXBUF, text, argsPtr); + va_end(argsPtr); + + for (user_hash::const_iterator i = clientlist.begin(); i != clientlist.end(); i++) + { + if (strchr(i->second->modes,'w')) + { + WriteTo(source,i->second,"WALLOPS %s",textbuffer); + } + } +} + +/* convert a string to lowercase. Note following special circumstances + * taken from RFC 1459. Many "official" server branches still hold to this + * rule so i will too; + * + * Because of IRC's scandanavian origin, the characters {}| are + * considered to be the lower case equivalents of the characters []\, + * respectively. This is a critical issue when determining the + * equivalence of two nicknames. + */ + +void strlower(char *n) +{ + if (!n) + { + return; + } + for (int i = 0; i != strlen(n); i++) + { + n[i] = tolower(n[i]); + if (n[i] == '[') + n[i] = '{'; + if (n[i] == ']') + n[i] = '}'; + if (n[i] == '\\') + n[i] = '|'; + } +} + +/* verify that a user's nickname is valid */ + +int isnick(const char* n) +{ + int i = 0; + char v[MAXBUF]; + if (!n) + { + return 0; + } + if (!strcmp(n,"")) + { + return 0; + } + if (strlen(n) > NICKMAX-1) + { + return 0; + } + for (i = 0; i != strlen(n); i++) + { + if ((n[i] < 33) || (n[i] > 125)) + { + return 0; + } + /* can't occur ANYWHERE in a nickname! */ + if (strchr("<>,./?:;@'~#=+()*&%$£ \"!",n[i])) + { + return 0; + } + /* can't occur as the first char of a nickname... */ + if ((strchr("0123456789",n[i])) && (!i)) + { + return 0; + } + } + return 1; +} + +/* Find a user record by nickname and return a pointer to it */ + +userrec* Find(string nick) +{ + user_hash::iterator iter = clientlist.find(nick); + + if (iter == clientlist.end()) + /* Couldn't find it */ + return NULL; + + return iter->second; +} + +void update_stats_l(int fd,int data_out) /* add one line-out to stats L for this fd */ +{ + for (user_hash::const_iterator i = clientlist.begin(); i != clientlist.end(); i++) + { + if (i->second->fd == fd) + { + i->second->bytes_out+=data_out; + i->second->cmds_out++; + } + } +} + + +/* find a channel record by channel name and return a pointer to it */ + +chanrec* FindChan(const char* chan) +{ + chan_hash::iterator iter = chanlist.find(chan); + + if (iter == chanlist.end()) + /* Couldn't find it */ + return NULL; + + return iter->second; +} + + +void purge_empty_chans(void) +{ + int go_again = 1, purge = 0; + + while (go_again) + { + go_again = 0; + for (chan_hash::iterator i = chanlist.begin(); i != chanlist.end(); i++) + { + if (i->second) { + if (!usercount(i->second)) + { + /* kill the record */ + if (i != chanlist.end()) + { + debug("del_channel: destroyed: %s",i->second->name); + delete i->second; + chanlist.erase(i); + go_again = 1; + purge++; + break; + } + } + } + } + } + debug("completed channel purge, killed %d",purge); +} + +/* returns the status character for a given user on a channel, e.g. @ for op, + * % for halfop etc. If the user has several modes set, the highest mode + * the user has must be returned. */ + +char* cmode(userrec *user, chanrec *chan) +{ + int i; + for (i = 0; i != MAXCHANS; i++) + { + if ((user->chans[i].channel == chan) && (chan != NULL)) + { + if ((user->chans[i].uc_modes & UCMODE_OP) > 0) + { + return "@"; + } + if ((user->chans[i].uc_modes & UCMODE_HOP) > 0) + { + return "%"; + } + if ((user->chans[i].uc_modes & UCMODE_VOICE) > 0) + { + return "+"; + } + return ""; + } + } +} + +char scratch[MAXMODES]; + +char* chanmodes(chanrec *chan) +{ + strcpy(scratch,""); + if (chan->noexternal) + { + strcat(scratch,"n"); + } + if (chan->topiclock) + { + strcat(scratch,"t"); + } + if (strcmp(chan->key,"")) + { + strcat(scratch,"k"); + } + if (chan->limit) + { + strcat(scratch,"l"); + } + if (chan->inviteonly) + { + strcat(scratch,"i"); + } + if (chan->moderated) + { + strcat(scratch,"m"); + } + if (chan->secret) + { + strcat(scratch,"s"); + } + if (chan->c_private) + { + strcat(scratch,"p"); + } + if (strcmp(chan->key,"")) + { + strcat(scratch," "); + strcat(scratch,chan->key); + } + if (chan->limit) + { + char foo[24]; + sprintf(foo," %d",chan->limit); + strcat(scratch,foo); + } + debug("chanmodes: %s %s",chan->name,scratch); + return scratch; +} + +/* returns the status value for a given user on a channel, e.g. STATUS_OP for + * op, STATUS_VOICE for voice etc. If the user has several modes set, the + * highest mode the user has must be returned. */ + +int cstatus(userrec *user, chanrec *chan) +{ + int i; + for (i = 0; i != MAXCHANS; i++) + { + if ((user->chans[i].channel == chan) && (chan != NULL)) + { + if ((user->chans[i].uc_modes & UCMODE_OP) > 0) + { + return STATUS_OP; + } + if ((user->chans[i].uc_modes & UCMODE_HOP) > 0) + { + return STATUS_HOP; + } + if ((user->chans[i].uc_modes & UCMODE_VOICE) > 0) + { + return STATUS_VOICE; + } + return STATUS_NORMAL; + } + } +} + + +/* compile a userlist of a channel into a string, each nick seperated by + * spaces and op, voice etc status shown as @ and + */ + +void userlist(userrec *user,chanrec *c) +{ + sprintf(list,"353 %s = %s :", user->nick, c->name); + for (user_hash::const_iterator i = clientlist.begin(); i != clientlist.end(); i++) + { + if (has_channel(i->second,c)) + { + if (isnick(i->second->nick)) + { + if ((!has_channel(i->second,c)) && (strchr(i->second->modes,'i'))) + { + /* user is +i, and source not on the channel, does not show + * nick in NAMES list */ + continue; + } + strcat(list,cmode(i->second,c)); + strcat(list,i->second->nick); + strcat(list," "); + if (strlen(list)>(480-NICKMAX)) + { + /* list overflowed into + * multiple numerics */ + WriteServ(user->fd,list); + sprintf(list,"353 %s = %s :", user->nick, c->name); + } + } + } + } + /* if whats left in the list isnt empty, send it */ + if (list[strlen(list)-1] != ':') + { + WriteServ(user->fd,list); + } +} + +/* return a count of the users on a specific channel accounting for + * invisible users who won't increase the count. e.g. for /LIST */ + +int usercount_i(chanrec *c) +{ + int i = 0; + int count = 0; + + strcpy(list,""); + for (user_hash::const_iterator i = clientlist.begin(); i != clientlist.end(); i++) + { + if (has_channel(i->second,c)) + { + if (isnick(i->second->nick)) + { + if ((!has_channel(i->second,c)) && (strchr(i->second->modes,'i'))) + { + /* user is +i, and source not on the channel, does not show + * nick in NAMES list */ + continue; + } + count++; + } + } + } + debug("usercount_i: %s %d",c->name,count); + return count; +} + + +int usercount(chanrec *c) +{ + int i = 0; + int count = 0; + + strcpy(list,""); + for (user_hash::const_iterator i = clientlist.begin(); i != clientlist.end(); i++) + { + if (has_channel(i->second,c)) + { + if (isnick(i->second->nick)) + { + count++; + } + } + } + debug("usercount: %s %d",c->name,count); + return count; +} + + +/* add a channel to a user, creating the record for it if needed and linking + * it to the user record */ + +chanrec* add_channel(userrec *user, char* cname, char* key) +{ + int i = 0; + chanrec* Ptr; + int created = 0; + + if ((!cname) || (!user)) + { + return NULL; + } + if (strlen(cname) > CHANMAX-1) + { + cname[CHANMAX-1] = '\0'; + } + + debug("add_channel: %s %s",user->nick,cname); + + if ((has_channel(user,FindChan(cname))) && (FindChan(cname))) + { + return NULL; // already on the channel! + } + + if (!FindChan(cname)) + { + /* create a new one */ + debug("add_channel: creating: %s",cname); + { + chanlist[cname] = new chanrec(); + + strcpy(chanlist[cname]->name, cname); + chanlist[cname]->topiclock = 1; + chanlist[cname]->noexternal = 1; + chanlist[cname]->created = time(NULL); + strcpy(chanlist[cname]->topic, ""); + strncpy(chanlist[cname]->setby, user->nick,NICKMAX); + chanlist[cname]->topicset = 0; + Ptr = chanlist[cname]; + debug("add_channel: created: %s",cname); + /* set created to 2 to indicate user + * is the first in the channel + * and should be given ops */ + created = 2; + } + } + else + { + /* channel exists, just fish out a pointer to its struct */ + Ptr = FindChan(cname); + if (Ptr) + { + debug("add_channel: joining to: %s",Ptr->name); + if (strcmp(Ptr->key,"")) + { + debug("add_channel: %s has key %s",Ptr->name,Ptr->key); + if (!key) + { + debug("add_channel: no key given in JOIN"); + WriteServ(user->fd,"475 %s %s :Cannot join channel (Requires key)",user->nick, Ptr->name); + return NULL; + } + else + { + debug("key at %p is %s",key,key); + if (strcasecmp(key,Ptr->key)) + { + debug("add_channel: bad key given in JOIN"); + WriteServ(user->fd,"475 %s %s :Cannot join channel (Incorrect key)",user->nick, Ptr->name); + return NULL; + } + } + } + + if (Ptr->inviteonly) + { + if (user->IsInvited(Ptr->name)) + { + /* user was invited to channel */ + /* there may be an optional channel NOTICE here */ + } + else + { + WriteServ(user->fd,"473 %s %s :Cannot join channel (Invite only)",user->nick, Ptr->name); + return NULL; + } + } + + if (Ptr->limit) + { + if (usercount(Ptr) == Ptr->limit) + { + WriteServ(user->fd,"471 %s %s :Cannot join channel (Channel is full)",user->nick, Ptr->name); + return NULL; + } + } + + /* check user against the channel banlist */ + for (BanList::iterator i = Ptr->bans.begin(); i != Ptr->bans.end(); i++) + { + if (match(user->GetFullHost(),i->data)) + { + WriteServ(user->fd,"474 %s %s :Cannot join channel (You're banned)",user->nick, Ptr->name); + return NULL; + } + } + + user->RemoveInvite(Ptr->name); + + } + created = 1; + } + + + for (i =0; i != MAXCHANS; i++) + { + if (user->chans[i].channel == NULL) + { + if (created == 2) + { + /* first user in is given ops */ + user->chans[i].uc_modes = UCMODE_OP; + } + else + { + user->chans[i].uc_modes = 0; + } + user->chans[i].channel = Ptr; + WriteChannel(Ptr,user,"JOIN :%s",Ptr->name); + if (Ptr->topicset) + { + WriteServ(user->fd,"332 %s %s :%s", user->nick, Ptr->name, Ptr->topic); + WriteServ(user->fd,"333 %s %s %s %d", user->nick, Ptr->name, Ptr->setby, Ptr->topicset); + } + userlist(user,Ptr); + WriteServ(user->fd,"366 %s %s :End of /NAMES list.", user->nick, Ptr->name); + WriteServ(user->fd,"324 %s %s +%s",user->nick, Ptr->name,chanmodes(Ptr)); + WriteServ(user->fd,"329 %s %s %d", user->nick, Ptr->name, Ptr->created); + FOREACH_MOD OnUserJoin(user,Ptr); + return Ptr; + } + } + debug("add_channel: user channel max exceeded: %s %s",user->nick,cname); + WriteServ(user->fd,"405 %s %s :You are on too many channels",user->nick, cname); + return NULL; +} + +/* remove a channel from a users record, and remove the record from memory + * if the channel has become empty */ + +chanrec* del_channel(userrec *user, char* cname, char* reason) +{ + int i = 0; + chanrec* Ptr; + int created = 0; + + if ((!cname) || (!user)) + { + return NULL; + } + + Ptr = FindChan(cname); + + if (!Ptr) + { + return NULL; + } + + FOREACH_MOD OnUserPart(user,Ptr); + debug("del_channel: removing: %s %s",user->nick,Ptr->name); + + for (i =0; i != MAXCHANS; i++) + { + /* zap it from the channel list of the user */ + if (user->chans[i].channel == Ptr) + { + if (reason) + { + WriteChannel(Ptr,user,"PART %s :%s",Ptr->name, reason); + } + else + { + WriteChannel(Ptr,user,"PART :%s",Ptr->name); + } + user->chans[i].uc_modes = 0; + user->chans[i].channel = NULL; + debug("del_channel: unlinked: %s %s",user->nick,Ptr->name); + break; + } + } + + /* if there are no users left on the channel */ + if (!usercount(Ptr)) + { + chan_hash::iterator iter = chanlist.find(Ptr->name); + + debug("del_channel: destroying channel: %s",Ptr->name); + + /* kill the record */ + if (iter != chanlist.end()) + { + debug("del_channel: destroyed: %s",Ptr->name); + delete iter->second; + chanlist.erase(iter); + } + } +} + + +void kick_channel(userrec *src,userrec *user, chanrec *Ptr, char* reason) +{ + int i = 0; + int created = 0; + + if ((!Ptr) || (!user) || (!src)) + { + return; + } + + debug("kick_channel: removing: %s %s %s",user->nick,Ptr->name,src->nick); + + if (!has_channel(user,Ptr)) + { + WriteServ(src->fd,"441 %s %s %s :They are not on that channel",src->nick, user->nick, Ptr->name); + return; + } + if ((cstatus(src,Ptr) < STATUS_HOP) || (cstatus(src,Ptr) < cstatus(user,Ptr))) + { + if (cstatus(src,Ptr) == STATUS_HOP) + { + WriteServ(src->fd,"482 %s %s :You must be a channel operator",src->nick, Ptr->name); + } + else + { + WriteServ(src->fd,"482 %s %s :You must be at least a half-operator",src->nick, Ptr->name); + } + + return; + } + + for (i =0; i != MAXCHANS; i++) + { + /* zap it from the channel list of the user */ + if (user->chans[i].channel == Ptr) + { + WriteChannel(Ptr,src,"KICK %s %s :%s",Ptr->name, user->nick, reason); + user->chans[i].uc_modes = 0; + user->chans[i].channel = NULL; + debug("del_channel: unlinked: %s %s",user->nick,Ptr->name); + break; + } + } + + /* if there are no users left on the channel */ + if (!usercount(Ptr)) + { + chan_hash::iterator iter = chanlist.find(Ptr->name); + + debug("del_channel: destroying channel: %s",Ptr->name); + + /* kill the record */ + if (iter != chanlist.end()) + { + debug("del_channel: destroyed: %s",Ptr->name); + delete iter->second; + chanlist.erase(iter); + } + } +} + + +/* returns 1 if user u has channel c in their record, 0 if not */ + +int has_channel(userrec *u, chanrec *c) +{ + int i = 0; + + if (!u) + { + return 0; + } + for (i =0; i != MAXCHANS; i++) + { + if (u->chans[i].channel == c) + { + return 1; + } + } + return 0; +} + +int give_ops(userrec *user,char *dest,chanrec *chan,int status) +{ + userrec *d; + int i; + + if ((!user) || (!dest) || (!chan)) + { + return 0; + } + if (status != STATUS_OP) + { + WriteServ(user->fd,"482 %s %s :You're not a channel operator",user->nick, chan->name); + return 0; + } + else + { + if (!isnick(dest)) + { + WriteServ(user->fd,"401 %s %s :No suck nick/channel",user->nick, dest); + return 0; + } + d = Find(dest); + if (!d) + { + WriteServ(user->fd,"401 %s %s :No suck nick/channel",user->nick, dest); + return 0; + } + else + { + for (i = 0; i != MAXCHANS; i++) + { + if ((d->chans[i].channel == chan) && (chan != NULL)) + { + if (d->chans[i].uc_modes & UCMODE_OP) + { + /* mode already set on user, dont allow multiple */ + return 0; + } + d->chans[i].uc_modes = d->chans[i].uc_modes | UCMODE_OP; + debug("gave ops: %s %s",d->chans[i].channel->name,d->nick); + } + } + } + } + return 1; +} + +int give_hops(userrec *user,char *dest,chanrec *chan,int status) +{ + userrec *d; + int i; + + if ((!user) || (!dest) || (!chan)) + { + return 0; + } + if (status != STATUS_OP) + { + WriteServ(user->fd,"482 %s %s :You're not a channel operator",user->nick, chan->name); + return 0; + } + else + { + d = Find(dest); + if (!isnick(dest)) + { + WriteServ(user->fd,"401 %s %s :No suck nick/channel",user->nick, dest); + return 0; + } + if (!d) + { + WriteServ(user->fd,"401 %s %s :No suck nick/channel",user->nick, dest); + return 0; + } + else + { + for (i = 0; i != MAXCHANS; i++) + { + if ((d->chans[i].channel == chan) && (chan != NULL)) + { + if (d->chans[i].uc_modes & UCMODE_HOP) + { + /* mode already set on user, dont allow multiple */ + return 0; + } + d->chans[i].uc_modes = d->chans[i].uc_modes | UCMODE_HOP; + debug("gave h-ops: %s %s",d->chans[i].channel->name,d->nick); + } + } + } + } + return 1; +} + +int give_voice(userrec *user,char *dest,chanrec *chan,int status) +{ + userrec *d; + int i; + + if ((!user) || (!dest) || (!chan)) + { + return 0; + } + if (status < STATUS_HOP) + { + WriteServ(user->fd,"482 %s %s :You must be at least a half-operator",user->nick, chan->name); + return 0; + } + else + { + d = Find(dest); + if (!isnick(dest)) + { + WriteServ(user->fd,"401 %s %s :No suck nick/channel",user->nick, dest); + return 0; + } + if (!d) + { + WriteServ(user->fd,"401 %s %s :No suck nick/channel",user->nick, dest); + return 0; + } + else + { + for (i = 0; i != MAXCHANS; i++) + { + if ((d->chans[i].channel == chan) && (chan != NULL)) + { + if (d->chans[i].uc_modes & UCMODE_VOICE) + { + /* mode already set on user, dont allow multiple */ + return 0; + } + d->chans[i].uc_modes = d->chans[i].uc_modes | UCMODE_VOICE; + debug("gave voice: %s %s",d->chans[i].channel->name,d->nick); + } + } + } + } + return 1; +} + +int take_ops(userrec *user,char *dest,chanrec *chan,int status) +{ + userrec *d; + int i; + + if ((!user) || (!dest) || (!chan)) + { + return 0; + } + if (status != STATUS_OP) + { + WriteServ(user->fd,"482 %s %s :You're not a channel operator",user->nick, chan->name); + return 0; + } + else + { + d = Find(dest); + if (!isnick(dest)) + { + WriteServ(user->fd,"401 %s %s :No suck nick/channel",user->nick, dest); + return 0; + } + if (!d) + { + WriteServ(user->fd,"401 %s %s :No suck nick/channel",user->nick, dest); + return 0; + } + else + { + for (i = 0; i != MAXCHANS; i++) + { + if ((d->chans[i].channel == chan) && (chan != NULL)) + { + if ((d->chans[i].uc_modes & UCMODE_OP) == 0) + { + /* mode already set on user, dont allow multiple */ + return 0; + } + d->chans[i].uc_modes ^= UCMODE_OP; + debug("took ops: %s %s",d->chans[i].channel->name,d->nick); + } + } + } + } + return 1; +} + +int take_hops(userrec *user,char *dest,chanrec *chan,int status) +{ + userrec *d; + int i; + + if ((!user) || (!dest) || (!chan)) + { + return 0; + } + if (status != STATUS_OP) + { + WriteServ(user->fd,"482 %s %s :You're not a channel operator",user->nick, chan->name); + return 0; + } + else + { + d = Find(dest); + if (!isnick(dest)) + { + WriteServ(user->fd,"401 %s %s :No suck nick/channel",user->nick, dest); + return 0; + } + if (!d) + { + WriteServ(user->fd,"401 %s %s :No suck nick/channel",user->nick, dest); + return 0; + } + else + { + for (i = 0; i != MAXCHANS; i++) + { + if ((d->chans[i].channel == chan) && (chan != NULL)) + { + if ((d->chans[i].uc_modes & UCMODE_HOP) == 0) + { + /* mode already set on user, dont allow multiple */ + return 0; + } + d->chans[i].uc_modes ^= UCMODE_HOP; + debug("took h-ops: %s %s",d->chans[i].channel->name,d->nick); + } + } + } + } + return 1; +} + +int take_voice(userrec *user,char *dest,chanrec *chan,int status) +{ + userrec *d; + int i; + + if ((!user) || (!dest) || (!chan)) + { + return 0; + } + if (status < STATUS_HOP) + { + WriteServ(user->fd,"482 %s %s :You must be at least a half-operator",user->nick, chan->name); + return 0; + } + else + { + d = Find(dest); + if (!isnick(dest)) + { + WriteServ(user->fd,"401 %s %s :No suck nick/channel",user->nick, dest); + return 0; + } + if (!d) + { + WriteServ(user->fd,"401 %s %s :No suck nick/channel",user->nick, dest); + return 0; + } + else + { + for (i = 0; i != MAXCHANS; i++) + { + if ((d->chans[i].channel == chan) && (chan != NULL)) + { + if ((d->chans[i].uc_modes & UCMODE_VOICE) == 0) + { + /* mode already set on user, dont allow multiple */ + return 0; + } + d->chans[i].uc_modes ^= UCMODE_VOICE; + debug("took voice: %s %s",d->chans[i].channel->name,d->nick); + } + } + } + } + return 1; +} + +void TidyBan(char *ban) +{ + char temp[MAXBUF],NICK[MAXBUF],IDENT[MAXBUF],HOST[MAXBUF]; + + strcpy(temp,ban); + + char* pos_of_pling = strchr(temp,'!'); + char* pos_of_at = strchr(temp,'@'); + + pos_of_pling[0] = '\0'; + pos_of_at[0] = '\0'; + pos_of_pling++; + pos_of_at++; + + strncpy(NICK,temp,NICKMAX); + strncpy(IDENT,pos_of_pling,IDENTMAX+1); + strncpy(HOST,pos_of_at,160); + + sprintf(ban,"%s!%s@%s",NICK,IDENT,HOST); +} + +int add_ban(userrec *user,char *dest,chanrec *chan,int status) +{ + BanItem b; + if ((!user) || (!dest) || (!chan)) + return 0; + if (strchr(dest,'!')==0) + return 0; + if (strchr(dest,'@')==0) + return 0; + for (int i = 0; i < strlen(dest); i++) + if (dest[i] < 32) + return 0; + for (int i = 0; i < strlen(dest); i++) + if (dest[i] > 126) + return 0; + int c = 0; + for (int i = 0; i < strlen(dest); i++) + if (dest[i] == '!') + c++; + if (c>1) + return 0; + c = 0; + for (int i = 0; i < strlen(dest); i++) + if (dest[i] == '@') + c++; + if (c>1) + return 0; + debug("add_ban: %s %s",chan->name,user->nick); + + TidyBan(dest); + for (BanList::iterator i = chan->bans.begin(); i != chan->bans.end(); i++) + { + if (!strcasecmp(i->data,dest)) + { + // dont allow a user to set the same ban twice + return 0; + } + } + + b.set_time = time(NULL); + strncpy(b.data,dest,MAXBUF); + strncpy(b.set_by,user->nick,NICKMAX); + chan->bans.push_back(b); + return 1; +} + +int take_ban(userrec *user,char *dest,chanrec *chan,int status) +{ + if ((!user) || (!dest) || (!chan)) + { + return 0; + } + + debug("del_ban: %s %s",chan->name,user->nick); + for (BanList::iterator i = chan->bans.begin(); i != chan->bans.end(); i++) + { + if (!strcasecmp(i->data,dest)) + { + chan->bans.erase(i); + return 1; + } + } + return 0; +} + +void process_modes(char **parameters,userrec* user,chanrec *chan,int status, int pcnt) +{ + char modelist[MAXBUF]; + char outlist[MAXBUF]; + char outstr[MAXBUF]; + char outpars[32][MAXBUF]; + int param = 2; + int pc = 0; + int ptr = 0; + int mdir = 1; + int r = 0; + bool k_set = false, l_set = false; + + if (pcnt < 2) + { + return; + } + + debug("process_modes: start"); + + strcpy(modelist,parameters[1]); /* mode list, e.g. +oo-o */ + /* parameters[2] onwards are parameters for + * modes that require them :) */ + strcpy(outlist,"+"); + mdir = 1; + + debug("process_modes: modelist: %s",modelist); + + for (ptr = 0; ptr < strlen(modelist); ptr++) + { + r = 0; + + { + debug("process_modes: modechar: %c",modelist[ptr]); + switch (modelist[ptr]) + { + case '-': + if (mdir != 0) + { + if ((outlist[strlen(outlist)-1] == '+') || (outlist[strlen(outlist)-1] == '-')) + { + outlist[strlen(outlist)-1] = '-'; + } + else + { + strcat(outlist,"-"); + } + } + mdir = 0; + + break; + + case '+': + if (mdir != 1) + { + if ((outlist[strlen(outlist)-1] == '+') || (outlist[strlen(outlist)-1] == '-')) + { + outlist[strlen(outlist)-1] = '+'; + } + else + { + strcat(outlist,"+"); + } + } + mdir = 1; + break; + + case 'o': + if ((param >= pcnt)) break; + if (mdir == 1) + { + r = give_ops(user,parameters[param++],chan,status); + } + else + { + r = take_ops(user,parameters[param++],chan,status); + } + if (r) + { + strcat(outlist,"o"); + strcpy(outpars[pc++],parameters[param-1]); + } + break; + + case 'h': + if ((param >= pcnt)) break; + if (mdir == 1) + { + r = give_hops(user,parameters[param++],chan,status); + } + else + { + r = take_hops(user,parameters[param++],chan,status); + } + if (r) + { + strcat(outlist,"h"); + strcpy(outpars[pc++],parameters[param-1]); + } + break; + + + case 'v': + if ((param >= pcnt)) break; + if (mdir == 1) + { + r = give_voice(user,parameters[param++],chan,status); + } + else + { + r = take_voice(user,parameters[param++],chan,status); + } + if (r) + { + strcat(outlist,"v"); + strcpy(outpars[pc++],parameters[param-1]); + } + break; + + case 'b': + if ((param >= pcnt)) break; + if (mdir == 1) + { + r = add_ban(user,parameters[param++],chan,status); + } + else + { + r = take_ban(user,parameters[param++],chan,status); + } + if (r) + { + strcat(outlist,"b"); + strcpy(outpars[pc++],parameters[param-1]); + } + break; + + case 'k': + if ((param >= pcnt)) + break; + + if (mdir == 1) + { + if (k_set) + break; + + if (!strcmp(chan->key,"")) + { + strcat(outlist,"k"); + strcpy(outpars[pc++],parameters[param++]); + strcpy(chan->key,parameters[param-1]); + k_set = true; + } + } + else + { + /* only allow -k if correct key given */ + if (strcmp(chan->key,"")) + { + strcat(outlist,"k"); + strcpy(chan->key,""); + } + } + break; + + case 'l': + if (mdir == 0) + { + if (chan->limit) + { + strcat(outlist,"l"); + chan->limit = 0; + } + } + + if ((param >= pcnt)) break; + if (mdir == 1) + { + if (l_set) + break; + + bool invalid = false; + for (int i = 0; i < strlen(parameters[param]); i++) + { + if ((parameters[param][i] < '0') || (parameters[param][i] > '9')) + { + invalid = true; + } + } + if (atoi(parameters[param]) < 1) + { + invalid = true; + } + + if (invalid) + break; + + chan->limit = atoi(parameters[param]); + if (chan->limit) + { + strcat(outlist,"l"); + strcpy(outpars[pc++],parameters[param++]); + l_set = true; + } + } + break; + + case 'i': + if (chan->inviteonly != mdir) + { + strcat(outlist,"i"); + } + chan->inviteonly = mdir; + break; + + case 't': + if (chan->topiclock != mdir) + { + strcat(outlist,"t"); + } + chan->topiclock = mdir; + break; + + case 'n': + if (chan->noexternal != mdir) + { + strcat(outlist,"n"); + } + chan->noexternal = mdir; + break; + + case 'm': + if (chan->moderated != mdir) + { + strcat(outlist,"m"); + } + chan->moderated = mdir; + break; + + case 's': + if (chan->secret != mdir) + { + strcat(outlist,"s"); + if (chan->c_private) + { + chan->c_private = 0; + if (mdir) + { + strcat(outlist,"-p+"); + } + else + { + strcat(outlist,"+p-"); + } + } + } + chan->secret = mdir; + break; + + case 'p': + if (chan->c_private != mdir) + { + strcat(outlist,"p"); + if (chan->secret) + { + chan->secret = 0; + if (mdir) + { + strcat(outlist,"-s+"); + } + else + { + strcat(outlist,"+s-"); + } + } + } + chan->c_private = mdir; + break; + + } + } + } + + /* this ensures only the *valid* modes are sent out onto the network */ + while ((outlist[strlen(outlist)-1] == '-') || (outlist[strlen(outlist)-1] == '+')) + { + outlist[strlen(outlist)-1] = '\0'; + } + if (strcmp(outlist,"")) + { + strcpy(outstr,outlist); + for (ptr = 0; ptr < pc; ptr++) + { + strcat(outstr," "); + strcat(outstr,outpars[ptr]); + } + WriteChannel(chan,user,"MODE %s %s",chan->name,outstr); + } +} + +void handle_mode(char **parameters, int pcnt, userrec *user) +{ + chanrec* Ptr; + userrec* dest; + int can_change,i; + int direction = 1; + char outpars[MAXBUF]; + + dest = Find(parameters[0]); + + if ((dest) && (pcnt == 1)) + { + WriteServ(user->fd,"221 %s :+%s",user->nick,user->modes); + return; + } + if ((dest) && (pcnt > 1)) + { + can_change = 0; + if (user != dest) + { + if (strchr(user->modes,'o')) + { + can_change = 1; + } + } + else + { + can_change = 1; + } + if (!can_change) + { + WriteServ(user->fd,"482 %s :Can't change mode for other users",user->nick); + return; + } + + strcpy(outpars,"+"); + direction = 1; + + if ((parameters[1][0] != '+') && (parameters[1][0] != '-')) + return; + + for (i = 0; i < strlen(parameters[1]); i++) + { + if (parameters[1][i] == '+') + { + if (direction != 1) + { + if ((outpars[strlen(outpars)-1] == '+') || (outpars[strlen(outpars)-1] == '-')) + { + outpars[strlen(outpars)-1] = '+'; + } + else + { + strcat(outpars,"+"); + } + } + direction = 1; + } + else + if (parameters[1][i] == '-') + { + if (direction != 0) + { + if ((outpars[strlen(outpars)-1] == '+') || (outpars[strlen(outpars)-1] == '-')) + { + outpars[strlen(outpars)-1] = '-'; + } + else + { + strcat(outpars,"-"); + } + } + direction = 0; + } + else + { + can_change = 0; + if (strchr(user->modes,'o')) + { + can_change = 1; + } + else + { + if ((parameters[1][i] == 'i') || (parameters[1][i] == 'w') || (parameters[1][i] == 's')) + { + can_change = 1; + } + } + if (can_change) + { + if (direction == 1) + { + if (!strchr(dest->modes,parameters[1][i])) + { + dest->modes[strlen(dest->modes)+1]='\0'; + dest->modes[strlen(dest->modes)] = parameters[1][i]; + outpars[strlen(outpars)+1]='\0'; + outpars[strlen(outpars)] = parameters[1][i]; + } + } + else + { + int q = 0; + char temp[MAXBUF]; + char moo[MAXBUF]; + + outpars[strlen(outpars)+1]='\0'; + outpars[strlen(outpars)] = parameters[1][i]; + + strcpy(temp,""); + for (q = 0; q < strlen(user->modes); q++) + { + if (user->modes[q] != parameters[1][i]) + { + moo[0] = user->modes[q]; + moo[1] = '\0'; + strcat(temp,moo); + } + } + strcpy(user->modes,temp); + } + } + } + } + if (strlen(outpars)) + { + char b[MAXBUF]; + strcpy(b,""); + int z = 0; + int i = 0; + while (i < strlen (outpars)) + { + b[z++] = outpars[i++]; + b[z] = '\0'; + if (i<strlen(outpars)-1) + { + if (((outpars[i] == '-') || (outpars[i] == '+')) && ((outpars[i+1] == '-') || (outpars[i+1] == '+'))) + { + // someones playing silly buggers and trying + // to put a +- or -+ into the line... + i++; + } + } + if (i == strlen(outpars)-1) + { + if ((outpars[i] == '-') || (outpars[i] == '+')) + { + i++; + } + } + } + + z = strlen(b)-1; + if ((b[z] == '-') || (b[z] == '+')) + b[z] == '\0'; + + if ((!strcmp(b,"+")) || (!strcmp(b,"-"))) + return; + + WriteTo(user, dest, "MODE %s :%s", dest->nick, b); + } + return; + } + + Ptr = FindChan(parameters[0]); + if (Ptr) + { + if (pcnt == 1) + { + /* just /modes #channel */ + WriteServ(user->fd,"324 %s %s +%s",user->nick, Ptr->name, chanmodes(Ptr)); + WriteServ(user->fd,"329 %s %s %d", user->nick, Ptr->name, Ptr->created); + return; + } + else + if (pcnt == 2) + { + if ((!strcmp(parameters[1],"+b")) || (!strcmp(parameters[1],"b"))) + { + + for (BanList::iterator i = Ptr->bans.begin(); i != Ptr->bans.end(); i++) + { + WriteServ(user->fd,"367 %s %s %s %s %d",user->nick, Ptr->name, i->data, i->set_by, i->set_time); + } + WriteServ(user->fd,"368 %s %s :End of channel ban list",user->nick, Ptr->name); + } + } + + if ((cstatus(user,Ptr) < STATUS_HOP) && (Ptr)) + { + WriteServ(user->fd,"482 %s %s :You must be at least a half-operator",user->nick, Ptr->name); + return; + } + + process_modes(parameters,user,Ptr,cstatus(user,Ptr),pcnt); + } + else + { + WriteServ(user->fd,"401 %s %s :No suck nick/channel",user->nick, parameters[0]); + } +} + +/* This function pokes and hacks at a parameter list like the following: + * + * PART #winbot, #darkgalaxy :m00! + * + * to turn it into a series of individual calls like this: + * + * PART #winbot :m00! + * PART #darkgalaxy :m00! + * + * The seperate calls are sent to a callback function provided by the caller + * (the caller will usually call itself recursively). The callback function + * must be a command handler. Calling this function on a line with no list causes + * no action to be taken. You must provide a starting and ending parameter number + * where the range of the list can be found, useful if you have a terminating + * parameter as above which is actually not part of the list, or parameters + * before the actual list as well. This code is used by many functions which + * can function as "one to list" (see the RFC) */ + +int loop_call(handlerfunc fn, char **parameters, int pcnt, userrec *u, int start, int end, int joins) +{ + char plist[MAXBUF]; + char *param; + char *pars[32]; + char blog[32][MAXBUF]; + char blog2[32][MAXBUF]; + int i = 0, j = 0, q = 0, total = 0, t = 0, t2 = 0, total2 = 0; + char keystr[MAXBUF]; + char moo[MAXBUF]; + + for (i = 0; i <32; i++) + strcpy(blog[i],""); + + for (i = 0; i <32; i++) + strcpy(blog2[i],""); + + strcpy(moo,""); + for (i = 0; i <10; i++) + { + if (!parameters[i]) + { + parameters[i] = moo; + } + } + if (joins) + { + if (pcnt > 1) /* we have a key to copy */ + { + strcpy(keystr,parameters[1]); + } + } + + if (!parameters[start]) + { + return 0; + } + if (!strchr(parameters[start],',')) + { + return 0; + } + strcpy(plist,""); + for (i = start; i <= end; i++) + { + if (parameters[i]) + { + strcat(plist,parameters[i]); + } + } + + j = 0; + param = plist; + + t = strlen(plist); + for (i = 0; i < t; i++) + { + if (plist[i] == ',') + { + plist[i] = '\0'; + strcpy(blog[j++],param); + param = plist+i+1; + } + } + strcpy(blog[j++],param); + total = j; + + if ((joins) && (keystr) && (total>0)) // more than one channel and is joining + { + strcat(keystr,","); + } + + if ((joins) && (keystr)) + { + if (strchr(keystr,',')) + { + j = 0; + param = keystr; + t2 = strlen(keystr); + for (i = 0; i < t2; i++) + { + if (keystr[i] == ',') + { + keystr[i] = '\0'; + strcpy(blog2[j++],param); + param = keystr+i+1; + } + } + strcpy(blog2[j++],param); + total2 = j; + } + } + + for (j = 0; j < total; j++) + { + if (blog[j]) + { + pars[0] = blog[j]; + } + for (q = end; q < pcnt-1; q++) + { + if (parameters[q+1]) + { + pars[q-end+1] = parameters[q+1]; + } + } + if ((joins) && (parameters[1])) + { + if (pcnt > 1) + { + pars[1] = blog2[j]; + } + else + { + pars[1] = NULL; + } + } + /* repeatedly call the function with the hacked parameter list */ + if ((joins) && (pcnt > 1)) + { + if (pars[1]) + { + // pars[1] already set up and containing key from blog2[j] + fn(pars,2,u); + } + else + { + pars[1] = parameters[1]; + fn(pars,2,u); + } + } + else + { + fn(pars,pcnt-(end-start),u); + } + } + + return 1; +} + +void handle_join(char **parameters, int pcnt, userrec *user) +{ + chanrec* Ptr; + int i = 0; + + if (loop_call(handle_join,parameters,pcnt,user,0,0,1)) + return; + if (parameters[0][0] == '#') + { + Ptr = add_channel(user,parameters[0],parameters[1]); + } +} + + +void handle_part(char **parameters, int pcnt, userrec *user) +{ + chanrec* Ptr; + + if (pcnt > 1) + { + if (loop_call(handle_part,parameters,pcnt,user,0,pcnt-2,0)) + return; + del_channel(user,parameters[0],parameters[1]); + } + else + { + if (loop_call(handle_part,parameters,pcnt,user,0,pcnt-1,0)) + return; + del_channel(user,parameters[0],NULL); + } +} + +void handle_kick(char **parameters, int pcnt, userrec *user) +{ + chanrec* Ptr = FindChan(parameters[0]); + userrec* u = Find(parameters[1]); + + if ((!u) || (!Ptr)) + { + WriteServ(user->fd,"401 %s %s :No suck nick/channel",user->nick, parameters[0]); + return; + } + + if (!has_channel(u,Ptr)) + { + WriteServ(user->fd,"442 %s %s :You're not on that channel!",user->nick, parameters[0]); + return; + } + + if (pcnt > 2) + { + kick_channel(user,u,Ptr,parameters[2]); + } + else + { + kick_channel(user,u,Ptr,user->nick); + } +} + + +void handle_die(char **parameters, int pcnt, userrec *user) +{ + debug("die: %s",user->nick); + if (!strcmp(parameters[0],diepass)) + { + WriteOpers("*** DIE command from %s!%s@%s, terminating...",user->nick,user->ident,user->host); + sleep(DieDelay); + Exit(ERROR); + } + else + { + WriteOpers("*** Failed DIE Command from %s!%s@%s.",user->nick,user->ident,user->host); + } +} + +void handle_restart(char **parameters, int pcnt, userrec *user) +{ + debug("restart: %s",user->nick); + if (!strcmp(parameters[0],restartpass)) + { + WriteOpers("*** RESTART command from %s!%s@%s, Pretending to restart till this is finished :D",user->nick,user->ident,user->host); + sleep(DieDelay); + Exit(ERROR); + /* Will finish this later when i can be arsed :) */ + } + else + { + WriteOpers("*** Failed RESTART Command from %s!%s@%s.",user->nick,user->ident,user->host); + } +} + + +void kill_link(userrec *user,char* reason) +{ + user_hash::iterator iter = clientlist.find(user->nick); + + debug("kill_link: %s '%s'",user->nick,reason); + Write(user->fd,"ERROR :Closing link (%s@%s) [%s]",user->ident,user->host,reason); + fdatasync(user->fd); + WriteOpers("*** Client exiting: %s!%s@%s [%s]",user->nick,user->ident,user->host,reason); + FOREACH_MOD OnUserQuit(user); + debug("closing fd %d",user->fd); + /* bugfix, cant close() a nonblocking socket (sux!) */ + WriteCommonExcept(user,"QUIT :%s",reason); + Blocking(user->fd); + close(user->fd); + NonBlocking(user->fd); + + if (iter != clientlist.end()) + { + debug("deleting user hash value %p",iter->second); + delete iter->second; + clientlist.erase(iter); + } + + purge_empty_chans(); +} + + +void handle_kill(char **parameters, int pcnt, userrec *user) +{ + userrec *u = Find(parameters[0]); + char killreason[MAXBUF]; + + debug("kill: %s %s",parameters[0],parameters[1]); + if (u) + { + WriteOpers("*** Local Kill by %s: %s!%s@%s (%s)",user->nick,u->nick,u->ident,u->host,parameters[1]); + sprintf(killreason,"Killed (%s (%s))",user->nick,parameters[1]); + kill_link(u,killreason); + } + else + { + WriteServ(user->fd,"401 %s %s :No suck nick/channel",user->nick, parameters[0]); + } +} + +void handle_summon(char **parameters, int pcnt, userrec *user) +{ + WriteServ(user->fd,"445 %s :SUMMON has been disabled (depreciated command)",user->nick); +} + +void handle_users(char **parameters, int pcnt, userrec *user) +{ + WriteServ(user->fd,"445 %s :USERS has been disabled (depreciated command)",user->nick); +} + + +// looks up a users password for their connection class (<ALLOW>/<DENY> tags) + +char* Passwd(userrec *user) +{ + for (ClassVector::iterator i = Classes.begin(); i != Classes.end(); i++) + { + if (match(user->host,i->host) && (i->type == CC_ALLOW)) + { + return i->pass; + } + } + return ""; +} + +bool IsDenied(userrec *user) +{ + for (ClassVector::iterator i = Classes.begin(); i != Classes.end(); i++) + { + if (match(user->host,i->host) && (i->type == CC_DENY)) + { + return true; + } + } + return false; +} + + +void handle_pass(char **parameters, int pcnt, userrec *user) +{ + if (!strcasecmp(parameters[0],Passwd(user))) + { + user->haspassed = true; + } +} + +void handle_invite(char **parameters, int pcnt, userrec *user) +{ + userrec* u = Find(parameters[0]); + chanrec* c = FindChan(parameters[1]); + + if ((!c) || (!u)) + { + if (!c) + { + WriteServ(user->fd,"401 %s %s :No suck nick/channel",user->nick, parameters[1]); + } + else + { + if (c->inviteonly) + { + WriteServ(user->fd,"401 %s %s :No such nick/channel",user->nick, parameters[0]); + } + } + + return; + } + + if (c->inviteonly) + { + if (cstatus(user,c) < STATUS_HOP) + { + WriteServ(user->fd,"482 %s %s :You must be at least a half-operator",user->nick, c->name); + return; + } + + u->InviteTo(c->name); + WriteFrom(u->fd,user,"INVITE %s :%s",u->nick,c->name); + WriteServ(user->fd,"341 %s %s %s",user->nick,u->nick,c->name); + } +} + +void handle_topic(char **parameters, int pcnt, userrec *user) +{ + chanrec* Ptr; + + if (pcnt == 1) + { + if (strlen(parameters[0]) <= CHANMAX) + { + Ptr = FindChan(parameters[0]); + if (Ptr) + { + if (Ptr->topicset) + { + WriteServ(user->fd,"332 %s %s :%s", user->nick, Ptr->name, Ptr->topic); + WriteServ(user->fd,"333 %s %s %s %d", user->nick, Ptr->name, Ptr->setby, Ptr->topicset); + } + else + { + WriteServ(user->fd,"331 %s %s :No topic is set.", user->nick, Ptr->name); + } + } + else + { + WriteServ(user->fd,"331 %s %s :No topic is set.", user->nick, Ptr->name); + } + } + } + else if (pcnt>1) + { + if (loop_call(handle_topic,parameters,pcnt,user,0,pcnt-2,0)) + return; + if (strlen(parameters[0]) <= CHANMAX) + { + Ptr = FindChan(parameters[0]); + if (Ptr) + { + if ((Ptr->topiclock) && (cstatus(user,Ptr)<STATUS_HOP)) + { + WriteServ(user->fd,"482 %s %s :You must be at least a half-operator", user->nick, Ptr->name); + return; + } + strcpy(Ptr->topic,parameters[1]); + strcpy(Ptr->setby,user->nick); + Ptr->topicset = time(NULL); + WriteChannel(Ptr,user,"TOPIC %s :%s",Ptr->name, Ptr->topic); + } + else + { + WriteServ(user->fd,"401 %s %s :No suck nick/channel",user->nick, parameters[0]); + } + } + } +} + +/* sends out an error notice to all connected clients (not to be used + * lightly!) */ + +void send_error(char *s) +{ + debug("send_error: %s",s); + for (user_hash::const_iterator i = clientlist.begin(); i != clientlist.end(); i++) + { + WriteServ(i->second->fd,"NOTICE %s :%s",i->second->nick,s); + } +} + +void Error(int status) +{ + signal (SIGALRM, SIG_IGN); + signal (SIGPIPE, SIG_IGN); + signal (SIGTERM, SIG_IGN); + signal (SIGABRT, SIG_IGN); + signal (SIGSEGV, SIG_IGN); + signal (SIGURG, SIG_IGN); + signal (SIGKILL, SIG_IGN); + debug("*** fell down a pothole in the road to perfection ***"); + send_error("Error! Segmentation fault! save meeeeeeeeeeeeee *splat!*"); + exit(status); +} + +int main (int argc, char *argv[]) +{ + Start(); + debug("*** InspIRCd starting up!"); + if (!CheckConfig()) + { + debug("main: no config"); + printf("ERROR: Your config file is missing, this IRCd will self destruct in 10 seconds!\n"); + Exit(ERROR); + } + if (InspIRCd() == ERROR) + { + debug("main: daemon function bailed"); + printf("ERROR: could not initialise. Shutting down.\n"); + Exit(ERROR); + } + Exit(TRUE); + return 0; +} + +template<typename T> inline string ConvToStr(const T &in) +{ + stringstream tmp; + if (!(tmp << in)) return string(); + return tmp.str(); +} + +/* re-allocates a nick in the user_hash after they change nicknames, + * returns a pointer to the new user as it may have moved */ + +userrec* ReHashNick(char* Old, char* New) +{ + user_hash::iterator newnick; + user_hash::iterator oldnick = clientlist.find(Old); + + debug("ReHashNick: %s %s",Old,New); + + if (!strcasecmp(Old,New)) + { + debug("old nick is new nick, skipping"); + return oldnick->second; + } + + if (oldnick == clientlist.end()) return NULL; /* doesnt exist */ + + debug("ReHashNick: Found hashed nick %s",Old); + + clientlist[New] = new userrec(); + clientlist[New] = oldnick->second; + /*delete oldnick->second; */ + clientlist.erase(oldnick); + + debug("ReHashNick: Nick rehashed as %s",New); + + return clientlist[New]; +} + + +/* add a client connection to the sockets list */ +void AddClient(int socket, char* host, int port, bool iscached) +{ + int i; + int blocking = 1; + char resolved[MAXBUF]; + string tempnick; + char tn2[MAXBUF]; + user_hash::iterator iter; + + tempnick = ConvToStr(socket) + "-unknown"; + sprintf(tn2,"%d-unknown",socket); + + iter = clientlist.find(tempnick); + + if (iter != clientlist.end()) return; + + /* + * It is OK to access the value here this way since we know + * it exists, we just created it above. + * + * At NO other time should you access a value in a map or a + * hash_map this way. + */ + clientlist[tempnick] = new userrec(); + + NonBlocking(socket); + debug("AddClient: %d %s %d",socket,host,port); + + + clientlist[tempnick]->fd = socket; + strncpy(clientlist[tempnick]->nick, tn2,NICKMAX); + strncpy(clientlist[tempnick]->host, host,160); + strncpy(clientlist[tempnick]->dhost, host,160); + strncpy(clientlist[tempnick]->server, ServerName,256); + clientlist[tempnick]->registered = 0; + clientlist[tempnick]->signon = time(NULL); + clientlist[tempnick]->nping = time(NULL)+240; + clientlist[tempnick]->lastping = 1; + clientlist[tempnick]->port = port; + + if (iscached) + { + WriteServ(socket,"NOTICE Auth :Found your hostname (cached)..."); + } + else + { + WriteServ(socket,"NOTICE Auth :Looking up your hostname..."); + } + + if (clientlist.size() == MAXCLIENTS) + kill_link(clientlist[tempnick],"No more connections allowed in this class"); +} + +void handle_names(char **parameters, int pcnt, userrec *user) +{ + chanrec* c; + + if (loop_call(handle_names,parameters,pcnt,user,0,pcnt-1,0)) + return; + c = FindChan(parameters[0]); + if (c) + { + /*WriteServ(user->fd,"353 %s = %s :%s", user->nick, c->name,*/ + userlist(user,c); + WriteServ(user->fd,"366 %s %s :End of /NAMES list.", user->nick, c->name); + } + else + { + WriteServ(user->fd,"401 %s %s :No suck nick/channel",user->nick, parameters[0]); + } +} + + +void handle_privmsg(char **parameters, int pcnt, userrec *user) +{ + userrec *dest; + chanrec *chan; + + if (loop_call(handle_privmsg,parameters,pcnt,user,0,pcnt-2,0)) + return; + if (parameters[0][0] == '#') + { + chan = FindChan(parameters[0]); + if (chan) + { + if ((chan->noexternal) && (!has_channel(user,chan))) + { + WriteServ(user->fd,"404 %s %s :Cannot send to channel (no external messages)", user->nick, chan->name); + return; + } + if ((chan->moderated) && (cstatus(user,chan)<STATUS_VOICE)) + { + WriteServ(user->fd,"404 %s %s :Cannot send to channel (+m)", user->nick, chan->name); + return; + } + ChanExceptSender(chan, user, "PRIVMSG %s :%s", chan->name, parameters[1]); + } + else + { + /* no such nick/channel */ + WriteServ(user->fd,"401 %s %s :No suck nick/channel",user->nick, parameters[0]); + } + return; + } + + dest = Find(parameters[0]); + if (dest) + { + if (strcmp(dest->awaymsg,"")) + { + /* auto respond with aweh msg */ + WriteServ(user->fd,"301 %s %s :%s",user->nick,dest->nick,dest->awaymsg); + } + WriteTo(user, dest, "PRIVMSG %s :%s", dest->nick, parameters[1]); + } + else + { + /* no such nick/channel */ + WriteServ(user->fd,"401 %s %s :No suck nick/channel",user->nick, parameters[0]); + } +} + +void handle_notice(char **parameters, int pcnt, userrec *user) +{ + userrec *dest; + chanrec *chan; + + if (loop_call(handle_notice,parameters,pcnt,user,0,pcnt-2,0)) + return; + if (parameters[0][0] == '#') + { + chan = FindChan(parameters[0]); + if (chan) + { + if ((chan->noexternal) && (!has_channel(user,chan))) + { + WriteServ(user->fd,"404 %s %s :Cannot send to channel (no external messages)", user->nick, chan->name); + return; + } + if ((chan->moderated) && (cstatus(user,chan)<STATUS_VOICE)) + { + WriteServ(user->fd,"404 %s %s :Cannot send to channel (+m)", user->nick, chan->name); + return; + } + WriteChannel(chan, user, "NOTICE %s :%s", chan->name, parameters[1]); + } + else + { + /* no such nick/channel */ + WriteServ(user->fd,"401 %s %s :No suck nick/channel",user->nick, parameters[0]); + } + return; + } + + dest = Find(parameters[0]); + if (dest) + { + WriteTo(user, dest, "NOTICE %s :%s", dest->nick, parameters[1]); + } + else + { + /* no such nick/channel */ + WriteServ(user->fd,"401 %s %s :No suck nick/channel",user->nick, parameters[0]); + } +} + +char lst[MAXBUF]; + +char* chlist(userrec *user) +{ + int i = 0; + char cmp[MAXBUF]; + + debug("chlist: %s",user->nick); + strcpy(lst,""); + if (!user) + { + return lst; + } + for (i = 0; i != MAXCHANS; i++) + { + if (user->chans[i].channel != NULL) + { + if (user->chans[i].channel->name) + { + strcpy(cmp,user->chans[i].channel->name); + strcat(cmp," "); + if (!strstr(lst,cmp)) + { + if ((!user->chans[i].channel->c_private) && (!user->chans[i].channel->secret)) + { + strcat(lst,cmode(user,user->chans[i].channel)); + strcat(lst,user->chans[i].channel->name); + strcat(lst," "); + } + } + } + } + } + return lst; +} + +void handle_info(char **parameters, int pcnt, userrec *user) +{ + WriteServ(user->fd,"371 %s :The Inspire IRCd Project Has been brought to you by the following people..",user->nick); + WriteServ(user->fd,"371 %s :Craig Edwards, Craig McLure, and Others..",user->nick); + WriteServ(user->fd,"371 %s :Will finish this later when i can be arsed :p",user->nick); + WriteServ(user->fd,"374 %s :End of /INFO list",user->nick); +} + +void handle_time(char **parameters, int pcnt, userrec *user) +{ + time_t rawtime; + struct tm * timeinfo; + + time ( &rawtime ); + timeinfo = localtime ( &rawtime ); + WriteServ(user->fd,"391 %s %s :%s",user->nick,ServerName, asctime (timeinfo) ); + +} + +void handle_whois(char **parameters, int pcnt, userrec *user) +{ + userrec *dest; + char *t; + + if (loop_call(handle_whois,parameters,pcnt,user,0,pcnt-1,0)) + return; + dest = Find(parameters[0]); + if (dest) + { + WriteServ(user->fd,"311 %s %s %s %s * :%s",user->nick, dest->nick, dest->ident, dest->dhost, dest->fullname); + if ((user == dest) || (strchr(user->modes,'o'))) + { + WriteServ(user->fd,"378 %s %s :is connecting from *@%s",user->nick, dest->nick, dest->host); + } + if (strcmp(chlist(dest),"")) + { + WriteServ(user->fd,"319 %s %s :%s",user->nick, dest->nick, chlist(dest)); + } + WriteServ(user->fd,"312 %s %s %s :%s",user->nick, dest->nick, dest->server, ServerDesc); + if (strcmp(dest->awaymsg,"")) + { + WriteServ(user->fd,"301 %s %s :%s",user->nick, dest->nick, dest->awaymsg); + } + if (strchr(dest->modes,'o')) + { + WriteServ(user->fd,"313 %s %s :is an IRC operator",user->nick, dest->nick); + } + //WriteServ(user->fd,"310 %s %s :is available for help.",user->nick, dest->nick); + WriteServ(user->fd,"317 %s %s %d %d :seconds idle, signon time",user->nick, dest->nick, abs((dest->idle_lastmsg)-time(NULL)), dest->signon); + + WriteServ(user->fd,"318 %s %s :End of /WHOIS list.",user->nick, dest->nick); + } + else + { + /* no such nick/channel */ + WriteServ(user->fd,"401 %s %s :No suck nick/channel",user->nick, parameters[0]); + } +} + +void handle_quit(char **parameters, int pcnt, userrec *user) +{ + user_hash::iterator iter = clientlist.find(user->nick); + + /* theres more to do here, but for now just close the socket */ + if (pcnt == 1) + { + if (parameters[0][0] == ':') + { + *parameters[0]++; + } + Write(user->fd,"ERROR :Closing link (%s@%s) [%s]",user->ident,user->host,parameters[0]); + WriteOpers("*** Client exiting: %s!%s@%s [%s]",user->nick,user->ident,user->host,parameters[0]); + WriteCommonExcept(user,"QUIT :%s%s",PrefixQuit,parameters[0]); + } + else + { + Write(user->fd,"ERROR :Closing link (%s@%s) [QUIT]",user->ident,user->host); + WriteOpers("*** Client exiting: %s!%s@%s [Client exited]",user->nick,user->ident,user->host); + WriteCommonExcept(user,"QUIT :Client exited"); + } + + FOREACH_MOD OnUserQuit(user); + + /* confucious say, he who close nonblocking socket, get nothing! */ + Blocking(user->fd); + close(user->fd); + NonBlocking(user->fd); + + if (iter != clientlist.end()) + { + debug("deleting user hash value"); + delete iter->second; + clientlist.erase(iter); + } + + purge_empty_chans(); +} + +void handle_who(char **parameters, int pcnt, userrec *user) +{ + chanrec* Ptr; + + /* theres more to do here, but for now just close the socket */ + if (pcnt == 1) + { + if ((!strcmp(parameters[0],"0")) || (!strcmp(parameters[0],"*"))) + { + Ptr = user->chans[0].channel; + printf(user->chans[0].channel->name); + for (user_hash::const_iterator i = clientlist.begin(); i != clientlist.end(); i++) + { + if ((common_channels(user,i->second)) && (isnick(i->second->nick))) + { + WriteServ(user->fd,"352 %s %s %s %s %s %s Hr@ :0 %s",user->nick, Ptr->name, i->second->ident, i->second->dhost, ServerName, i->second->nick, i->second->fullname); + } + } + WriteServ(user->fd,"315 %s %s :End of /WHO list.",user->nick, Ptr->name); + return; + } + if (parameters[0][0] = '#') + { + Ptr = FindChan(parameters[0]); + if (Ptr) + { + for (user_hash::const_iterator i = clientlist.begin(); i != clientlist.end(); i++) + { + if ((has_channel(i->second,Ptr)) && (isnick(i->second->nick))) + { + WriteServ(user->fd,"352 %s %s %s %s %s %s Hr@ :0 %s",user->nick, Ptr->name, i->second->ident, i->second->dhost, ServerName, i->second->nick, i->second->fullname); + } + } + WriteServ(user->fd,"315 %s %s :End of /WHO list.",user->nick, Ptr->name); + } + else + { + WriteServ(user->fd,"401 %s %s :No suck nick/channel",user->nick, parameters[0]); + } + } + } + if (pcnt == 2) + { + if ((!strcmp(parameters[0],"0")) || (!strcmp(parameters[0],"*")) && (!strcmp(parameters[1],"o"))) + { + Ptr = user->chans[0].channel; + printf(user->chans[0].channel->name); + for (user_hash::const_iterator i = clientlist.begin(); i != clientlist.end(); i++) + { + if ((common_channels(user,i->second)) && (isnick(i->second->nick))) + { + if (strchr(i->second->modes,'o')) + { + WriteServ(user->fd,"352 %s %s %s %s %s %s Hr@ :0 %s",user->nick, Ptr->name, i->second->ident, i->second->dhost, ServerName, i->second->nick, i->second->fullname); + } + } + } + WriteServ(user->fd,"315 %s %s :End of /WHO list.",user->nick, Ptr->name); + return; + } + } +} + +void handle_wallops(char **parameters, int pcnt, userrec *user) +{ + WriteWallOps(user,"%s",parameters[0]); +} + +void handle_list(char **parameters, int pcnt, userrec *user) +{ + chanrec* Ptr; + + WriteServ(user->fd,"321 %s Channel :Users Name",user->nick); + for (chan_hash::const_iterator i = chanlist.begin(); i != chanlist.end(); i++) + { + if ((!i->second->c_private) && (!i->second->secret)) + { + WriteServ(user->fd,"322 %s %s %d :[+%s] %s",user->nick,i->second->name,usercount_i(i->second),chanmodes(i->second),i->second->topic); + } + } + WriteServ(user->fd,"323 %s :End of channel list.",user->nick); +} + + +void handle_rehash(char **parameters, int pcnt, userrec *user) +{ + WriteServ(user->fd,"382 %s %s :Rehashing",user->nick,CONFIG_FILE); + ReadConfig(); + WriteOpers("%s is rehashing config file %s",user->nick,CONFIG_FILE); +} + + +int usercnt(void) +{ + return clientlist.size(); +} + +int usercount_invisible(void) +{ + int c = 0; + + for (user_hash::const_iterator i = clientlist.begin(); i != clientlist.end(); i++) + { + if ((i->second->fd) && (isnick(i->second->nick)) && (strchr(i->second->modes,'i'))) c++; + } + return c; +} + +int usercount_opers(void) +{ + int c = 0; + + for (user_hash::const_iterator i = clientlist.begin(); i != clientlist.end(); i++) + { + if ((i->second->fd) && (isnick(i->second->nick)) && (strchr(i->second->modes,'o'))) c++; + } + return c; +} + +int usercount_unknown(void) +{ + int c = 0; + + for (user_hash::const_iterator i = clientlist.begin(); i != clientlist.end(); i++) + { + if ((i->second->fd) && (i->second->registered != 7)) + c++; + } + return c; +} + +int chancount(void) +{ + return chanlist.size(); +} + +int servercount(void) +{ + return 1; +} + +void handle_lusers(char **parameters, int pcnt, userrec *user) +{ + WriteServ(user->fd,"251 %s :There are %d users and %d invisible on %d servers",user->nick,usercnt()-usercount_invisible(),usercount_invisible(),servercount()); + WriteServ(user->fd,"252 %s %d :operator(s) online",user->nick,usercount_opers()); + WriteServ(user->fd,"253 %s %d :unknown connections",user->nick,usercount_unknown()); + WriteServ(user->fd,"254 %s %d :channels formed",user->nick,chancount()); + WriteServ(user->fd,"254 %s :I have %d clients and 0 servers",user->nick,usercnt()); +} + +void handle_admin(char **parameters, int pcnt, userrec *user) +{ + WriteServ(user->fd,"256 %s :Administrative info for %s",user->nick,ServerName); + WriteServ(user->fd,"257 %s :Name - %s",user->nick,AdminName); + WriteServ(user->fd,"258 %s :Nickname - %s",user->nick,AdminNick); + WriteServ(user->fd,"258 %s :E-Mail - %s",user->nick,AdminEmail); +} + +void ShowMOTD(userrec *user) +{ + if (!MOTD.size()) + { + WriteServ(user->fd,"422 %s :Message of the day file is missing.",user->nick); + return; + } + WriteServ(user->fd,"375 %s :- %s message of the day",user->nick,ServerName); + for (int i = 0; i != MOTD.size(); i++) + { + WriteServ(user->fd,"372 %s :- %s",user->nick,MOTD[i].c_str()); + } + WriteServ(user->fd,"376 %s :End of %s message of the day.",user->nick,ServerName); +} + +void ShowRULES(userrec *user) +{ + if (!RULES.size()) + { + WriteServ(user->fd,"NOTICE %s :Rules file is missing.",user->nick); + return; + } + WriteServ(user->fd,"NOTICE %s :%s rules",user->nick,ServerName); + for (int i = 0; i != RULES.size(); i++) + { + WriteServ(user->fd,"NOTICE %s :%s",user->nick,RULES[i].c_str()); + } + WriteServ(user->fd,"NOTICE %s :End of %s rules.",user->nick,ServerName); +} + +/* shows the message of the day, and any other on-logon stuff */ +void ConnectUser(userrec *user) +{ + user->registered = 7; + user->idle_lastmsg = time(NULL); + debug("ConnectUser: %s",user->nick); + + if (strcmp(Passwd(user),"") && (!user->haspassed)) + { + Write(user->fd,"ERROR :Closing link: Invalid password"); + fdatasync(user->fd); + kill_link(user,"Invalid password"); + return; + } + if (IsDenied(user)) + { + Write(user->fd,"ERROR :Closing link: Unauthorized connection"); + fdatasync(user->fd); + kill_link(user,"Unauthorised connection"); + } + + WriteServ(user->fd,"NOTICE Auth :Welcome to \002%s\002!",Network); + WriteServ(user->fd,"001 %s :Welcome to the %s IRC Network %s!%s@%s",user->nick,Network,user->nick,user->ident,user->host); + WriteServ(user->fd,"002 %s :Your host is %s, running version %s",user->nick,ServerName,VERSION); + WriteServ(user->fd,"003 %s :This server was created %s %s",user->nick,__TIME__,__DATE__); + WriteServ(user->fd,"004 %s :%s %s iowghraAsORVSxNCWqBzvdHtGI lvhopsmntikrRcaqOALQbSeKVfHGCuzN",user->nick,ServerName,VERSION); + WriteServ(user->fd,"005 %s :MAP KNOCK SAFELIST HCN MAXCHANNELS=20 MAXBANS=60 NICKLEN=30 TOPICLEN=307 KICKLEN=307 MAXTARGETS=20 AWAYLEN=307 :are supported by this server",user->nick); + WriteServ(user->fd,"005 %s :WALLCHOPS WATCH=128 SILENCE=5 MODES=13 CHANTYPES=# PREFIX=(ohv)@%c+ CHANMODES=ohvbeqa,kfL,l,psmntirRcOAQKVHGCuzN NETWORK=%s :are supported by this server",user->nick,'%',Network); + ShowMOTD(user); + FOREACH_MOD OnUserConnect(user); + WriteOpers("*** Client connecting on port %d: %s!%s@%s",user->port,user->nick,user->ident,user->host); +} + +void handle_version(char **parameters, int pcnt, userrec *user) +{ + WriteServ(user->fd,"351 %s :%s %s :%s",user->nick,VERSION,ServerName,SYSTEM); +} + +void handle_ping(char **parameters, int pcnt, userrec *user) +{ + WriteServ(user->fd,"PONG %s :%s",ServerName,parameters[0]); +} + +void handle_pong(char **parameters, int pcnt, userrec *user) +{ + // set the user as alive so they survive to next ping + user->lastping = 1; +} + +void handle_motd(char **parameters, int pcnt, userrec *user) +{ + ShowMOTD(user); +} + +void handle_rules(char **parameters, int pcnt, userrec *user) +{ + ShowRULES(user); +} + +void handle_user(char **parameters, int pcnt, userrec *user) +{ + if (user->registered < 3) + { + WriteServ(user->fd,"NOTICE Auth :No ident response, ident prefixed with ~"); + strcpy(user->ident,"~"); /* we arent checking ident... but these days why bother anyway? */ + strncat(user->ident,parameters[0],IDENTMAX); + strncpy(user->fullname,parameters[3],128); + user->registered = (user->registered | 1); + } + else + { + WriteServ(user->fd,"462 %s :You may not reregister",user->nick); + return; + } + /* parameters 2 and 3 are local and remote hosts, ignored when sent by client connection */ + if (user->registered == 3) + { + /* user is registered now, bit 0 = USER command, bit 1 = sent a NICK command */ + ConnectUser(user); + } +} + +void handle_userhost(char **parameters, int pcnt, userrec *user) +{ + char Return[MAXBUF],junk[MAXBUF]; + sprintf(Return,"302 %s :",user->nick); + for (int i = 0; i < pcnt; i++) + { + userrec *u = Find(parameters[i]); + if (u) + { + if (strchr(u->modes,'o')) + { + sprintf(junk,"%s*=+%s@%s ",u->nick,u->ident,u->host); + strcat(Return,junk); + } + else + { + sprintf(junk,"%s=+%s@%s ",u->nick,u->ident,u->host); + strcat(Return,junk); + } + } + } + WriteServ(user->fd,Return); +} + + +void handle_ison(char **parameters, int pcnt, userrec *user) +{ + char Return[MAXBUF]; + sprintf(Return,"303 %s :",user->nick); + for (int i = 0; i < pcnt; i++) + { + userrec *u = Find(parameters[i]); + if (u) + { + strcat(Return,u->nick); + strcat(Return," "); + } + } + WriteServ(user->fd,Return); +} + + +void handle_away(char **parameters, int pcnt, userrec *user) +{ + if (pcnt) + { + strcpy(user->awaymsg,parameters[0]); + WriteServ(user->fd,"306 %s :You have been marked as being away",user->nick); + } + else + { + strcpy(user->awaymsg,""); + WriteServ(user->fd,"305 %s :You are no longer marked as being away",user->nick); + } +} + + +void handle_trace(char **parameters, int pcnt, userrec *user) +{ + for (user_hash::iterator i = clientlist.begin(); i != clientlist.end(); i++) + { + if (i->second) + { + if (isnick(i->second->nick)) + { + if (strchr(i->second->modes,'o')) + { + WriteServ(user->fd,"205 %s :Oper 0 %s",user->nick,i->second->nick); + } + else + { + WriteServ(user->fd,"204 %s :User 0 %s",user->nick,i->second->nick); + } + } + else + { + WriteServ(user->fd,"203 %s :???? 0 [%s]",user->nick,i->second->host); + } + } + } +} + +void handle_stats(char **parameters, int pcnt, userrec *user) +{ + if (pcnt != 1) + { + return; + } + if (strlen(parameters[0])>1) + { + /* make the stats query 1 character long */ + parameters[0][1] = '\0'; + } + + /* stats m (list number of times each command has been used, plus bytecount) */ + if (!strcasecmp(parameters[0],"m")) + { + for (int i = 0; i < cmdlist.size(); i++) + { + if (cmdlist[i].handler_function) + { + if (cmdlist[i].use_count) + { + /* RPL_STATSCOMMANDS */ + WriteServ(user->fd,"212 %s %s %d %d",user->nick,cmdlist[i].command,cmdlist[i].use_count,cmdlist[i].total_bytes); + } + } + } + + } + + /* stats z (debug and memory info) */ + if (!strcasecmp(parameters[0],"z")) + { + WriteServ(user->fd,"249 %s :Users(HASH_MAP) %d (%d bytes, %d buckets)",user->nick,clientlist.size(),clientlist.size()*sizeof(userrec),clientlist.bucket_count()); + WriteServ(user->fd,"249 %s :Channels(HASH_MAP) %d (%d bytes, %d buckets)",user->nick,chanlist.size(),chanlist.size()*sizeof(chanrec),chanlist.bucket_count()); + WriteServ(user->fd,"249 %s :Commands(VECTOR) %d (%d bytes)",user->nick,cmdlist.size(),cmdlist.size()*sizeof(command_t)); + WriteServ(user->fd,"249 %s :MOTD(VECTOR) %d, RULES(VECTOR) %d",user->nick,MOTD.size(),RULES.size()); + WriteServ(user->fd,"249 %s :address_cache(HASH_MAP) %d (%d buckets)",user->nick,IP.size(),IP.bucket_count()); + WriteServ(user->fd,"249 %s :Modules(VECTOR) %d (%d)",user->nick,modules.size(),modules.size()*sizeof(Module)); + WriteServ(user->fd,"249 %s :ClassFactories(VECTOR) %d (%d)",user->nick,factory.size(),factory.size()*sizeof(ircd_module)); + WriteServ(user->fd,"249 %s :Ports(STATIC_ARRAY) %d",user->nick,boundPortCount); + } + + /* stats o */ + if (!strcasecmp(parameters[0],"o")) + { + for (int i = 0; i < ConfValueEnum("oper"); i++) + { + char LoginName[MAXBUF]; + char HostName[MAXBUF]; + char OperType[MAXBUF]; + ConfValue("oper","name",i,LoginName); + ConfValue("oper","host",i,HostName); + ConfValue("oper","type",i,OperType); + WriteServ(user->fd,"243 %s O %s * %s %s 0",user->nick,HostName,LoginName,OperType); + } + } + + /* stats l (show user I/O stats) */ + if (!strcasecmp(parameters[0],"l")) + { + WriteServ(user->fd,"211 %s :server:port nick bytes_in cmds_in bytes_out cmds_out",user->nick); + for (user_hash::iterator i = clientlist.begin(); i != clientlist.end(); i++) + { + if (isnick(i->second->nick)) + { + WriteServ(user->fd,"211 %s :%s:%d %s %d %d %d %d",user->nick,ServerName,i->second->port,i->second->nick,i->second->bytes_in,i->second->cmds_in,i->second->bytes_out,i->second->cmds_out); + } + else + { + WriteServ(user->fd,"211 %s :%s:%d (unknown@%d) %d %d %d %d",user->nick,ServerName,i->second->port,i->second->fd,i->second->bytes_in,i->second->cmds_in,i->second->bytes_out,i->second->cmds_out); + } + + } + } + + /* stats u (show server uptime) */ + if (!strcasecmp(parameters[0],"u")) + { + time_t current_time = 0; + current_time = time(NULL); + time_t server_uptime = current_time - startup_time; + struct tm* stime; + stime = gmtime(&server_uptime); + /* i dont know who the hell would have an ircd running for over a year nonstop, but + * Craig suggested this, and it seemed a good idea so in it went */ + if (stime->tm_year > 70) + { + WriteServ(user->fd,"242 %s :Server up %d years, %d days, %.2d:%.2d:%.2d",user->nick,(stime->tm_year-70),stime->tm_yday,stime->tm_hour,stime->tm_min,stime->tm_sec); + } + else + { + WriteServ(user->fd,"242 %s :Server up %d days, %.2d:%.2d:%.2d",user->nick,stime->tm_yday,stime->tm_hour,stime->tm_min,stime->tm_sec); + } + } + + WriteServ(user->fd,"219 %s %s :End of /STATS report",user->nick,parameters[0]); + WriteOpers("*** Notice: Stats '%s' requested by %s (%s@%s)",parameters[0],user->nick,user->ident,user->host); + +} + +void handle_oper(char **parameters, int pcnt, userrec *user) +{ + char LoginName[MAXBUF]; + char Password[MAXBUF]; + char OperType[MAXBUF]; + char TypeName[MAXBUF]; + char Hostname[MAXBUF]; + int i,j; + + for (i = 0; i < ConfValueEnum("oper"); i++) + { + ConfValue("oper","name",i,LoginName); + ConfValue("oper","password",i,Password); + if ((!strcmp(LoginName,parameters[0])) && (!strcmp(Password,parameters[1]))) + { + /* correct oper credentials */ + ConfValue("oper","type",i,OperType); + WriteOpers("*** %s (%s@%s) is now an IRC operator of type %s",user->nick,user->ident,user->host,OperType); + WriteServ(user->fd,"381 %s :You are now an IRC operator of type %s",user->nick,OperType); + WriteServ(user->fd,"MODE %s :+o",user->nick); + for (j =0; j < ConfValueEnum("type"); j++) + { + ConfValue("type","name",j,TypeName); + if (!strcmp(TypeName,OperType)) + { + /* found this oper's opertype */ + ConfValue("type","host",j,Hostname); + strncpy(user->dhost,Hostname,256); + } + } + if (!strchr(user->modes,'o')) + { + strcat(user->modes,"o"); + } + return; + } + } + /* no such oper */ + WriteServ(user->fd,"491 %s :Invalid oper credentials",user->nick); + WriteOpers("*** WARNING! Failed oper attempt by %s!%s@%s!",user->nick,user->ident,user->host); +} + +void handle_nick(char **parameters, int pcnt, userrec *user) +{ + if (pcnt < 1) + { + debug("not enough params for handle_nick"); + return; + } + if (!parameters[0]) + { + debug("invalid parameter passed to handle_nick"); + return; + } + if (!strlen(parameters[0])) + { + debug("zero length new nick passed to handle_nick"); + return; + } + if (!user) + { + debug("invalid user passed to handle_nick"); + return; + } + if (!user->nick) + { + debug("invalid old nick passed to handle_nick"); + return; + } + if (!strcasecmp(user->nick,parameters[0])) + { + debug("old nick is new nick, skipping"); + return; + } + else + { + if (strlen(parameters[0]) > 1) + { + if (parameters[0][0] == ':') + { + *parameters[0]++; + } + } + if ((Find(parameters[0])) && (Find(parameters[0]) != user)) + { + WriteServ(user->fd,"433 %s %s :Nickname is already in use.",user->nick,parameters[0]); + return; + } + } + if (isnick(parameters[0]) == 0) + { + WriteServ(user->fd,"432 %s %s :Erroneous Nickname",user->nick,parameters[0]); + return; + } + + if (user->registered == 7) + { + WriteCommon(user,"NICK %s",parameters[0]); + } + + /* change the nick of the user in the users_hash */ + user = ReHashNick(user->nick, parameters[0]); + /* actually change the nick within the record */ + if (!user) return; + if (!user->nick) return; + + strncpy(user->nick, parameters[0],NICKMAX); + + debug("new nick set: %s",user->nick); + + if (user->registered < 3) + user->registered = (user->registered | 2); + if (user->registered == 3) + { + /* user is registered now, bit 0 = USER command, bit 1 = sent a NICK command */ + ConnectUser(user); + } + debug("exit nickchange: %s",user->nick); +} + +int process_parameters(char **command_p,char *parameters) +{ + int i = 0; + int j = 0; + int q = 0; + q = strlen(parameters); + if (!q) + { + /* no parameters, command_p invalid! */ + return 0; + } + if (parameters[0] == ':') + { + command_p[0] = parameters+1; + return 1; + } + if (q) + { + if ((strchr(parameters,' ')==NULL) || (parameters[0] == ':')) + { + /* only one parameter */ + command_p[0] = parameters; + if (parameters[0] == ':') + { + if (strchr(parameters,' ') != NULL) + { + command_p[0]++; + } + } + return 1; + } + } + command_p[j++] = parameters; + for (i = 0; i <= q; i++) + { + if (parameters[i] == ' ') + { + command_p[j++] = parameters+i+1; + parameters[i] = '\0'; + if (command_p[j-1][0] == ':') + { + *command_p[j-1]++; /* remove dodgy ":" */ + break; + /* parameter like this marks end of the sequence */ + } + } + } + return j; /* returns total number of items in the list */ +} + +void process_command(userrec *user, char* cmd) +{ + char *parameters; + char *command; + char *command_p[127]; + char p[MAXBUF], temp[MAXBUF]; + int i, j, items, cmd_found; + + for (int i = 0; i < 127; i++) + command_p[i] = NULL; + + if (!user) + { + return; + } + if (!cmd) + { + return; + } + if (!strcmp(cmd,"")) + { + return; + } + strcpy(temp,cmd); + if (!strchr(cmd,' ')) + { + /* no parameters, lets skip the formalities and not chop up + * the string */ + items = 0; + command_p[0] = NULL; + parameters = NULL; + for (int i = 0; i <= strlen(cmd); i++) + { + cmd[i] = toupper(cmd[i]); + } + } + else + { + strcpy(cmd,""); + j = 0; + /* strip out extraneous linefeeds through mirc's crappy pasting (thanks Craig) */ + for (i = 0; i < strlen(temp); i++) + { + if ((temp[i] != 10) && (temp[i] != 13) && (temp[i] != 0) && (temp[i] != 7)) + { + cmd[j++] = temp[i]; + cmd[j] = 0; + } + } + /* split the full string into a command plus parameters */ + parameters = p; + strcpy(p," "); + command = cmd; + if (strchr(cmd,' ')) + { + for (i = 0; i <= strlen(cmd); i++) + { + /* capitalise the command ONLY, leave params intact */ + cmd[i] = toupper(cmd[i]); + /* are we nearly there yet?! :P */ + if (cmd[i] == ' ') + { + command = cmd; + parameters = cmd+i+1; + cmd[i] = '\0'; + break; + } + } + } + else + { + for (i = 0; i <= strlen(cmd); i++) + { + cmd[i] = toupper(cmd[i]); + } + } + + } + + cmd_found = 0; + + for (i = 0; i != cmdlist.size(); i++) + { + if (strcmp(cmdlist[i].command,"")) + { + if (!strcmp(command, cmdlist[i].command)) + { + if (parameters) + { + if (strcmp(parameters,"")) + { + items = process_parameters(command_p,parameters); + } + else + { + items = 0; + command_p[0] = NULL; + } + } + else + { + items = 0; + command_p[0] = NULL; + } + + if (user) + { + user->idle_lastmsg = time(NULL); + /* activity resets the ping pending timer */ + user->nping = time(NULL) + 120; + if ((items) < cmdlist[i].min_params) + { + debug("process_command: not enough parameters: %s %s",user->nick,command); + WriteServ(user->fd,"461 %s %s :Not enough parameters",user->nick,command); + return; + } + if ((!strchr(user->modes,cmdlist[i].flags_needed)) && (cmdlist[i].flags_needed)) + { + debug("process_command: permission denied: %s %s",user->nick,command); + WriteServ(user->fd,"481 %s :Permission Denied- You do not have the required operator privilages",user->nick); + cmd_found = 1; + return; + } + /* if the command isnt USER, PASS, or NICK, and nick is empty, + * deny command! */ + if ((strcmp(command,"USER")) && (strcmp(command,"NICK")) && (strcmp(command,"PASS"))) + { + if ((!isnick(user->nick)) || (user->registered != 7)) + { + debug("process_command: not registered: %s %s",user->nick,command); + WriteServ(user->fd,"451 %s :You have not registered",command); + return; + } + } + if ((user->registered == 7) || (!strcmp(command,"USER")) || (!strcmp(command,"NICK")) || (!strcmp(command,"PASS"))) + { + debug("process_command: handler: %s %s %d",user->nick,command,items); + if (cmdlist[i].handler_function) + { + /* ikky /stats counters */ + if (temp) + { + if (user) + { + user->bytes_in += strlen(temp); + user->cmds_in++; + } + cmdlist[i].use_count++; + cmdlist[i].total_bytes+=strlen(temp); + } + + /* WARNING: nothing may come after the + * command handler call, as the handler + * may free the user structure! */ + + cmdlist[i].handler_function(command_p,items,user); + } + return; + } + else + { + debug("process_command: not registered: %s %s",user->nick,command); + WriteServ(user->fd,"451 %s :You have not registered",command); + return; + } + } + cmd_found = 1; + } + } + } + if ((!cmd_found) && (user)) + { + debug("process_command: not in table: %s %s",user->nick,command); + WriteServ(user->fd,"421 %s %s :Unknown command",user->nick,command); + } +} + + +void createcommand(char* cmd, handlerfunc f, char flags, int minparams) +{ + command_t comm; + /* create the command and push it onto the table */ + strcpy(comm.command,cmd); + comm.handler_function = f; + comm.flags_needed = flags; + comm.min_params = minparams; + comm.use_count = 0; + comm.total_bytes = 0; + cmdlist.push_back(comm); +} + +void SetupCommandTable(void) +{ + createcommand("USER",handle_user,0,4); + createcommand("NICK",handle_nick,0,1); + createcommand("QUIT",handle_quit,0,1); + createcommand("VERSION",handle_version,0,0); + createcommand("PING",handle_ping,0,1); + createcommand("PONG",handle_pong,0,1); + createcommand("ADMIN",handle_admin,0,0); + createcommand("PRIVMSG",handle_privmsg,0,2); + createcommand("INFO",handle_info,0,0); + createcommand("TIME",handle_time,0,0); + createcommand("WHOIS",handle_whois,0,1); + createcommand("WALLOPS",handle_wallops,'o',1); + createcommand("NOTICE",handle_notice,0,2); + createcommand("JOIN",handle_join,0,1); + createcommand("NAMES",handle_names,0,1); + createcommand("PART",handle_part,0,1); + createcommand("KICK",handle_kick,0,2); + createcommand("MODE",handle_mode,0,1); + createcommand("TOPIC",handle_topic,0,1); + createcommand("WHO",handle_who,0,1); + createcommand("MOTD",handle_motd,0,0); + createcommand("RULES",handle_join,0,0); + createcommand("OPER",handle_oper,0,2); + createcommand("LIST",handle_list,0,0); + createcommand("DIE",handle_die,'o',1); + createcommand("RESTART",handle_restart,'o',1); + createcommand("KILL",handle_kill,'o',2); + createcommand("REHASH",handle_rehash,'o',0); + createcommand("LUSERS",handle_lusers,0,0); + createcommand("STATS",handle_stats,0,1); + createcommand("USERHOST",handle_userhost,0,1); + createcommand("AWAY",handle_away,0,0); + createcommand("ISON",handle_ison,0,0); + createcommand("SUMMON",handle_summon,0,0); + createcommand("USERS",handle_users,0,0); + createcommand("INVITE",handle_invite,0,2); + createcommand("PASS",handle_pass,0,1); + createcommand("TRACE",handle_trace,'o',0); +} + +void process_buffer(userrec *user) +{ + char cmd[MAXBUF]; + int i; + if (!user->inbuf) + { + return; + } + if (!strcmp(user->inbuf,"")) + { + return; + } + strncpy(cmd,user->inbuf,MAXBUF); + if (!strcmp(cmd,"")) + { + return; + } + if ((cmd[strlen(cmd)-1] == 13) || (cmd[strlen(cmd)-1] == 10)) + { + cmd[strlen(cmd)-1] = '\0'; + } + if ((cmd[strlen(cmd)-1] == 13) || (cmd[strlen(cmd)-1] == 10)) + { + cmd[strlen(cmd)-1] = '\0'; + } + strcpy(user->inbuf,""); + if (!strcmp(cmd,"")) + { + return; + } + debug("InspIRCd: processing: %s %s",user->nick,cmd); + process_command(user,cmd); +} + +int InspIRCd(void) +{ + struct sockaddr_in client, server; + int portCount = 0, ports[MAXSOCKS]; + char addrs[MAXBUF][255]; + int openSockfd[MAXSOCKS], incomingSockfd, result = TRUE; + socklen_t length; + int count = 0, scanDetectTrigger = TRUE, showBanner = FALSE; + int selectResult = 0; + char *temp, configToken[MAXBUF], stuff[MAXBUF], Addr[MAXBUF]; + char resolvedHost[MAXBUF]; + fd_set selectFds; + struct timeval tv; + int count2; + + debug("InspIRCd: startup: begin"); + debug("$Id$"); + if ((geteuid()) && (getuid()) == 0) + { + printf("WARNING!!! You are running an irc server as ROOT!!! DO NOT DO THIS!!!\n\n"); + Exit(ERROR); + debug("InspIRCd: startup: not starting with UID 0!"); + } + SetupCommandTable(); + debug("InspIRCd: startup: default command table set up"); + + ReadConfig(); + if (strcmp(DieValue,"")) + { + printf("WARNING: %s\n\n",DieValue); + exit(0); + } + debug("InspIRCd: startup: read config"); + + for (count = 0; count < ConfValueEnum("bind"); count++) + { + ConfValue("bind","port",count,configToken); + ConfValue("bind","address",count,Addr); + ports[count] = atoi(configToken); + strcpy(addrs[count],Addr); + debug("InspIRCd: startup: read binding %s:%d from config",addrs[count],ports[count]); + } + portCount = ConfValueEnum("bind"); + debug("InspIRCd: startup: read %d total ports",portCount); + + debug("InspIRCd: startup: InspIRCd is now running!"); + + printf("\n"); + for (count = 0; count < ConfValueEnum("module"); count++) + { + char modfile[MAXBUF]; + ConfValue("module","name",count,configToken); + sprintf(modfile,"%s/%s",MOD_PATH,configToken); + printf("Loading module... \033[1;37m%s\033[0;37m\n",modfile); + debug("InspIRCd: startup: Loading module: %s",modfile); + + factory[count] = new ircd_module(modfile); + if (factory[count]->LastError()) + { + debug("Unable to load %s: %s",modfile,factory[count]->LastError()); + sprintf("Unable to load %s: %s\nExiting...\n",modfile,factory[count]->LastError()); + Exit(ERROR); + } + if (factory[count]->factory) + { + modules[count] = factory[count]->factory->CreateModule(); + /* save the module and the module's classfactory, if + * this isnt done, random crashes can occur :/ */ + } + else + { + debug("Unable to load %s",modfile); + sprintf("Unable to load %s\nExiting...\n",modfile); + Exit(ERROR); + } + } + MODCOUNT = count - 1; + debug("Total loaded modules: %d",MODCOUNT+1); + + printf("\nInspIRCd is now running!\n"); + + startup_time = time(NULL); + + if (DaemonSeed() == ERROR) + { + debug("InspIRCd: startup: can't daemonise"); + printf("ERROR: could not go into daemon mode. Shutting down.\n"); + Exit(ERROR); + } + + + /* setup select call */ + FD_ZERO(&selectFds); + debug("InspIRCd: startup: zero selects"); + + for (count = 0; count < portCount; count++) + { + if ((openSockfd[boundPortCount] = OpenTCPSocket()) == ERROR) + { + debug("InspIRCd: startup: bad fd %d",openSockfd[boundPortCount]); + return(ERROR); + } + if (BindSocket(openSockfd[boundPortCount],client,server,ports[count],addrs[count]) == ERROR) + { + debug("InspIRCd: startup: failed to bind port %d",ports[count]); + } + else /* well we at least bound to one socket so we'll continue */ + { + boundPortCount++; + } + } + + debug("InspIRCd: startup: total bound ports %d",boundPortCount); + + /* if we didn't bind to anything then abort */ + if (boundPortCount == 0) + { + debug("InspIRCd: startup: no ports bound, bailing!"); + return (ERROR); + } + + length = sizeof (client); + int flip_flop = 0; + + /* main loop for multiplexing/resetting */ + for (;;) + { + /* set up select call */ + for (count = 0; count < boundPortCount; count++) + { + FD_SET (openSockfd[count], &selectFds); + } + + /* added timeout! select was waiting forever... wank... :/ */ + tv.tv_usec = 0; + + flip_flop++; + if (flip_flop > 20) + { + tv.tv_usec = 1; + flip_flop = 0; + } + + tv.tv_sec = 0; + selectResult = select(MAXSOCKS, &selectFds, NULL, NULL, &tv); + + for (user_hash::iterator count2 = clientlist.begin(); count2 != clientlist.end(); count2++) + { + char data[MAXBUF]; + + if (!count2->second) break; + + if (count2->second) + if (count2->second->fd) + { + if (((time(NULL)) > count2->second->nping) && (isnick(count2->second->nick)) && (count2->second->registered == 7)) + { + if (!count2->second->lastping) + { + debug("InspIRCd: ping timeout: %s",count2->second->nick); + kill_link(count2->second,"Ping timeout"); + break; + } + Write(count2->second->fd,"PING :%s",ServerName); + debug("InspIRCd: pinging: %s",count2->second->nick); + count2->second->lastping = 0; + count2->second->nping = time(NULL)+120; + } + + result = read(count2->second->fd, data, 1); + // result EAGAIN means nothing read + if (result == EAGAIN) + { + } + else + if (result == 0) + { + debug("InspIRCd: Exited: %s",count2->second->nick); + kill_link(count2->second,"Client exited"); + } + else if (result > 0) + { + strncat(count2->second->inbuf, data, result); + if (strchr(count2->second->inbuf, '\n') || strchr(count2->second->inbuf, '\r')) + { + /* at least one complete line is waiting to be processed */ + if (!count2->second->fd) + break; + else + { + process_buffer(count2->second); + break; + } + } + } + } + } + + /* select is reporting a waiting socket. Poll them all to find out which */ + if (selectResult > 0) + { + char target[MAXBUF], resolved[MAXBUF]; + for (count = 0; count < boundPortCount; count++) + { + if (FD_ISSET (openSockfd[count], &selectFds)) + { + incomingSockfd = accept (openSockfd[count], (struct sockaddr *) &client, &length); + + address_cache::iterator iter = IP.find(client.sin_addr); + bool iscached = false; + if (iter == IP.end()) + { + /* ip isn't in cache, add it */ + strncpy (target, (char *) inet_ntoa (client.sin_addr), MAXBUF); + if(CleanAndResolve(resolved, target) != TRUE) + { + strncpy(resolved,target,MAXBUF); + } + /* hostname now in 'target' */ + IP[client.sin_addr] = new string(resolved); + /* hostname in cache */ + } + else + { + /* found ip (cached) */ + strncpy(resolved, iter->second->c_str(), MAXBUF); + iscached = true; + } + + if (incomingSockfd < 0) + { + WriteOpers("*** WARNING: Accept failed on port %d (%s)", ports[count],target); + debug("InspIRCd: accept failed: %d",ports[count]); + break; + } + AddClient(incomingSockfd, resolved, ports[count], iscached); + debug("InspIRCd: adding client on port %d fd=%d",ports[count],incomingSockfd); + break; + } + + } + } + } + + /* not reached */ + close (incomingSockfd); +} + diff --git a/src/inspircd_io.cpp b/src/inspircd_io.cpp new file mode 100644 index 000000000..474f48fe1 --- /dev/null +++ b/src/inspircd_io.cpp @@ -0,0 +1,371 @@ +/* +------------------------------------+ + * | Inspire Internet Relay Chat Daemon | + * +------------------------------------+ + * + * Inspire is copyright (C) 2002-2003 ChatSpike-Dev. + * E-mail: + * <brain@chatspike.net> + * <Craig@chatspike.net> + * + * Written by Craig Edwards, Craig McLure, and others. + * This program is free but copyrighted software; see + * the file COPYING for details. + * + * --------------------------------------------------- + + $Log$ + Revision 1.1 2003/01/23 19:45:58 brain + Initial revision + + Revision 1.12 2003/01/22 20:49:16 brain + Added FileReader file-caching class + Changed m_randquote to use FileReader class + + Revision 1.11 2003/01/21 20:31:24 brain + Modified to add documentation + Added ConfigReader class for modules + + Revision 1.10 2003/01/16 20:11:55 brain + fixed some ugly pointer bugs (thanks dblack and a|KK|y!) + + Revision 1.9 2003/01/09 13:05:58 brain + + Fixed socket lingering problems (is BSD compatible) + + Revision 1.8 2003/01/07 19:57:56 brain + + Dynamix module support, preliminary release + + Revision 1.7 2003/01/06 23:38:29 brain + + just playing with header tags + + + * --------------------------------------------------- + */ + +#include "inspircd.h" +#include "inspircd_io.h" +#include "inspircd_util.h" + +void WriteOpers(char* text, ...); + +void Exit (int status) +{ + send_error("Server shutdown."); + exit (status); +} + +void Killed(int status) +{ + send_error("Server terminated."); + exit(status); +} + +void Rehash(int status) +{ + ReadConfig(); + WriteOpers("Rehashing config file %s due to SIGHUP",CONFIG_FILE); +} + + + +void Start (void) +{ + printf("\033[1;37mInspire Internet Relay Chat Server, compiled " __DATE__ " at " __TIME__ "\n"); + printf("(C) ChatSpike Development team.\033[0;37m\n\n"); + printf("\033[1;37mDevelopers:\033[0;37m Brain, FrostyCoolSlug, Raider, RD\n"); + printf("\033[1;37mDocumentation:\033[0;37m FrostyCoolSlug\n"); + printf("\033[1;37mTesters:\033[0;37m MrBOFH, piggles, Lord_Zathras, typobox43, CC\n"); + printf("\033[1;37mName concept:\033[0;37m Lord_Zathras\n\n"); +} + + +int DaemonSeed (void) +{ + int childpid; + signal (SIGALRM, SIG_IGN); + signal (SIGHUP, Rehash); + signal (SIGPIPE, SIG_IGN); + signal (SIGTERM, Exit); + signal (SIGABRT, Exit); + signal (SIGSEGV, Error); + signal (SIGURG, Exit); + signal (SIGKILL, Exit); + if ((childpid = fork ()) < 0) + return (ERROR); + else if (childpid > 0) + exit (0); + setsid (); + umask (077); + /* close stdout, stdin, stderr */ + close(0); + close(1); + close(2); + return (TRUE); +} + + + + +/* Make sure the config file is available */ +int CheckConfig (void) +{ + FILE *input; + + if ((input = fopen (CONFIG_FILE, "r")) == NULL) + { + printf("ERROR: Cannot open config file: %s\nExiting...\n",CONFIG_FILE); + return(FALSE); + } + else + fclose (input); + +return(TRUE); +} + +/* Counts the number of tags of a certain type within the config file, e.g. to enumerate opers */ + +int EnumConf(const char* filename, const char* tag) +{ + FILE *config; + int ptr = 0; + char buffer[MAXBUF], c_tag[MAXBUF], c; + int in_token, in_quotes, tptr, j, idx = 0; + char* key; + + if ((config = fopen (filename, "r")) == NULL) + { + return 0; + } + else + { + ptr = 0; + in_token = 0; + in_quotes = 0; + while (!feof(config)) + { + c = fgetc(config); + if ((c == '<') && (!in_quotes)) + { + tptr = 0; + in_token = 1; + do { + c = fgetc(config); + if (c != ' ') + { + c_tag[tptr++] = c; + c_tag[tptr] = '\0'; + } + } while (c != ' '); + } + if (c == '"') + { + in_quotes = (!in_quotes); + } + if ((c == '>') && (!in_quotes)) + { + in_token = 0; + if (!strcmp(c_tag,tag)) + { + /* correct tag, but wrong index */ + idx++; + } + c_tag[0] = '\0'; + buffer[0] = '\0'; + ptr = 0; + tptr = 0; + } + if (c != '>') + { + if ((in_token) && (c != '\n') && (c != '\r')) + { + buffer[ptr++] = c; + buffer[ptr] = '\0'; + } + } + } + } + fclose(config); + return idx; +} + + + +int ConfValueEnum(char* tag) +{ + EnumConf(CONFIG_FILE,tag); +} + + + +/* Retrieves a value from the config file. If there is more than one value of the specified + * key and section (e.g. for opers etc) then the index value specifies which to retreive, e.g. + * + * ConfValue("oper","name",2,result); + */ + +int ReadConf(const char* filename, const char* tag, const char* var, int index, char *result) +{ + FILE *config; + int ptr = 0; + char buffer[MAXBUF], c_tag[MAXBUF], c; + int in_token, in_quotes, tptr, j, idx = 0; + char* key; + + if ((config = fopen (filename, "r")) == NULL) + { + return 0; + } + else + { + ptr = 0; + in_token = 0; + in_quotes = 0; + while (!feof(config)) + { + c = fgetc(config); + if ((c == '<') && (!in_quotes)) + { + tptr = 0; + in_token = 1; + do { + c = fgetc(config); + if (c != ' ') + { + c_tag[tptr++] = c; + c_tag[tptr] = '\0'; + } + } while (c != ' '); + } + if (c == '"') + { + in_quotes = (!in_quotes); + } + if ((c == '>') && (!in_quotes)) + { + in_token = 0; + if (idx == index) + { + if (!strcmp(c_tag,tag)) + { + if ((buffer) && (c_tag) && (var)) + { + key = strstr(buffer,var); + if (!key) + { + /* value not found in tag */ + fclose(config); + return 0; + } + else + { + key+=strlen(var); + while (key[0] !='"') + { + if (!strlen(key)) + { + /* missing quote */ + return 0; + } + key++; + } + key++; + for (j = 0; j < strlen(key); j++) + { + if (key[j] == '"') + { + key[j] = '\0'; + } + } + fclose(config); + strcpy(result,key); + return 1; + } + } + } + } + if (!strcmp(c_tag,tag)) + { + /* correct tag, but wrong index */ + idx++; + } + c_tag[0] = '\0'; + buffer[0] = '\0'; + ptr = 0; + tptr = 0; + } + if (c != '>') + { + if ((in_token) && (c != '\n') && (c != '\r')) + { + buffer[ptr++] = c; + buffer[ptr] = '\0'; + } + } + } + } + fclose(config); + return 0; +} + + + +int ConfValue(char* tag, char* var, int index, char *result) +{ + ReadConf(CONFIG_FILE, tag, var, index, result); +} + + + +/* This will bind a socket to a port. It works for UDP/TCP */ +int BindSocket (int sockfd, struct sockaddr_in client, struct sockaddr_in server, int port, char* addr) +{ + bzero((char *)&server,sizeof(server)); + struct in_addr addy; + inet_aton(addr,&addy); + + server.sin_family = AF_INET; + if (!strcmp(addr,"")) + { + server.sin_addr.s_addr = htonl(INADDR_ANY); + } + else + { + server.sin_addr = addy; + } + + server.sin_port = htons(port); + + if (bind(sockfd,(struct sockaddr*)&server,sizeof(server))<0) + { + return(ERROR); + } + else + { + listen(sockfd,5); + return(TRUE); + } +} + + +/* Open a TCP Socket */ +int OpenTCPSocket (void) +{ + int sockfd; + int on = 0; + struct linger linger = { 0 }; + + if ((sockfd = socket (AF_INET, SOCK_STREAM, 0)) < 0) + return (ERROR); + else + { + setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, (const char*)&on, sizeof(on)); + /* This is BSD compatible, setting l_onoff to 0 is *NOT* http://web.irc.org/mla/ircd-dev/msg02259.html */ + linger.l_onoff = 1; + linger.l_linger = 0; + setsockopt(sockfd, SOL_SOCKET, SO_LINGER, (const char*)&linger,sizeof(linger)); + return (sockfd); + } +} + diff --git a/src/inspircd_util.cpp b/src/inspircd_util.cpp new file mode 100644 index 000000000..756a61d23 --- /dev/null +++ b/src/inspircd_util.cpp @@ -0,0 +1,77 @@ +/* + +$Log$ +Revision 1.1 2003/01/23 19:45:58 brain +Initial revision + +Revision 1.2 2003/01/15 22:49:18 brain +Added log macros + + +*/ + +#include "inspircd.h" +#include "inspircd_io.h" +#include "inspircd_util.h" + +char *SafeStrncpy (char *dest, const char *src, size_t size) +{ + if (!dest) + { + dest = NULL; + return (NULL); + } + else if (size < 1) + { + dest = NULL; + return (NULL); + } + + memset (dest, '\0', size); + strncpy (dest, src, size - 1); + + return (dest); +} + + +char *CleanIpAddr (char *cleanAddr, const char *dirtyAddr) +{ + int count = 0, maxdot = 0, maxoctet = 0; + + memset (cleanAddr, '\0', MAXBUF); + if(dirtyAddr == NULL) + return(cleanAddr); + + for (count = 0; count < MAXBUF - 1; count++) + { + if (isdigit (dirtyAddr[count])) + { + if (++maxoctet > 3) + { + cleanAddr[count] = '\0'; + break; + } + cleanAddr[count] = dirtyAddr[count]; + } + else if (dirtyAddr[count] == '.') + { + if (++maxdot > 3) + { + cleanAddr[count] = '\0'; + break; + } + maxoctet = 0; + cleanAddr[count] = dirtyAddr[count]; + } + else + { + cleanAddr[count] = '\0'; + break; + } + } + + return (cleanAddr); +} + + + diff --git a/src/modules.cpp b/src/modules.cpp new file mode 100644 index 000000000..36dbd2933 --- /dev/null +++ b/src/modules.cpp @@ -0,0 +1,232 @@ +/* + +$Log$ +Revision 1.1 2003/01/23 19:45:58 brain +Initial revision + +Revision 1.7 2003/01/22 20:49:16 brain +Added FileReader file-caching class +Changed m_randquote to use FileReader class + +Revision 1.6 2003/01/21 20:31:24 brain +Modified to add documentation +Added ConfigReader class for modules + +Revision 1.5 2003/01/13 22:30:50 brain +Added Admin class (holds /admin info for modules) +Added methods to Server class + + +*/ + + + +#include <typeinfo> +#include <iostream.h> +#include "globals.h" +#include "modules.h" +#include "inspircd_io.h" + +// version is a simple class for holding a modules version number + +Version::Version(int major, int minor, int revision, int build) : Major(major), Minor(minor), Revision(revision), Build(build) { }; + +// admin is a simple class for holding a server's administrative info + +Admin::Admin(string name, string email, string nick) : Name(name), Email(email), Nick(nick) { }; + +// +// Announce to the world that the Module base +// class has been created or destroyed +// + +Module::Module() { } +Module::~Module() { } +void Module::OnUserConnect(userrec* user) { } +void Module::OnUserQuit(userrec* user) { } +void Module::OnUserJoin(userrec* user, chanrec* channel) { } +void Module::OnUserPart(userrec* user, chanrec* channel) { } +Version Module::GetVersion() { return Version(1,0,0,0); } + +// server is a wrapper class that provides methods to all of the C-style +// exports in the core +// + +Server::Server() +{ +} + +Server::~Server() +{ +} + +void Server::SendOpers(string s) +{ + WriteOpers("%s",s.c_str()); +} + +void Server::Debug(string s) +{ + debug("%s",s.c_str()); +} + +void Server::Send(int Socket, string s) +{ + Write(Socket,"%s",s.c_str()); +} + +void Server::SendServ(int Socket, string s) +{ + WriteServ(Socket,"%s",s.c_str()); +} + +void Server::SendFrom(int Socket, userrec* User, string s) +{ + WriteFrom(Socket,User,"%s",s.c_str()); +} + +void Server::SendTo(userrec* Source, userrec* Dest, string s) +{ + WriteTo(Source,Dest,"%s",s.c_str()); +} + +void Server::SendChannel(userrec* User, chanrec* Channel, string s,bool IncludeSender) +{ + if (IncludeSender) + { + WriteChannel(Channel,User,"%s",s.c_str()); + } + else + { + ChanExceptSender(Channel,User,"%s",s.c_str()); + } +} + +bool Server::CommonChannels(userrec* u1, userrec* u2) +{ + return (common_channels(u1,u2) != 0); +} + +void Server::SendCommon(userrec* User, string text,bool IncludeSender) +{ + if (IncludeSender) + { + WriteCommon(User,"%s",text.c_str()); + } + else + { + WriteCommonExcept(User,"%s",text.c_str()); + } +} + +void Server::SendWallops(userrec* User, string text) +{ + WriteWallOps(User,"%s",text.c_str()); +} + +bool Server::IsNick(string nick) +{ + return (isnick(nick.c_str()) != 0); +} + +userrec* Server::FindNick(string nick) +{ + return Find(nick); +} + +chanrec* Server::FindChannel(string channel) +{ + return FindChan(channel.c_str()); +} + +string Server::ChanMode(userrec* User, chanrec* Chan) +{ + string mode = cmode(User,Chan); + return mode; +} + +string Server::GetServerName() +{ + return getservername(); +} + +string Server::GetNetworkName() +{ + return getnetworkname(); +} + +Admin Server::GetAdmin() +{ + return Admin(getadminname(),getadminemail(),getadminnick()); +} + + +ConfigReader::ConfigReader() +{ + fname = CONFIG_FILE; +} + + +ConfigReader::~ConfigReader() +{ +} + + +ConfigReader::ConfigReader(string filename) : fname(filename) { }; + +string ConfigReader::ReadValue(string tag, string name, int index) +{ + char val[MAXBUF]; + ReadConf(fname.c_str(),tag.c_str(),name.c_str(),index,val); + string s = val; + return s; +} + + +int ConfigReader::Enumerate(string tag) +{ + return EnumConf(fname.c_str(),tag.c_str()); +} + + +bool ConfigReader::Verify() +{ + return true; +} + + +FileReader::FileReader(string filename) +{ + file_cache c; + readfile(c,filename.c_str()); + this->fc = c; +} + +FileReader::FileReader() +{ +} + +void FileReader::LoadFile(string filename) +{ + file_cache c; + readfile(c,filename.c_str()); + this->fc = c; +} + +FileReader::~FileReader() +{ +} + +string FileReader::GetLine(int x) +{ + if ((x<0) || (x>fc.size())) + return ""; + return fc[x]; +} + +int FileReader::FileSize() +{ + return fc.size(); +} + + diff --git a/src/modules/.make b/src/modules/.make new file mode 100644 index 000000000..0f68a9fad --- /dev/null +++ b/src/modules/.make @@ -0,0 +1,3 @@ +g++ -I../../include -fPIC -frtti -O3 -shared -o m_cloaking.so m_cloaking.cpp +g++ -I../../include -fPIC -frtti -O3 -shared -o m_foobar.so m_foobar.cpp +g++ -I../../include -fPIC -frtti -O3 -shared -o m_randquote.so m_randquote.cpp diff --git a/src/modules/m_cloaking.cpp b/src/modules/m_cloaking.cpp new file mode 100644 index 000000000..91ab49054 --- /dev/null +++ b/src/modules/m_cloaking.cpp @@ -0,0 +1,73 @@ +#include <stdio.h> + +#include "users.h" +#include "channels.h" +#include "modules.h" + +/* $ModDesc: Provides masking of user hostnames */ + +class ModuleCloaking : public Module +{ + private: + + Server *Srv; + + public: + ModuleCloaking() + { + Srv = new Server; + } + + virtual ~ModuleCloaking() + { + delete Srv; + } + + virtual Version GetVersion() + { + return Version(1,0,0,0); + } + + virtual void OnUserConnect(userrec* user) + { + if (strstr(user->dhost,".")) + { + string a = strstr(user->dhost,"."); + char ra[64]; + long seed,s2; + memcpy(&seed,user->dhost,sizeof(long)); + memcpy(&s2,a.c_str(),sizeof(long)); + sprintf(ra,"%.8X",seed*s2*strlen(user->host)); + string b = Srv->GetNetworkName() + "-" + ra + a; + Srv->Debug("cloak: allocated "+b); + strcpy(user->dhost,b.c_str()); + } + } + +}; + + +class ModuleCloakingFactory : public ModuleFactory +{ + public: + ModuleCloakingFactory() + { + } + + ~ModuleCloakingFactory() + { + } + + virtual Module * CreateModule() + { + return new ModuleCloaking; + } + +}; + + +extern "C" void * init_module( void ) +{ + return new ModuleCloakingFactory; +} + diff --git a/src/modules/m_foobar.cpp b/src/modules/m_foobar.cpp new file mode 100644 index 000000000..9aed188d8 --- /dev/null +++ b/src/modules/m_foobar.cpp @@ -0,0 +1,113 @@ +#include "users.h" +#include "channels.h" +#include "modules.h" + +/* $ModDesc: A dummy module for testing */ + +// Class ModuleFoobar inherits from Module +// It just outputs simple debug strings to show its methods are working. + +class ModuleFoobar : public Module +{ + private: + + // It is recommended that your class makes use of one or more Server + // objects. A server object is a class which contains methods which + // encapsulate the exports from the core of the ircd. + // such methods include Debug, SendChannel, etc. + + Server *Srv; + public: + ModuleFoobar() + { + // The constructor just creates an instance of the server class + + Srv = new Server; + } + + virtual ~ModuleFoobar() + { + // destructor deletes the instance of the server class + + delete Srv; + } + + virtual Version GetVersion() + { + // this method instantiates a class of type Version, and returns + // the modules version information using it. + + return Version(1,0,0,0); + } + + virtual void OnUserConnect(userrec* user) + { + // method called when a user connects + + string b = user->nick; + Srv->Debug("Foobar: User connecting: " + b); + } + + virtual void OnUserQuit(userrec* user) + { + // method called when a user disconnects + + string b = user->nick; + Srv->Debug("Foobar: User quitting: " + b); + } + + virtual void OnUserJoin(userrec* user, chanrec* channel) + { + // method called when a user joins a channel + + string c = channel->name; + string b = user->nick; + Srv->Debug("Foobar: User " + b + " joined " + c); + } + + virtual void OnUserPart(userrec* user, chanrec* channel) + { + // method called when a user parts a channel + + string c = channel->name; + string b = user->nick; + Srv->Debug("Foobar: User " + b + " parted " + c); + } + +}; + + +// +// The ModuleFoobarFactory class inherits from ModuleFactory +// and creates a ModuleFoobar object when requested. +// + +class ModuleFoobarFactory : public ModuleFactory +{ + public: + ModuleFoobarFactory() + { + } + + ~ModuleFoobarFactory() + { + } + + virtual Module * CreateModule() + { + return new ModuleFoobar; + } + +}; + + +// +// The "C" linkage factory0() function creates the ModuleFoobarFactory +// class for this library +// + +extern "C" void * init_module( void ) +{ + return new ModuleFoobarFactory; +} + diff --git a/src/modules/m_randquote.cpp b/src/modules/m_randquote.cpp new file mode 100644 index 000000000..aebf7c0ad --- /dev/null +++ b/src/modules/m_randquote.cpp @@ -0,0 +1,89 @@ +#include <stdio.h> +#include <stdlib.h> +#include <fstream> + +#include "users.h" +#include "channels.h" +#include "modules.h" + + +/* $ModDesc: Provides random Quotes on Connect. */ + +class ModuleRandQuote : public Module +{ + private: + + Server *Srv; + ConfigReader *conf; + FileReader *quotes; + + string q_file; + string prefix; + string suffix; + + public: + ModuleRandQuote() + { + Srv = new Server; + conf = new ConfigReader; + + q_file = conf->ReadValue("randquote","file",0); + prefix = conf->ReadValue("randquote","prefix",0); + suffix = conf->ReadValue("randquote","suffix",0); + + quotes = new FileReader(q_file); + } + + virtual ~ModuleRandQuote() + { + delete Srv; + delete conf; + delete quotes; + } + + virtual Version GetVersion() + { + return Version(1,0,0,0); + } + + virtual void OnUserConnect(userrec* user) + { + string str; + int fsize; + char buf[MAXBUF]; + + fsize = quotes->FileSize(); + srand(time(NULL)); + str = quotes->GetLine(rand() % fsize); + + sprintf(buf,"NOTICE %s :%s%s%s",user->nick,prefix.c_str(),str.c_str(),suffix.c_str()); + Srv->SendServ(user->fd, buf); + return; + } +}; + + +class ModuleRandQuoteFactory : public ModuleFactory +{ + public: + ModuleRandQuoteFactory() + { + } + + ~ModuleRandQuoteFactory() + { + } + + virtual Module * CreateModule() + { + return new ModuleRandQuote; + } + +}; + + +extern "C" void * init_module( void ) +{ + return new ModuleRandQuoteFactory; +} + diff --git a/src/users.cpp b/src/users.cpp new file mode 100644 index 000000000..a6ced8231 --- /dev/null +++ b/src/users.cpp @@ -0,0 +1,92 @@ +/* + +$Log$ +Revision 1.1 2003/01/23 19:45:58 brain +Initial revision + +Revision 1.3 2003/01/17 13:21:38 brain +Added CONNECT ALLOW and CONNECT DENY config tags +Added PASS command + +Revision 1.2 2003/01/17 10:37:55 brain +Added /INVITE command and relevent structures + +Revision 1.1 2003/01/16 01:10:04 brain +forgot to add this + + +*/ + +#include "inspircd_config.h" +#include "channels.h" +#include "users.h" +#include "inspircd.h" +#include <stdio.h> + +userrec::userrec() +{ + // the PROPER way to do it, AVOID bzero at *ALL* costs + strcpy(nick,""); + ip = 0; + strcpy(ident,""); + strcpy(host,""); + strcpy(dhost,""); + strcpy(fullname,""); + strcpy(modes,""); + strcpy(inbuf,""); + strcpy(server,""); + strcpy(awaymsg,""); + fd = lastping = signon = idle_lastmsg = nping = registered = 0; + port = bytes_in = bytes_out = cmds_in = cmds_out = 0; + haspassed = false; + strcpy(result,""); + for (int i = 0; i < MAXCHANS; i++) + { + chans[i].channel = NULL; + } + invites.clear(); +} + + +char* userrec::GetFullHost() +{ + sprintf(result,"%s!%s@%s",nick,ident,dhost); + return result; +} + + +char* userrec::GetFullRealHost() +{ + sprintf(result,"%s!%s@%s",nick,ident,host); + return result; +} + +bool userrec::IsInvited(char* channel) +{ + for (InvitedList::iterator i = invites.begin(); i != invites.end(); i++) + { + if (!strcasecmp(i->channel,channel)) + { + return true; + } + } +} + +void userrec::InviteTo(char* channel) +{ + Invited i; + strcpy(i.channel,channel); + invites.push_back(i); +} + +void userrec::RemoveInvite(char* channel) +{ + for (InvitedList::iterator i = invites.begin(); i != invites.end(); i++) + { + if (!strcasecmp(i->channel,channel)) + { + invites.erase(i); + return; + } + } +} diff --git a/src/version.sh b/src/version.sh new file mode 100755 index 000000000..14b08aa61 --- /dev/null +++ b/src/version.sh @@ -0,0 +1,2 @@ +#!sh +echo "InspIRCd-1.0[Alpha9]" diff --git a/src/wildcard.cpp b/src/wildcard.cpp new file mode 100644 index 000000000..900f314ea --- /dev/null +++ b/src/wildcard.cpp @@ -0,0 +1,90 @@ +#include <string> +#include "inspircd_config.h" +#include "inspircd.h" + +void Delete(char* str,int pos) +{ + char moo[MAXBUF]; + strcpy(moo,str); + moo[pos] = '\0'; + strcpy(str,moo); + strcat(str,moo+pos+1); +} + +void Insert(char* substr,char* str,int pos) +{ + string a = str; + a.insert(pos,substr); + strcpy(str,a.c_str()); +} + + +int MWC = 0; + +bool match2(char* literal,char* mask) +{ + +char OldM[MAXBUF]; +int I,I2; + +if (MWC) + return true; + +if ((strstr(mask,"*")==0) && (strlen(literal) != strlen(mask))) + return 0; + I=0; + I2=0; + while (I < strlen(mask)) + { + if (I2 >= strlen(literal)) + return 0; + + if ((mask[I]=='*') && (MWC==0)) + { + strcpy(OldM,mask); + + Delete(mask,I); + + while (strlen(mask)<255) + { + match2(literal,mask); + if (MWC==2) + return 1; + + Insert("?",mask,I); + } + strcpy(mask,OldM); + Delete(mask,I); + Insert("?",mask,I); + } + if (mask[I]=='?') + { + I++; + I2++; + continue; + } + if (mask[I] != literal[I2]) + return 0; + if (MWC) + return 1; + I++; + I2++; + } + if (strlen(literal)==strlen(mask)) + MWC=2; + +} + +bool match(char* literal, char* mask) +{ + char L[10240]; + char M[10240]; + MWC = 0; + strncpy(L,literal,10240); + strncpy(M,mask,10240); + strlower(L); + strlower(M); + match2(L,M); + return (MWC == 2); +} + |