Internet Relay Chat (IRC) Part 2/6

david bleckmann bleckmd at jacobs.cs.orst.edu
Tue Jun 20 13:30:14 AEST 1989


---- Cut Here and unpack ----
#!/bin/sh
# this is part 2 of a multipart archive
# do not concatenate these parts, unpack them in order with /bin/sh
# file Makefile continued
#
CurArch=2
if test ! -r s2_seq_.tmp
then echo "Please unpack part 1 first!"
     exit 1; fi
( read Scheck
  if test "$Scheck" != $CurArch
  then echo "Please unpack part $Scheck next!"
       exit 1;
  else exit 0; fi
) < s2_seq_.tmp || exit 1
echo "x - Continuing file Makefile"
sed 's/^X//' << 'SHAR_EOF' >> Makefile
X
X# Libraries needed for ircd
X
XDLIBS =
X
XCC=/bin/cc
X
Xall: irc ircd
X
Xirc.tar.Z: irc.tar
X	compress irc.tar
X
Xirc.tar: irc ircd irc.1 ircd.8 Comms Makefile COPYRIGHT INSTALL README ADVERTISEMENT MANUAL
X	tar -cfv irc.tar Comms Makefile COPYRIGHT *.c *.h irc.1 ircd.8 INSTALL example.conf README ADVERTISEMENT MANUAL
X
Xirc.shar: irc ircd irc.1 ircd.8 Comms Makefile COPYRIGHT INSTALL README ADVERTISEMENT MANUAL
X	shar Comms Makefile COPYRIGHT *.c *.h irc.1 ircd.8 INSTALL example.conf README ADVERTISEMENT MANUAL >irc.shar
X
Xirc: $(COBJS)
X	$(CC) $(COBJS) -o irc $(TLIBS)
X	chmod 711 irc
X
Xircd: $(DOBJS)
X	$(CC) $(DOBJS) -o ircd $(DLIBS)
X	chmod 4711 ircd
X
Xcard: $(ROBJS)
X	$(CC) $(ROBJS) -o card
X	chmod 711 card
X
Xircd.o: ircd.c struct.h
X
Xignore.o: ignore.c struct.h
X
Xsys.o: $(SYS).c struct.h sock.h Makefile sys.h
X	$(CC) $(CFLAGS) -c $(SYS).c
X	mv $(SYS).o sys.o
X
Xc_sys.o: c_$(SYS).c struct.h sock.h Makefile sys.h
X	$(CC) $(CFLAGS) -c c_$(SYS).c
X	mv c_$(SYS).o c_sys.o
X
Xs_sys.o: s_$(SYS).c struct.h sock.h Makefile sys.h
X	$(CC) $(CFLAGS) -c s_$(SYS).c
X	mv s_$(SYS).o s_sys.o
X
Xr_sys.o: r_$(SYS).c struct.h sock.h Makefile sys.h
X	$(CC) $(CFLAGS) -c r_$(SYS).c
X	mv r_$(SYS).o r_sys.o
X
Xs_conf.o: conf.c struct.h
X	$(CC) $(CFLAGS) -DSERVER -c conf.c
X	mv conf.o s_conf.o
X
Xc_conf.o: conf.c struct.h
X	$(CC) $(CFLAGS) -DCLIENT -c conf.c
X	mv conf.o c_conf.o
X
Xdeck.o: deck.c r_cmd.h
X
Xdate.o: date.c
X
Xchannel.o: channel.c struct.h
X
Xsend.o: send.c struct.h
X
Xdebug.o: debug.c struct.h
X
Xhelp.o: help.c struct.h help.h
X
Xs_msg.o: s_msg.c msg.h struct.h sys.h
X
Xparse.o: parse.c msg.h struct.h sys.h
X
Xpacket.o: packet.c struct.h msg.h
X
Xstr.o: str.c sys.h
X
Xirc.o: irc.c struct.h msg.h sys.h
X
Xc_msg.o: c_msg.c struct.h msg.h
X
Xr_msg.o: r_msg.c struct.h msg.h
X
Xlist.o: list.c struct.h
X
Xedit.o: edit.c
X
Xscreen.o: screen.c
X
Xsys.h: $(SYS).h Makefile
X	cp $(SYS).h sys.h
SHAR_EOF
echo "File Makefile is complete"
chmod 0600 Makefile || echo "restore of Makefile fails"
set `wc -c Makefile`;Sum=$1
if test "$Sum" != "3298"
then echo original size 3298, current size $Sum;fi
echo "x - extracting README (Text)"
sed 's/^X//' << 'SHAR_EOF' > README &&
X                                                Author: Jeff Trim
X                                                        jtrim at orion.cair.du.edu
X                                                  Date: 04 Apr 1989
X                                     Last modification: 04 Apr 1989
X
X            Installing IRC - The Internet Relay Chat Program
X
X                        by Jarkko Oikarinen
X
X
XSystem Requirements:
XTCP/IP Sockets
XBSD 4.3 Unix, SUN Unix, HP Unix, Dec Ultrix, System V (w/sockets)
XKnowledge of UNIX/C Programming, helps ;-)
X
X....if you don't have sockets (and a good way to know is if the UNIX TELNET(1)
Xand FTP(1) programs don't work at all) then you can't run IRC! ;-( DRAT!
XWouldn't it be great if all UNIX destributions had SOCKETS?
X
X
X                        -=> To Install IRC <=-
X
XThis manual attempts to give you the ENTIRE installation procedure for IRC,
Xand I have made it so that you can skip over the parts you don't want to read
Xby looking at the NUMBERS located on the right side of the screen.  Here are
Xthe CHAPTERS contained in this DOCUMENT:
X
X  1) FTP - Getting the program files from "tolsun.oulu.fi" in Finland
X  2) EDITING THE "struct.h" FILE - and what the various #define's do
X  3) EDITING THE "Makefile" 
X  4) HOW TO COMPILE AND INITIALIZE THE SOURCE FILES
X  5) OVERVIEW - of the "irc.conf" file - an introduction to networking
X  6) A TOUR OF THE /etc/hosts DATABASE - Brief description what it does
X  7) SERVER CONNECTIONS - How to set up the "irc.conf" file for SERVERS
X  8) DEFINING YOUR LOCAL HOST INFORMATION - and placing it in "irc.conf"
X  9) CLIENT CONNECTIONS - How to allow Clients to connect to Servers
X 10) OPERATOR PRIVILEDGES - How to make yourself an IRC Adminestrator
X 11) AN EXAMPLE "irc.conf" FILE - Shows you what one REALLY looks like!
X 12) UPDATES TO THE PROGRAM:   - That effect the "irc.conf" file
X
X     A) ADDING SUBNETS: - Adding Multiple Unix Sites (V2.01.5+)
X    
X
XIf you want to just view over a curtain chapter, take this file into VI and
Xuse the VI SEARCH command to search for the NUMBER of your choice, like
X"1)", "2)" and so forth - those numbers are unique to this table of contents
Xand the CHAPTER headings themselves.
X
XBecause we have provided you with this nice manual, DON'T BOTHER ME OR
XANYONE ELSE UNTIL YOU HAVE PERSONALLY WORKED ATLEAST 40 HOURS ON THE
XPROGRAM YOURSELF.  That way when you do ask questions they'll be
Xintelligent questions ;-)
X
X----------===========>>>>>>>> Begin Manual <<<<<<<==========-------------
X
X
X1) FTP: Getting the program files and Unarchiveing them:
X
X   First grab a copy of the program files from the anonymous FTP area of
X   "tolsun.oulu.fi".  The files are usually COMPRESS(ed) and TAR(ed) into
X   an ARCHIVE format so you will need to unarchive them.  To do this, first
X   transfer the archive file on to your UNIX and make a SUBDRIECTORY to
X   hold the files in -- usually "mkdir IRC".  Then place the IRC ARCHIVE into
X   this new sub-directory.
X
X   To uncompress the ARCHIVE type: "uncompress <archive_file>"
X                      For example: "uncompress irc.v2.01.03.tar.Z"
X
X   To UNARCHIVE the program files type: "tar -xf <archive_file>"
X                           For example: "tar -xf irc.v2.01.03.tar"
X
X
X2) EDIT: The "struct.h" file and make changes to the various #DEFINE's:
X   
X   a) Define what type of UNIX OPERATING SYSTEM your machine uses. IRC currently
X      supports, BSD42, BSD43, APOLLO, SYSV.  To select the one you want, 
X      replace the "0" with a "1" next to the choice you want.  All the other
X      UNIX OPERATING SYSTEM DEFINES should be set to "0".
X
X   b) Define DOMAINNAME, if your systems supports the "getdomainname()" system
X      call.  You can check this by typing "domainname" at the UNIX prompt and
X      seeing if anything appears.  IRC will attempt to add your UNIX Internet
X      System Domain to your hostname if it is not currently present on your
X      "hostname()".  You should define this if you do support getdomainame(). 
X      
X   c) Define NOTTY if you want the IRCD to run as a DEAMON.  As a Deamon it
X      will sit in Unix Background and run independant of any Terminal or TTY.
X      If you want to run IRCD in FOREGROUND and attached to a TTY, undefine
X      this option.  NORMALLY you will want to DEFINE this option and run IRCD
X      in Unix Background. 
X
X   d) Define MYNAME to be the Unix Directory path (pwd) to the "ircd"   
X
X   e) Define CONFIGFILE to the Unix Directory path to the "irc.conf"
X      password file.  The Format of this file will be discussed later.
X
X   f) Define PORTNUM alters the Internet Socket Port for IRC.  IRC will use 
X      this port to accept connections from other IRCD Servers and IRC Clients.
X      The current ports being used for IRC are Internet Ports "6667" and "6666"
X      although these are not OFFICIALLY reserved for IRC, they are the ports
X      we have unofficially claimed for the program.  I recommend you set your
X      program to use port "6667".
X
X   g) Define LOGFILE should be set to "/dev/null" unless you plan to DEBUG
X      the program.  You should be aware that the logfile grows very quickly
X      so unless you really need a LOGFILE it should be set to "/dev/null".
X
X   h) Define TIMESEC to be the amount of IDLE time you will allow your server
X      to WAIT before attempting to request status of your neighboring server.
X      If no messages are recieved by your server in TIMESEC seconds your server
X      will send a PING messages to your neighboring site and will expect the
X      other server to reply with a PONG message.  The PONG message tells your 
X      server that the other server is alright and functioning properly.  Your
X      server will wait for PINGFREQUENCY * 2 seconds for the other server to
X      reply to the PING message, and if no reply is given to the PING your
X      server will hangup the current SOCKET between the hosts and attempt to
X      RECONNECT to it again after CONNECTFREQUENCY seconds have passed.  As you
X      can see these 3 commands are interrealted to each other.
X
X   i) Define PINGFREQUENCY - (see "h" above)
X
X   j) Define CONNECTFREQUENCY - will define the number of SECONDS for your
X      server to wait before it attempts reconnection at it's neighboring
X      IRC hosts.  The defualt value is 20 minutes (1200 seconds) and that
X      is generally pretty good for RECONNECTION time.  You should probably
X      not change this Define.
X
X   k) Define MAXUSERSPERCHANNEL - Defines the maximum allowed users per 
X      channel in IRC.  This effects the number of users that can all talk
X      at once in a given channel and it should be left at 10 unless you 
X      have at first consulted with an authorized IRC Adminestrator about
X      it.  DO NOT CHANGE THIS DEFINE UNLESS YOU HAVE PERMISSION TO DO SO.
X      It should be defined to "10" users.
X
X   l) Define WRITEDELAY effects the UNIX Socket command WRITE() which is used
X      to write socket information to the IRCD socket.. and beyond!  Sometimes
X      a socket can become very crowded (if say 10-20 people were using IRC)
X      and it will lock up the users keyboard until it can get a return value
X      from the socket, which tells  IRC some information about the WRITE() call.
X      To BREAK this lockup, you need to specify the number of seconds you'll
X      allow the SOCKET to stay locked up before you'll BREAK the lock - this
X      typically is 15 seconds and that is a pretty good number for it.  I
X      recommend you leave it DEFUALT value.
X
X           --> Shouldn't have to change anything else! < --
X
X3) EDIT Makefile:
X
X   Take the file "Makefile" into a text editor and DEFINE (IE remove the "#"
X   from the Machine type that is yours.  Currently the Makefile supports
X   Berkeley Unix 4.2/4.3, System V and Hewlett Packard Unix.  The following
X   example shows the Makefile defined for Berkley Unix:
X
X       #            
X       # SYS = sysv
X       # SYS = hpux
X       SYS = bsd
X
X   .. all the other machine types chould be UNCOMMENTED (IE should have "#"
X   in front of them).
X
X4) MAKE and Initial CHMOD commands:
X  
X   To compile everything type "make".  Make will compile all of the program
X   files and produce two files for you:  "irc" and "ircd".  You will need to
X   make sure that the "ircd" has the SETUID bit set on in so that OTHER users
X   besides you can boot server if it goes down and you aren't around to boot
X   it yourself.  This will allow them to BOOT the server but it will run under
X   *YOUR* UID so that you can kill it later if you need to.  To turn on the 
X   SETUID bit for IRCD type:
X
X        % chmod 4111 ircd
X
X   then your directory files should look something like this:
X
X       -rwx--x--x  1 wiz        142336 Mar 16 14:17 irc
X       -rwx------  1 wiz           707 Mar 16 02:42 irc.conf
X       -rws--x--x  1 wiz        110592 Mar 16 14:20 ircd
X          ^
X          |
X   the SETUID also allows the "IRCD" to read the "irc.conf" file, because it
X   would be accessed as USER instead of GROUP or OTHER.  You want to keep the
X   "irc.conf" file PROTECTED because there are PASSWORD in it.   Keep your
X   protection up on this file.
X
X
X+--------------------------------------------------------------------------+
X+      M A K I N G   T H E   I R C . C O N F    F I L E                    +
X+--------------------------------------------------------------------------+
X
XWhen you first look at the file it can be a bit confusing, so you should pay
Xclose attention to the following.  I get a lot of messages from people telling
Xme hos confusing this is so PLEASE - really read this:
X
X5) OVERVIEW:   (difference bewtween NAME and NUMERIC Addresses)
X
X   There are 2 different types of INETERNET addresses, NAMED addresses and
X   NUMERIC addresses.  NAMED addresses look like ENGLISH words (and indeed
X   they are ENGLISH words that refer to a given host).  A NAME address looks
X   like "tolsun.oulu.fi" - and that particular address refers to the UNIX
X   named TOLSUN in Finland.  It is a UNIQUE address because no other UNIX in
X   the world has its NAMED address the same as "tolsun.oulu.edu".  Anytime
X   you say "telnet tolsun.oulu.fi" - you would always connect to TOLSUN in
X   Finland.  NUMERIC addresses refer to those addresses that are made up of
X   NUMBERS for example "128.214.5.6" is the NUMERIC address for TOLSUN.  This
X   address is also UNIQUE in that no other UNIX in the would should be using 
X   those NUMERIC numbers.  The NUMERIC address is sometimes more reliable than
X   the NAME address because not all sites can recognize and transleate the
X   NAME address into it's numeric counterpart.  NUMERIC always seems to work
X   best, but use a NAME address when you can because it is easier to tell
X   what host you are connected to.
X
X6) The /ect/hosts Database:  The 0.25 Cent Tour ;-)
X
X   Every UNIX has a file called "/etc/hosts" on it and this file contains 
X   NAME and NUMERIC addresses in it.  When you supply IRC with a NAME address
X   it will at first try to look it up in /ect/hosts, and then (if it's 
X   really smart), use the Local Network File Server (NFS) to find the NUMERIC
X   address for the host you want to connect to.  Thus if you plan to use NAME
X   address keep in mind that on SOME sites that entry for the TARGET UNIX must 
X   be found in /etc/hosts or the NAME address will fail.  A typical entry in
X   /etc/hosts looks like this:
X
X   130.253.1.15    orion.cair.du.edu orion.du.edu orion    # BSD 4.3
X
X   This particular example is the Host ORION at the University of Denver. 
X   Notice that on the far left is the NUMERIC Address for orion.  The
X   next few ENGLISH words are the NAME addresses that can be used for orion,
X   "orion.cair.du.edu", "orion.du.edu", "orion".  ALL of these NAME addresses
X   will return the NUMERIC address "130.253.1.15" which IRC will use to
X   connect to the TARGET UNIX. (when I say TARGET UNIX I am refering to the
X   UNIX you want to connect to for IRC). Any futher questions about /etc/hosts 
X   should be directed to "man hosts".
X
X
X7) SERVER CONNECTIONS:  How to connect to other servers/ How other servers can
X                        connect to you:
X
X   EDIT the file you speicifed in "struct.h" under the #DEFINE CONFIGFILE:
X   Create this file using the same UNIX path and Filename you specified in 
X   that #DEFINE.  (typically this file should be called "irc.conf").
X
X   Now you must decide WHICH hosts you want to connect to and WHAT ORDER you
X   want to connect to them in.  For my example let us assume I am on the
X   UNIX "tolsun.oulu.fi" and I want to establish SOCKET connections to 3
X   other IRCD running hosts (yeah - they must be running an IRCD there ;-)
X
X   My other three hosts I want to connect to are:
X
X         "naakka.tut.fi"           - PRIMARY Connection
X         "orion.cair.du.edu"       - Secondary Connection
X         "hal.oce.orst.edu"        - Third Connection
X
X   And I want to connect to them in THAT order, meaning I first want to
X   try connecting to "naakka.tut.fi", then to "orion.cair.du.edu", and
X   finally to "hal.oce.orst.edu".  So if "naakka.tut.fi" is DOWN (not
X   functioning whatever) - the program will try to connect to "orion".
X   If orion is DOWN it will try to connect to "hal" and so forth.
X   PLEASE limit the number of hosts you will attempt to connect to 3
X   hosts - we are trying to limit the amount of Network Traffic IRC creates.
X
X   The format for the CONNECT entry in the "irc.conf" is:
X
X       C:<TARGET Host Addr>:<Password>:<TARGET Host NAME>:<TARGET Host PORT>
XField: 1        2              3                4               5
X
X   for example:
X   
X    C:orion.cair.du.edu:passwd:orion.cair.du.edu:6667 
X
X          - or -
X
X    C:130.253.1.15:passwd:orion.cair.du.edu:6667
X
X    Explaination:
X
X    Each field is separted with a ":" charcter:
X
X    Field 1: Field 1 tells the IRC program why type of COMMAND we want to 
X             carry out.  In this case I have specified "C", stating I want
X             to CONNECT to another host.
X
X    Field 2: Tells the IRC program what HOST we want to connect to and the
X             NAME or NUMERIC address to connect to it.  You can use either
X             the NAME or NUMERIC address, but don't use both of them.  Use
X             the address that works the best.  If the host is listed in
X             /etc/hosts or your program can use the NFS server use the NAME
X             Address, otherwise use the NUMERIC address.
X
X    Field 3: Is the password needed to CONNECT to the TARGET host.  Some hosts
X             require Password protected validation when you connect to them,
X             and it is in this field that you specify any passwords you might
X             need.  If there is NO password needed, leave this field BLANK
X             with no SPACES. 
X
X    Field 4: The HOSTNAME of the TARGET Host goes here, including DOMAINNAME
X             if any.  This is the name that the TARGET server will identify
X             itself with when you connect to it.  If you were connecting to
X             orion you would recieve "orion.cair.du.edu" - and that is what
X             you should place in this field.
X  
X    Field 5: The INTERNET Port that you want to connect to on the TARGET Unix.
X             Most of the time this will be set to "6667".  If there is NO
X             information in this field (IT'S BLANK) then no connections will 
X             be attempted to the TARGET HOST, and your host will ACCEPT
X             connections FROM the TARGET Host instead.
X
X   Some examples:
X
X            C:naakka.tut.fi::naakka.tut.fi:6667
X 
X            This reads: Connect to host "naakka.tut.fi", with NO PASSWORD,
X            and expect this server to identify itself to you as "naakka.tu.fi".
X            *YOU* will connect to this host at PORT 6667.
X
X            C:130.253.1.15:Jeff:orion.cair.du.edu:6667
X
X            This reads: Connect to a host at adress "130.253.1.15", using a
X            login password of "Jeff".  The TARGET server should Identify
X            itself as "orion.cair.du.edu".  *YOU* will connect at Internet
X            Port 6667 on this host.
X
X            C:orion.cair.du.edu::orion.cair.du.edu
X                                                                               
X            This reads: *DO NOT CONNECT* to "orion.cair.du.edu", but if         
X            "orion.cair.du.edu" happens to request a CONNECTION with me,       
X            allow it, and let "orion.cair.du.edu" connect TO ME.               
X
X   Now back to our original problem, we wanted OUR server CONNECT to 3
X   hosts,  "naakka.tut.fi", "orion.cair.du.edu" and "hal.oce.orst.edu" in
X   that order.  So as we enter these entries into the file they must be
X   done in REVERSE order of how we could want to connect to them.
X   Here's how it would look if we connected "naakka.tut.fi" first:
X
X      C:hal.oce.orst.edu::hal.oce.orst.edu:6667
X      C:orion.cair.du.edu::orion.cair.du.edu:6667
X      C:naakka.tut.fi::naakka.tut.fi:6667
X
X   IRCD would first connect to "naakka..", then to "orion..." and finally
X   to "hal...".
X
X          *** RECIPROCAL ENTRIES - MUST HAVE FOR IRC TO WORK ***
X
X   FOR THESE SERVERS TO CONNECT TO YOU, you must also have a CORRESPONDING
X   "N" entry in your file that takes the SAME FORMAT as the "C" entry
X   did (above).
X
X   Even though you have a "C" entry you also need the "N" entry or the IRC
X   Program will fail.  the "N" entry allows you to SPECIFY any passwords
X   that you will REQUIRE from any CONNECING servers to give you so that they 
X   can be authorized to connect to your IRCD.  (If your lost, stay with me it
X   will be clearer in a moment).
X    
X   Let us assume that "orion.cair.du.edu" connects to *YOUR* server: 
X   Well you want to place PASSWORD authorization on ORION so you
X   make your "N" entry for Orion to be:
X
X          N:orion.cair.du.edu:golden:orion.cair.du.edu
X  
X   What this line says is: Expect a Connection from host "orion.cair.du.edu",
X   and expect a login password of "golden" (or any other password *YOU* want)
X   and expect the host to Identify itself as "orion.cair.du.edu".
X     
X          N:130.253.1.15::orion.cair.du.edu
X
X   What this line says is: Expect a Connection from host "130.253.1.15", and 
X   DON'T EXPECT a login password.  The TARGET Host should identify itself
X   as "orion.cair.du.edu".
X
X   ** NOTE ** Do not add a PORT NUMBER to any "N" entry fields, it is not 
X   needed because the OTHER HOSTS are CONNECTING TO YOU, you aren't connecting
X   to them.
X
X   So now, our "irc.conf" file looks like this:
X
X
X      C:hal.oce.orst.edu::hal.oce.orst.edu:6667
X      C:orion.cair.du.edu::orion.cair.du.edu:6667
X      C:naakka.tut.fi::naakka.tut.fi:6667
X
X      N:hal.oce.orst.edu::hal.oce.orst.edu
X      N:orion.cair.du.edu::orion.cair.du.edu
X      N:naakka.tut.fi::naakka.tut.fi
X
X
X   a good rule of thumb is - "For every "C" entry you have in the file, you
X   MUST have a cooresponding "N" entry".
X
X
X8) DEFINING YOUR LOCAL HOST INFORMATION  - How to tell IRC about your local
X                                           UNIX Host.
X
X   IRC needs to know a few things about your UNIX site, and the "M" command
X   specifies this information for IRC.  The fomat of this command is:
X
X           M:<YOUR Host NAME>:xxx:xxx:<Internet Port>
X   Field:  1         2         3   4      5
X
X   Explaination:
X
X      Field 1: Tells IRC that you are providing local UNIX HOST infomation
X               Command "M".
X
X      Field 2: The name of YOUR host adding any Internet DOMAINNAME that 
X               might also be present.  
X
X      Field 3: -- NOT USED --: Set to Value "xxx".
X    
X      Field 4: -- NOT USED --: Set to Value "xxx".
X 
X      Field 5: This specifed which Internet Port you wish to use for your
X              IRC Server.  Use the same port as you defined in "struct.h".
X
X      Example:
X                M:tolsun.oulu.fi:xxx:xxx:6667
X
X                This line reads: My Host's name is "tolsun.oulu.fi" and
X                I have defied Internet Port Number "6667" to be used as
X                my IRCD Socket Port.
X
X
X9) CLIENT CONNECTIONS -   How to let Clients Connect to your IRCD.
X
X   A Client is a program that connects to the "ircd".  When you compile
X   all of the program files, two different files are created "irc" and
X   "ircd".  The "irc" program is the CLIENT and the "ircd" is the SERVER
X   [Deamon].  Whenever ANYONE wants to talk to other users on IRC they 
X   must run the CLIENT program (irc).
X
X   To allow you and your users to connect and run a session of Internet Relay 
X   Chat you must make some entries to the "irc.conf" file.  
X
X   A) LOCAL CLIENTS: (Defined the DEFAULT Host to connect to when IRC is run) 
X
X      This defines the DEFAULT connection for the "irc" CLIENT.  If you are
X      running an "ircd" SERVER on this SAME UNIX, you will want to define
X      this command to connect to *YOUR OWN* host.  If your site is not running
X      a server then this command should contain the TARGET Hosts connection
X      information and login password (if any).  The format for this command is:
X
X              U:<TARGET Host addr>:<Password>:<TARGET Host NAME>:<Internet Port>
X      Field:  1         2              3                4            5
X   
X      [ For a DETAILED description of the FIELD NUMBERS - see item "7)" above ]
X
X      For example:
X
X           U:tolsun.oulu.fi::tolsun.oulu.fi:6667
X
X                          - OR -
X
X           U:128.214.5.6::tolsun.oulu.fi:6667
X
X      You can also optionally leave off the Internet PORT Number
X      and IRC will attempt a DEFAULT connection to Internet Port 6667 as in:
X 
X           U:tolsun.oulu.fi::tolsun.oulu.fi
X
X   B) REMOTE CLIENTS:
X
X      This command tells the "ircd" SERVER what clients are allowed to connect
X      to *YOUR SERVER*.  Obviously you want to let your *OWN* clients connect,
X      and also any other CLIENTS that want to connect as well.  REMOTE CLIENTS
X      are those clients which are run by users on other UNIXES (anywhere in
X      the world) and connect your server so that they can talk to other users.
X      The CLIENTS would be using your server as a CONNECTION point, therefore
X      the SERVER will be SERVE-ING the CLIENT, even though the REMOTE client
X      was not part of your LOCAL UNIX Network.  All IRC Messages that were
X      sent to this REMOTE CLIENT would be sent to your server and then passed
X      on to where-ever the REMOTE CLIENT was connecting from by *your* "ircd".
X  
X      -----------------------------------------------------------------------
X 
X      The way a REMOTE CLIENT can connect to your "ircd" server is to type: 
X      (At the UNIX "%" prompt:)
X 
X             % irc <nickname> <TARGET Host Addr> <Internet Port>
X
X                    - For Example -
X
X             % irc Jeff tolsun.oulu.fi 6667
X      
X          ... would connect a USER on a REMOTE UNIX to the IRCD Server at
X          "tolsun.oulu.edu" - using a NICKNAME of "Jeff" and connecting
X          to TOLSUN's Internet Port 6667.    
X
X      ------------------------------------------------------------------------
X
X      Format of this command in the "irc.conf" file is:
X
X             I:<TARGET Host Addr>:<Password>:<TARGET Hosts NAME>:<Internet Port>
X      Field: 1         2               3             4                5
X
X          [For a detailed description of these fields see item "7)" above]
X
X      For examples sake let us assume you were making this file for TOLSUN
X      and you wanted to let your *OWN* clients to connect to your server,
X      you would add this entry to the file:
X
X          I:tolsun.oulu.fi::tolsun.oulu.fi
X
X      If you wanted to let REMOTE CLIENTS from other UNIX's to connect to your
X      server (for examples sake let's say you wanted let REMOTE UNIX Sites:
X      "naakka.tut.fi", "orion.cair.du.edu" and "hal.oce.orst.edu" connect their
X      CLIENTS to your site)  You *could* add them to "irc.conf" like this:
X
X          I:orion.cair.du.edu::orion.cair.du.edu
X          I:128.193.64.132::hal.oce.orst.edu
X          I:naakka.tut.fi:password:naakka.tu.fi
X
X      and any REMOTE CLIENTS that want to connect to you can.  The ORDER in
X      which these is entered into the file is NOT IMPORTANT, enter them in
X      any way you want, it won't effect the PRIORITY of IRC in any way.
X
X
X
X10) OPERATOR PRIVILEDGES:  How to become the IRC Adminestor on your site
X
X   To become an IRC Adminestrator, IRC must know who is authorized to become
X   an operator and what their "Nickname" and "Password" is.  To add this
X   information, EDIT your "irc.conf" file and add the following command
X   line to it:
X
X          O:<TARGET Host NAME>:<password>:<nickname>
X  Field:  1          2             3          4
X
X  Explaination:
X 
X     Field 1: Is the command to tell IRC that this is an OPERATOR command
X              entry.  This is the "O" command.
X 
X     Field 2: Tells IRC which host you have the PRIVILEDGES FROM.  This
X              means that you should be logged into this host when you
X              ask for the priviledges.  If you specify "tolsun.oulu.fi"
X              then IRC will expect your CLIENT to be connected at 
X              "tolsun.oulu.fi" - when you ask for OPERATOR PRIVILEDGES
X              from "tolsun.oulu.fi".  You cannot be logged in at any
X              other host and be able to use your OPERATOR PRIVILEDGES
X              at tolsun, only when you are connected at TOLSUN will this
X              work - this is a safe guard against unauthorized sites
X              trying to STEAL your operator priviledges.
X
X     Field 3: If your AUTHORIZATION Password - this is the password that 
X              let's IRC know you are who you say you are!  Never tell anyone
X              your password and always keep the "irc.conf" file protected
X              from all of the other users.
X 
X     Field 4: The Nickname you usually go by - but you can make this what
X              you want.  It is better to make this a NICKNAME that no one
X              else knows, but anything will do.  I usually use my own
X              loginname (or Unix)
X
X  Example:
X              O:orion.cair.du.edu:pyunxc:Jeff
X
X              There is an OPERATOR at "orion.cair.du.edu" that can get
X              Operator priviledges if he specifies a password of "pyunxc"
X              and uses a NICKNAME of "Jeff".
X
X  +-----------------------------------------------------------------------+
X  +        E N A B L I N G    O P E R A T O R    P R I V I L E D G E S    +
X  +-----------------------------------------------------------------------+
X 
X  If you ever want (or need) to use your OPERATOR priviledges, run "irc" and
X  login to the "ircd" normally - then type the following:
X
X      /oper <nickname> <password>
X
X  If you entered the OPERATOR COMMAND the way I did in the example above you
X  would type:
X
X      /oper Jeff pyunxc
X  
X  and if you entered everything correctly you would get the message:
X  "Good morning Gentleman, I am a Hal 9000 Computer" - if you MESSED up
X  you will probable get a message like "No mere mortals may enter the
X  twilight zone" - or other funny messages ;-)
X
X  You can confirm that your operator priviledges are ACTIVE by typing "/w"
X  and seeing if there is a "*" next to your name in the listing.  If there
X  is then you have successfully become an IRC ADMINESTRATOR.
X
X
X11) AN EXAMPLE "irc.conf" FILE:
X
X    Keep one last thought in mind, if the OTHER IRCD Unix Site doesn't have
X    your site listed in THEIR "irc.conf" file - you won't be able to 
X    connect to them - no matter how right your file is!  It is simply
X    useless to attempt connections to IRCD Hosts that don't have you listed
X    in their files because they'll just HANGUP on you everytime you 
X    connect.
X
X    After an exhausting description of every aspect of the "irc.conf" file,
X    here is a REAL and working example of a totally complete "irc.conf"
X    file.  This is the real file I use on my UNIX site (orion.cair.du.edu)
X    and I am displaying it for you now so that you'll know how yours should
X    look after you've completed it:
X
X    Since this is that last time I will be speaking to you - good luck and
X    make a prayer to whichever UNIX God's you may worship ;-)  I pray to
X    UUCP and Yellow Pages myself ;-)  Have fun and hope to talk to you 
X    soon on IRC.
X
X----------------- Cut here -------------------------- Cut here ---------------
X
XC:128.193.64.132::hal.oce.orst.edu:6667
XC:accuvax.nwu.edu::accuvax.nwu.edu:6667
XC:128.214.5.6::tolsun.oulu.fi
X
XN:128.193.64.132::hal.oce.orst.edu
XN:accuvax.nwu.edu::accuvax.nwu.edu
XN:128.214.5.6::tolsun.oulu.fi
X
XI:orion.cair.du.edu::orion.cair.du.edu
XI:128.193.64.132::hal.oce.orst.edu
XI:accuvax.nwu.edu::accuvax.nwu.edu
XI:128.214.5.6::tolsun.oulu.fi
XI:128.193.32.13::jacobs.CS.ORST.EDU
X
XO:orion.cair.du.edu:*censored*:jtrim
X
XU:orion.cair.du.edu::orion.cair.du.edu:6667
XM:orion.cair.du.edu:xxx:xxx:6667
X
X-------------- Cut Here ---------------------------- Cut Here ----------------
X
X
X12) UPDATES TO THE PROGRAM:   Lists any program changes that were done after
X                              this manual was written
X
X    This section was written to show any changes or upgrading that was done
X    after version v2.01.4 was released.  We have been releasing new versions
X    of the program very quickly so it is necessary to Document what's new
X    about each version to the best of our ability ;-)  The above documentation
X    is by no means out of date - and any MAJOR changes that take place in
X    the program will mean that I will rewrite the ABOVE Documentation so
X    that it once again reflect reality.  This section is used to tell you
X    about the SMALL fixes to the program that may or may not effect you,
X    for example MY SITE does not use SUBNETING, but many other sites do,
X    so if you were using a SUBNET you would want to know that we do in fact
X    support subneting.
X
X    *NOTE* That if we added a new feature in ONE VERSION, the feature *is*
X    included in the next version as well.  For example we added SUBNETING
X    in version v2.01.5 and it will be included in all future versions of
X    IRC.
X    
X
X    A) SUBNETING  (v2.01.5+)
X
X       IRC now supports SUBNETING, which is the ability to use WILD CARDS
X       (*.*) notation when refering to a NAME or NUMERIC host.  For example,
X       Let us say that you wanted the CLIENTS of ANY HOST in your UNIX domain 
X       of "cair.du.edu" to be able to connect to your IRCD Server.  You can
X       now specify a WILD CARD host listing in the "irc.conf" file of:
X      
X           C:*.cair.du.edu::*.cair.du.edu:6667
X           N:*.cair.du.edu::*.cair.du.edu
X          
X       ... and that would allow ANY HOST that has a UNIX domainname of 
X       "cair.du.edu" to connect to your host.
X
X       This also works for NUMERIC addresses as well.  If you wanted all
X       of the UNIX.  For example if you wanted to allow ANY UNIX with
X       a NUMERIC address of "130.253.1.*" to be able to connect to your
X       host you could say:
X
X           C:130.253.1.*::*.cair.du.edu:6667
X           N:130.253.1.*::*.cair.du.edu
X
X       The reason I added the "*.cair.du.edu" is because the CONNECTING
X       Host would indetify itself as a REAL NAME address, like
X       "orion.cair.du.edu", but your don't care if IT IS "orion", but
X       rather you care that it is FROM A DOMAIN of "cair.du.edu".  You
X       would set this up so that "130.253.1.*" refers to ALL OF THE 
X       MACHINES in the "cair.du.edu" domain, and you would hope that any
X       Machine within this UNIX DOMAIN would have an INTERNET ADRESS
X       that begins with "130.253.1", the LAST NUMBER would be the only
X       ones that's different.  But, this isn't always the case.
X 
X       Examples:
X
X              C:128.214.5.*::*.oulu.fi:6667
X              N:128.214.5.*::*.oulu.fi
X  
X              This line reads: If any machine with an INTERNET ADDRESS
X              that starts with "128.214.5" connects to my server, and
X              identifies itself with a NAME address that ENDS in "oulu.fi",
X              let them connect to my server.
X
X              C:*.du.edu::*.du.edu:6667
X              N:*.du.edu::*.du.edu
X 
X              This line reads: If any host conects to me and identifies itself
X              as a host that ENDS with a NAME Address of "du.edu".
X
X              C:*::*:6667
X              N:*::*
X
X              This ones says: Let ANYONE connect to my server! ;-)  In
X              Reality the computer reads this as:  I don't care what
X              what INTERNET ADRESS or NAME ADDRESS they are from, just
X              let them connect.  I DON'T RECOMMEND YOU DO THIS, but this
X              is a possible option if you need it.
X
X
X 
X     -=> End of IRC README Document <=-
SHAR_EOF
chmod 0600 README || echo "restore of README fails"
set `wc -c README`;Sum=$1
if test "$Sum" != "32568"
then echo original size 32568, current size $Sum;fi
echo "x - extracting bsd.c (Text)"
sed 's/^X//' << 'SHAR_EOF' > bsd.c &&
X/*************************************************************************
X ** bsd.c  Beta  v2.0    (22 Aug 1988)
X **
X ** This file is part of Internet Relay Chat v2.0
X **
X ** Author:           Jarkko Oikarinen 
X **         Internet: jto at tolsun.oulu.fi
X **             UUCP: ...!mcvax!tut!oulu!jto
X **           BITNET: toljto at finou
X **
X ** Copyright (c) 1988 University of Oulu, Computing Center
X **
X ** All rights reserved.
X **
X ** See file COPYRIGHT in this package for full copyright.
X ** 
X *************************************************************************/
X
Xchar bsd_id[] = "bsd.c v2.0 (c) 1988 University of Oulu, Computing Center";
X
X#include "struct.h"
X
Xdummy()
X{
X  return(0);
X}
X
Xdeliver_it(fd, str, len)
Xint fd, len;
Xchar *str;
X{
X  int retval;
X  alarm(WRITEWAITDELAY);
X  retval = write(fd, str, len);
X  alarm(0);
X  return(retval);
X}
X
SHAR_EOF
chmod 0600 bsd.c || echo "restore of bsd.c fails"
set `wc -c bsd.c`;Sum=$1
if test "$Sum" != "853"
then echo original size 853, current size $Sum;fi
echo "x - extracting bsd.h (Text)"
sed 's/^X//' << 'SHAR_EOF' > bsd.h &&
X/*************************************************************************
X ** bsd.h  Beta  v2.0    (22 Aug 1988)
X **
X ** This file is part of Internet Relay Chat v2.0
X **
X ** Author:           Jarkko Oikarinen 
X **         Internet: jto at tolsun.oulu.fi
X **             UUCP: ...!mcvax!tut!oulu!jto
X **           BITNET: toljto at finou
X **
X ** Copyright (c) 1988 University of Oulu, Computing Center
X **
X ** All rights reserved.
X **
X ** See file COPYRIGHT in this package for full copyright.
X ** 
X *************************************************************************/
X
X#if HPUX
X#include <string.h>
X#define index         strchr
X#define rindex        strrchr
X#define bcopy(a,b,s)  memcpy(b,a,s)
X#define bzero(a,s)    memset(a,0,s)
Xextern char *strchr(), *strrchr();
Xextern char *inet_ntoa();
X#else 
X#include <strings.h>
X#endif
X#include <ctype.h>
X#include <pwd.h>
SHAR_EOF
chmod 0600 bsd.h || echo "restore of bsd.h fails"
set `wc -c bsd.h`;Sum=$1
if test "$Sum" != "866"
then echo original size 866, current size $Sum;fi
echo "x - extracting c_bsd.c (Text)"
sed 's/^X//' << 'SHAR_EOF' > c_bsd.c &&
X/*************************************************************************
X ** c_bsd.c  Beta  v2.0    (22 Aug 1988)
X **
X ** This file is part of Internet Relay Chat v2.0
X **
X ** Author:           Jarkko Oikarinen 
X **         Internet: jto at tolsun.oulu.fi
X **             UUCP: ...!mcvax!tut!oulu!jto
X **           BITNET: toljto at finou
X **
X ** Copyright (c) 1988 University of Oulu, Computing Center
X **
X ** All rights reserved.
X **
X ** See file COPYRIGHT in this package for full copyright.
X ** 
X *************************************************************************/
X
Xchar c_bsd_id[] = "c_bsd.c v2.0 (c) 1988 University of Oulu, Computing Center";
X
X#include "struct.h"
X#if HPUX
X#include <time.h>
X#else
X#include <sys/time.h>
X#endif
X#include <sys/types.h>
X#include <sys/socket.h>
X#include <sys/file.h>
X#include <sys/ioctl.h>
X#include <netinet/in.h>
X#include <netdb.h>
X#include <stdio.h>
X#include <signal.h>
X#include <fcntl.h>
X#include <curses.h>
X#if BSD42 || ULTRIX || HPUX
X#include "sock.h"
X#endif
X#include "sys.h"
X
X#define STDINBUFSIZE (0x80)
X
Xextern struct Client me;
Xint
Xclient_init(host, portnum)
Xchar *host;
Xint portnum;
X{
X  int sock, tryagain = 1;
X  static struct hostent *hp;
X  static struct sockaddr_in server;
X
X  gethostname(me.host,HOSTLEN);
X
X  /* FIX:  jtrim at duorion.cair.du.edu -- 3/4/89 
X     and jto at tolsun.oulu.fi -- 3/7/89 */
X
X  while (tryagain) {
X    sock = socket(AF_INET, SOCK_STREAM, 0);
X    if (sock < 0) {
X      perror("opening stream socket");
X      exit(1);
X    }
X    server.sin_family = AF_INET;
X    
X    /* MY FIX -- jtrim at duorion.cair.du.edu   (2/10/89) */
X    if ( isdigit(*host))
X      {
X	server.sin_addr.s_addr = inet_addr(host);
X      }
X    else
X      { 
X	hp = gethostbyname(host);
X	if (hp == 0) {
X	  fprintf(stderr, "%s: unknown host", host);
X	  exit(2);
X	}
X	bcopy(hp->h_addr, &server.sin_addr, hp->h_length);
X      }
X    server.sin_port = htons(portnum);
X    /* End Fix */
X    
X    if (connect(sock, (struct sockaddr *) &server, sizeof(server)) < 0) {
X	if (!strcmp(host, me.host) && tryagain == 1)  /* Is this MY host? */
X	  {
X	    if (fork() == 0)   /* - server is SUID/SGID to ME so it's my UID */
X	      {
X		execl(MYNAME, "ircd", (char *)0);
X		exit(1);
X	      }
X	    printf("Connection refused at your own host!\n");
X	    printf("Rebooting IRCD Daemon and trying again....\n");
X	    printf("Wait a moment...\n");
X	    close(sock);
X	    sleep(5);
X	    tryagain = 2;
X	  } else {
X	    perror("irc");
X	    exit(1);
X	  }
X      } else
X	tryagain = 0;
X    }
X  return(sock);
X}
X/* End Fix */
X
Xclient_loop(sock)
Xint sock;
X{
X  int i = 0, size, pos;
X  char apubuf[STDINBUFSIZE+1], ch;
X  fd_set ready;
X  do {
X    ready.fds_bits[0] = (1 << sock) | 1;
X    move(LINES-1,i); refresh();
X    if (select(sock+1, &ready, 0, 0, NULL) < 0) {
X/*      perror("select"); */
X      continue;
X    }
X    if (ready.fds_bits[0] & (1 << sock)) {
X      if ((size = read(sock, apubuf, STDINBUFSIZE)) < 0)
X	perror("receiving stream packet");
X      if (size == 0) return(-1);
X      dopacket(&me, apubuf, size);
X    }
X    if (ready.fds_bits[0] & 1) {
X      if ((size = read(0, apubuf, STDINBUFSIZE)) < 0) {
X	move(0,0);
X	addstr("\rFATAL ERROR: End of stdin file !\n\r");
X	refresh();
X	return;
X      }
X      for (pos = 0; pos < size; pos++) {
X	i=do_char(apubuf[pos]);
X	move(LINES-1, i);
X      }
X    }
X  } while (1);
X}
SHAR_EOF
chmod 0600 c_bsd.c || echo "restore of c_bsd.c fails"
set `wc -c c_bsd.c`;Sum=$1
if test "$Sum" != "3319"
then echo original size 3319, current size $Sum;fi
echo "x - extracting c_msg.c (Text)"
sed 's/^X//' << 'SHAR_EOF' > c_msg.c &&
X/*************************************************************************
X ** c_msg.c    Beta v2.0    (22 Aug 1988)
X **
X ** This file is part of Internet Relay Chat v2.0
X **
X ** Author:           Jarkko Oikarinen
X **         Internet: jto at tolsun.oulu.fi
X **             UUCP: ...!mcvax!tut!oulu!jto
X **           BITNET: toljto at finou
X **
X ** Copyright (c) 1988 University of Oulu, Computing Center
X **
X ** All rights reserved.
X **
X ** See file COPYRIGHT in this package for full copyright.
X **
X *************************************************************************/
X 
Xchar c_msg_id[] = "c_msg.c v2.0 (c) 1988 University of Oulu, Computing Center";
X
X#include "struct.h"
X#include "msg.h"
X#include <curses.h>
X
Xchar mybuf[513];
Xchar abuf1[20], abuf2[20], abuf3[20], abuf4[20];
X
Xextern struct Ignore *find_ignore();
Xextern char *center();
Xextern struct Client *client;
X
Xm_restart() {
X  putline("*** Oh boy... somebody wants *me* to restart... exiting...\n");
X  sleep(5);
X  exit(0);
X}
X
Xm_time() {
X  putline("*** Received time message..!");
X}
X
Xm_admin() {
X  putline("*** Received time message..!");
X}
X
Xm_trace() {
X  putline("*** Received trace message..!");
X}
X
Xm_rehash() {
X  putline("*** Received rehash message..!");
X}
X
Xm_die() {
X  exit(-1);
X}
X
Xm_pass() {
X  putline("*** Received Pass message !");
X}
X
Xm_oper() {
X  putline("*** Received Oper message !");
X}
X
Xm_names() {
X  putline("*** Received Names message !");
X}
X
Xm_wall(sptr, cptr, sender, message) 
Xstruct Client *sptr, *cptr;
Xchar *sender, *message;
X{
X  sprintf(abuf1, "*** #%s# %s", sender, message);
X  putline(abuf1);
X}
X
Xm_connect() {
X  putline("*** Received Connect message !");
X}
X
Xm_ping(sptr, cptr, sender, para1, para2) 
Xstruct Client *sptr, *cptr;
Xchar *sender, *para1, *para2;
X{
X  if (para2 && *para2)
X    sendto_one(client, "PONG %s@%s %s", client->username, client->host, para2);
X  else
X    sendto_one(client, "PONG %s@%s", client->username, client->host);
X}
X
Xm_pong(sptr, cptr, sender, para1, para2)
Xstruct Client *sptr, *cptr;
Xchar *sender, *para1, *para2;
X{
X  sprintf(mybuf, "*** Received PONG message: %s %s",
X	  para1, (para2) ? para2 : "");
X  putline(mybuf);
X}
X
Xm_nick(sptr, cptr, sender, nickname)
Xstruct Client *sptr, *cptr;
Xchar *sender, *nickname;
X{
X  sprintf(mybuf,"*** Change: %s is now known as %s", sender, nickname);
X  putline(mybuf);
X}
X
Xm_away(sptr, cptr, sender, text)
Xstruct Client *sptr, *cptr;
Xchar *sender, *text;
X{
X  sprintf(mybuf,"*** %s is away: \"%s\"",sender,text);
X  putline(mybuf);
X}
X
Xm_who() { 
X  putline("*** Oh boy... server asking who from client... exiting...");
X}
X
Xm_whois() {
X  putline("*** Oh boy... server asking whois from client... exiting...");
X}
X
Xm_user() {
X  putline("*** Oh boy... server telling me user messages... exiting...");
X}
X
Xm_server(sptr, cptr, sender, serv) 
Xstruct Client *cptr, *sptr;
Xchar *sender, *serv;
X{
X  sprintf(mybuf,"*** New server: %s", serv);
X  putline(mybuf);
X}
X
Xm_list() {
X  putline("*** Oh boy... server asking me channel lists... exiting...");
X}
X
Xm_topic(sptr, cptr, sender, topic)
Xstruct Client *sptr, *cptr;
Xchar *sender, *topic;
X{
X  putline("*** Oh boy... server telling me the topic... exiting...");
X}
X
Xm_channel(sptr, cptr, sender, ch)
Xstruct Client *cptr, *sptr;
Xchar *sender, *ch;
X{
X  if (ch == (char *) 0 || *ch == '\0' || atoi(ch) == 0)
X    sprintf(mybuf,"*** Change: %s has left this Channel", sender);
X  else
X    sprintf(mybuf,"*** Change: %s has joined this Channel (%d)", 
X	    sender, atoi(ch));
X  putline(mybuf);
X}
X
Xm_version(sptr, cptr, sender, version)
Xstruct Client *cptr, *sptr;
Xchar *sender, *version;
X{
X  sprintf(mybuf,"*** Version: %s", version);
X  putline(mybuf);
X}
X
Xm_bye()
X{
X  echo();
X  nocrmode();
X  clear();
X  refresh();
X  exit(-1);    
X}
X
Xm_quit(sptr, cptr, sender)
Xstruct Client *sptr, *cptr;
Xchar *sender;
X{
X  sprintf(mybuf,"*** Signoff: %s", sender);
X  putline(mybuf);
X}
X
Xm_kill() {
X  putline("*** Received KILL message");
X}
X
Xm_info(sptr, cptr, sender, info)
Xstruct Client *cptr, *sptr;
Xchar *sender, *info;
X{
X  sprintf(mybuf,"*** Info: %s", info);
X  putline(mybuf);
X}
X
Xm_links() { 
X  putline("*** Received LINKS message");
X}
X
Xm_summon() {
X  putline("*** Received SUMMON message");
X}
X
Xm_stats() {
X  putline("*** Received STATS message");
X}
X
Xm_users() {
X  putline("*** Received USERS message");
X}
X
Xm_help() {
X  putline("*** Received HELP message");
X}
X
Xm_squit(sptr, cptr, sender, server)
Xstruct Client *cptr, *sptr;
Xchar *sender, *server;
X{
X  sprintf(mybuf,"*** Server %s has died. Snif.", server);
X  putline(mybuf);
X}
X
Xm_whoreply(sptr, cptr, sender, channel, username, host, server,
X	   nickname, away, realname)
Xstruct Client *sptr, *cptr;
Xchar *sender, *channel, *username, *host, *server, *nickname, *away;
Xchar *realname;
X{
X  int i = atoi(channel);
X  if (username)
X    center(abuf1, username, 8);
X  else
X    abuf1[0] = '\0';
X  if (host)
X    center(abuf2, host, 8);
X  else
X    abuf2[0] = '\0';
X  if (server)
X    center(abuf3, server, 8);
X  else
X    abuf3[0] = '\0';
X  if (nickname)
X    center(abuf4, nickname, 8);
X  else
X    abuf4[0] = '\0';
X  if (i != 0)
X    sprintf(mybuf,"Channel %3d: %8s@%8s %8s (%8s) %s %s",i ,abuf1, abuf2,
X	    abuf3, abuf4, away, realname);
X  else
X    sprintf(mybuf,"* Private *: %8s@%8s %8s (%8s) %s %s", abuf1, abuf2,
X	    abuf3, abuf4, away, realname);
X  putline(mybuf);
X}
X
Xm_mytext(sptr, cptr, sender, buf)
Xstruct Client *sptr, *cptr;
Xchar *sender, *buf;
X{
X  if (sender)
X    sprintf(mybuf,"<%s> %s", sender, buf);
X  else
X    sprintf(mybuf,"> %s",buf);
X  putline(mybuf);
X}
X
Xm_text(sptr, cptr, sender, buf)
Xstruct Client *sptr, *cptr;
Xchar *buf, *sender;
X{
X  struct Ignore *iptr;
X  if ((iptr = find_ignore(sender, (struct Ignore *) 0)) &&
X      (iptr->flags & IGNORE_PUBLIC))
X      return(0);
X  if (sender && sender[0]) {
X    sprintf(mybuf,"<%s> %s", sender, buf);
X    putline(mybuf);
X  } else
X    putline(buf);
X}
X
Xm_namreply(sptr, cptr, sender, buf, buf2, buf3)
Xstruct Client *sptr, *cptr;
Xchar *buf, *sender, *buf2, *buf3;
X{
X  if (buf) {
X    switch (*buf) {
X      case '*':
X	sprintf(mybuf,"*** %-3s %s", buf2, buf3);
X        break;
X      case '=':
X        sprintf(mybuf,">>> %-3s %s", buf2, buf3);
X        break;
X      case '@':
X        sprintf(mybuf,"%%%%%% %-3s %s", buf2, buf3);
X        break;
X      default:
X        sprintf(mybuf,"??? %-3s %s", buf2, buf3);
X        break;
X    }
X  } else
X    sprintf(mybuf, "*** Internal Error: namreply");
X  putline(mybuf);
X}
X
Xm_linreply(sptr, cptr, sender, buf, buf2)
Xstruct Client *sptr, *cptr;
Xchar *buf, *sender, *buf2;
X{
X  sprintf(mybuf,"*** Server: %s (%s)", buf, buf2);
X  putline(mybuf);
X}
X
Xm_myprivate(sptr, cptr, sender, buf, buf2)
Xstruct Client *sptr, *cptr;
Xchar *buf, *buf2, *sender;
X{
X  sprintf(mybuf,"-> *%s* %s",buf,buf2);
X  putline(mybuf);
X}
X
Xm_private(sptr, cptr, sender, buf, buf2)
Xstruct Client *sptr, *cptr;
Xchar *buf, *buf2, *sender;
X{
X  struct Ignore *iptr;
X  if ((iptr = find_ignore(sender, (struct Ignore *) 0)) &&
X      (iptr->flags & IGNORE_PRIVATE)) {
X	sendto_one(client,
X		   "PRIVMSG %s :*** Automatic reply: You have been ignored");
X	return(0);
X      }
X  if (sender && sender[0]) {
X    if ((buf[0] >= '0' && buf[0] <= '9') || buf[0] == '-')
X      sprintf(mybuf,"(%s) %s", sender, buf2);
X    else
X      sprintf(mybuf,"*%s* %s", sender, buf2);
X    putline(mybuf);
X  }
X  else
X    putline(buf2);
X}
X
Xm_invite(sptr, cptr, sender, buf, buf2)
Xstruct Client *sptr, *cptr;
Xchar *buf, *buf2, *sender;
X{
X  struct Ignore *iptr;
X  if ((iptr = find_ignore(sender, (struct Ignore *) 0)) &&
SHAR_EOF
echo "End of part 2"
echo "File c_msg.c is continued in part 3"
echo "3" > s2_seq_.tmp
exit 0



More information about the Alt.sources mailing list