Internet Relay Chat (IRC) Part 1/6

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


Here is Internet Relay Chat, or IRC.  It is one of a few multi person
chat programs that have recently come about which use internet sockets
to form a large network of servers and clients that span the US and
Europe  (the author is Finnish and there is a large network tree in
that country).


IRC has been hacked on for more than a year now, and the author
(jto at tolsun.oulu.fi) would like to come out with its "final" version
soon.  This final version will be posted to comp.sources.unix when
people decide exactly just what it is going to be.  One of the newest
improvements is an emacs style front end.

This source and all new versions (including the emacs one, irc.el)
are available by anonymous ftp to tolsun.oulu.fi [128.214.5.6], in
the directory irc.

If you get things set up, you will need an host to connect to.  This
should be the site closest (usually geographicly) to you in the irc network.
You will need to get their permission to use their server.  When is doubt,
write to irclist at tolsun.oulu.fi for the server nearest you.

Good luck!

David Bleckmann
UUCP: {tektronix,hp-pcd}!orstcs!jacobs.cs.orst.edu!bleckmd
Internet/CSNet: bleckmd at jacobs.cs.orst.edu
  or:bleckmd%jacobs.cs.orst.edu at orstcs.cs.orst.edu
US Mail: 861 SW Adams #3
	 Corvallis, OR  97333

---- Cut Here and unpack ----
#!/bin/sh
# shar:	Shell Archiver  (v1.22)
#	Packed Mon Jun 19 19:28:32 PDT 1989 by jacobs.CS.ORST.EDU!bleckmd
#	from directory /u1/bleckmd/net/irc.6
#
# This is part 1 of a multipart archive                                    
# do not concatenate these parts, unpack them in order with /bin/sh        
#
#	Run the following text with /bin/sh to create:
#	  ADVERTISEMENT
#	  COPYRIGHT
#	  Comms
#	  INSTALL
#	  MANUAL
#	  Makefile
#	  README
#	  bsd.c
#	  bsd.h
#	  c_bsd.c
#	  c_msg.c
#	  c_sysv.c
#	  card.c
#	  card.h
#	  channel.c
#	  conf.c
#	  date.c
#	  debug.c
#	  deck.c
#	  edit.c
#	  example.conf
#	  help.c
#	  help.h
#	  ignore.c
#	  irc.1
#	  irc.c
#	  ircd.8
#	  ircd.c
#	  list.c
#	  main.c
#	  msg.h
#	  packet.c
#	  parse.c
#	  r_bsd.c
#	  r_msg.c
#	  s_bsd.c
#	  s_msg.c
#	  s_sysv.c
#	  screen.c
#	  send.c
#	  sock.h
#	  str.c
#	  struct.h
#	  swear.c
#	  sys.h
#	  sysv.c
#	  sysv.h
#
if test -r s2_seq_.tmp
then echo "Must unpack archives in sequence!"
     next=`cat s2_seq_.tmp`; echo "Please unpack part $next next"
     exit 1; fi
echo "x - extracting ADVERTISEMENT (Text)"
sed 's/^X//' << 'SHAR_EOF' > ADVERTISEMENT &&
X                                                Author: Jeff Trim
X                                                        jtrim at orion.cair.du.edu
X                                                  Date: 04 Apr 1989
X                                     Last modification: 04 Apr 1989
X
X                 The Internet Relay Chat Program  -  IRC
X
XHave you ever wanted to talk with other computer users in other parts of
Xthe world?  Well guess what?  You can!  The program is called IRC and
Xit is networked over much of the United States, Finland, Sweden and very
Xsoon I think it's going to appear in the United Kingdom.  This program
Xis a substitution for talk(1), chat(1), vco(1) and many other multiple
Xtalk programs you might have read about.  When you are talking in IRC, 
Xeverything you type will instantly be transmitted around the world to
Xother users that might be watching their terminals at the time - they can
Xthen type something and RESPOND to your messages - and vise versa.  I will
Xtell you that the program can be very addictive once you begin to make
Xfriends and contacts on IRC ;)  .. and the Finnish people are as curious
Xabout Amercians as we are about them - so the topics can become very 
Xinteresting sometimes.  I think I have talked about everything from Politics
Xto Living expenses in the United States - in return they have told me about
Xlife in Finnland (which is quite interesting!) - I even know a few Finnish
Xcurse words - but we won't go into those ;)
X
XThe first step to beginning to getting aquinted to IRC is to throw off the
Xfear of embarrising yourself -- the fact of the matter is that the people
Xon the other end of the terminal are as scared as you are.  The Finnish
Xpeople speak VERY GOOD english, so you can feel comfortable speaking to
Xthem in english.  (I will add, however, that it's also interesting to see
Xhow they communicate in Finnish - some of their words can be 25 characters
Xlong - and I am talking just one word!)  When you /join a conference and 
Xthey recognize that you are an english speaking person they always nicely
Xswitch immediately into english - they are very cordial about that.  But
Xbe aware that finnish is their native language so they might stumble a bit
Xon some of our english counter parts  (especially english SLANG words).
XAlso you might need to give them a second or too to make the switch into
Xenglish because there might be a heated argument going on when you /join 
Xthe conference and they need time to finish what they are saying.
X
XBeyond the Finnish there are users from Oregon State University, Ohio State
XUniversity, MIT, Northwestern State University and we even picked up a
Xsite from NASA about a week ago.  At my last count there were 22 servers
Xrunning 24 hours aday all over the US/Finland - so you can loggin just
Xabout any time of day and find people talking on IRC (as a side note - the
XFinnish are 9 Hours ahead of us -- meaning when it's 11:00pm at night in Denver
Xit's 8:00am THE NEXT DAY in Finland!)  You should note that late afternoon
Xin Denver is EARLY in the morning for the Finnish ;)  But the US users
Xshould keep the same time schedual you have (keeping in mind Mountain Time,
XCentral Time, Pacific Time, ...etc).  
X
XWHAT DO I TALK ABOUT?
X
XThat is the most common question I get so I will answer it now.  Sometimes
Xyou'll notice that all conversation STOPS and you know everyone is waiting
Xon everyone else to say something - so this is a good time to talk about
XNews, weather or whatever -- best thing is to ask a question - like "How's
Xthe weather in finland?", "What's TV like in Finland?", "Did you know that
Xan Oil Tanker just spilt oil all over the Alaskan sea-shore?".  If things
Xget real desperate say something like "well why don't we choose a topic?"
X..then you should also try to think up something, maybe a good topic over
Xyour favoite beer, Broncos mainia (I haven't explained that to the Finnish
Xyet (I still don't get it) ;), Denver, skiing, computers, people, vacation
Xspots, travel, cars, housing, whatever you can think of.  ..but be assertive.
X
X
XA finally note is about IRC protocol.  Try not to CUSS out the other users
X(meaning use your best english - keep your laungauge printable ;), and
Xwhen you are going to LEAVE IRC - say "goodbye" and give the other users
Xabout 30 seconds to in turn say their goodbye's.  Never just /signoff 
Xbecause it makes the other users think you didn't like what they were
Xsaying - so try to leave on a good note.  A finally you should be aware
Xthat the program does allow <CTRL>G's (The ASCII BELL character).  They
Xare used only when absolutely necessary - and usually in PRIVATE messages
Xonly - so please restrict them to that.  If you need to wake up a sleeping
Xuser (IE one that's away from his terminal for awhile) then send him a few
X^G's (like 2) and wake him up in private message.  Don't post ^G's in
Xpublic messages.
X
X
XRUNNING THE PROGRAM:
X
XI have it set up currently on the 3 academic UNIXES - on EOS/TYCHE/ORION
Xtype: "irc".  I am Posting the IRC User Manual in the next posting so 
Xplease read that to get familiar with IRC and the various commands.  if
Xyou want help in the program type "/help".  If you see a topic you want to
Xread about then type "/help <topic>", like "/help who".  But anyway to
Xrun the program type:
X
X      irc
X
XIf you have any questions at all feel free to write me a note.  I am the
Xcurrent IRC Adminestrator for The University of Denver so I can answer 
Xall of your questions.  I am "jtrim at orion.cair.du.edu".
X
XThe program was written by "Jarkko Oikarinen" - and in IRC you can usually
Xfind him as NICKNAME "Wiz".
SHAR_EOF
chmod 0600 ADVERTISEMENT || echo "restore of ADVERTISEMENT fails"
set `wc -c ADVERTISEMENT`;Sum=$1
if test "$Sum" != "5597"
then echo original size 5597, current size $Sum;fi
echo "x - extracting COPYRIGHT (Text)"
sed 's/^X//' << 'SHAR_EOF' > COPYRIGHT &&
X/*****************************************************************************
X **
X ** IRC - Internet Relay Chat 
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 1988, 1989 by University of Oulu, Computing Center
X **
X ** All rights reserved
X **
X ** Permission is hereby granted to use and distribute this program freely.
X ** Permission to use this program for commercial purposes and in
X ** commercial Bulletin Board or similar systems is not given.
X ** Permission to modify this program and distribute modified version is
X ** not given. This copyright notice may not be modified or removed.
X **
X ** IRC is provided 'as is', without warranty of any kind, either
X ** expressed or implied, including, but not limited to, the implied
X ** merchantability and fitness for a particular purpose. The entire
X ** risk as to the quality and performance of the program is with you.
X ** Should the IRC program prove defective, you assume the cost of all
X ** necessary servicing, repair or correction.
X **
X ** All bug reports and suggestions for improvements etc. are welcome.
X **
X ****************************************************************************/
SHAR_EOF
chmod 0600 COPYRIGHT || echo "restore of COPYRIGHT fails"
set `wc -c COPYRIGHT`;Sum=$1
if test "$Sum" != "1280"
then echo original size 1280, current size $Sum;fi
echo "x - extracting Comms (Text)"
sed 's/^X//' << 'SHAR_EOF' > Comms &&
X					 	   Author: Jarkko Oikarinen
X						     Date: 3 Sep 1988
X					Last modification: 16 Mar 1989
X
X		     Internet Relay Chat Protocol
X
X1. Introduction
X
XThis document defines the protocol how IRC messages are transmitted
Xover Internet. IRC is a teleconferencing system which can run on
Xmany different hosts.
X
X1.1. Servers
X
XIRC consists of several servers, of which there should be only one
Xon each host (It is not recommended to use several servers, it is
Xpossible anyway). Servers are connected with each other so that they
Xform a tree-like net. [See Fig. 1]. This protocol defines no limit
Xhow many servers (or clients) one server can handle, it is machine
Xand server dependent. The name of the server is the same as the
Xname of the host where server is running.
X
X			     [ Server 1 ]
X			      /        \
X			     /          \
X                  [ Server 2 ]           [ Server 3 ]
X                    /       \                      \
X                   /         \                      \
X           [ Server 4 ]    [ Server 5 ]         [ Server 6 ]
X            /    |    \                           /      \
X           /     |     \                         /        \
X          /      |      \____                   /          \
X         /       |           \                 /            \
X[ Server 7 ] [ Server 8 ] [ Server 9 ]   [ Server 10 ] [ Server 11 ]
X                                 
X				  :
X			       [ etc. ]
X				  :
X			
X                 [ Fig. 1. Format of IRC Server net ]
X
X1.2. Clients
X
XIn this paper every conference attendant is referred to as client.
XEach client is distinguished from others with a nickname having
Xmaximum length of eight (8) characters. The following characters
Xmay be used in a nickname: all digits ('0' - '9'), lowercase letters
X('a' - 'z'), uppercase letters ('A' - 'Z'). In addition to nickname
Xservers should have following information on clients: Real name,
Xname of the host client is logged on, client's username on that host
Xand name of the server to which client is connected.
X
X
X1.3. Channels
X
XChannels are the way several (more that two) clients can communicate
Xwith each other. Every channel has a name with which it can be
Xunambiguously distinguished from other channels. Channel name is an
X32-bit integer number. Channels are divided into three groups:
XChannels with negative name are secret channels, and users on those
Xchannels are not shown to other users unless they are on same channel.
XChannels with name in between 1-999 are public channels, and users
Xand their channel names are shown to everyone. Channels 1000 - are
Xprivate channels, and users on these channels may be seen, but not
Xthe number of the channel. This system is not perfectly secure (nor
Xit is meant to be like that) because channel name can always be guessed.
X
X1.4. Services
X
XServices are used to allow servers and clients use certain databases
Xover IRCnet. These databases are mainly used to maintain access lists
Xfor servers and clients; that is, servers can query service and get
Xa list of other servers and clients that should be allowed to connect.
XThere may be several (even similar) services connected to net at the
Xsame time.
X
X2. The IRC Specification
X
X2.1. Overview
X
XThis protocol is only an interface between server and client programs.
XIt does not perform any user interaction, messages may have quite cryptic
Xformat. Client and service programs should perform all 'user-friendly'
Xfunctions.
X
X2.2. Character codes
X
XCommands are composed of characters from the ASCII character set.
XWhen the transport service provides an 8-bit byte (octet) transmission
Xchannel, each 7-bit character is transmitted right justified in an
Xoctet with the high order bit cleared to zero.
X
X2.3. Messages
X
XDaemons and Clients send each other messages which may or may not
Xgenerate a reply. Daemons normally should generate a reply for each message,
Xbut clients should not trust on it and await forever.
X
XMessages consist of prefix, a command, and parameters. Prefix
Xand parameters may be optional. Parameters are separated from
Xeach other with one space character. Prefix is separated from
Xcommand with space. Prefix is only used messages from servers to
Xidentify the original sender of the message. Client programs should
Xnever use prefixes. Command lines must be complete with all required
Xparameters, and may not contain more than one command. Commands,
Xprefixes and parameters are not case sensitive. The prefix is preceded
Xby a colon. 
X
XIRC Messages are always lines of characters terminated with CR-LF
X(Carriage Return - Line Feed) pair, and these messages shall not
Xexceed 512 characters in length, counting all characters, including
Xthe trailing CR-LF (thus there are 510 characters maximum allowed
Xfor the command and its parameters). There is no provision for
Xcontinuation message lines.
X
X2.4. Replies
X
XMost messages sent to daemon generate normally a reply. Reply consists
Xof three digits, space, comment and CR-LF combination. List of different
Xreplies will be on chapter 6. Replies are not yet implemented.
X
X3. Message details
X
XOn the following pages are descriptions of each message recognized
Xby the IRC server and client. All commands not explicitly marked as
Xoptional must be implemented by all IRC servers. The concept of
Xcurrent channel is used there several times and it is the channel
Xmessage sender is currently joined.
X
X3.1. User message
X
X   Command: USER
XParameters: <username> <hostname> <servername> <realname>
X
XUser message is used in the beginning of connection to specify username,
Xhostname, servername and realname of new user. It also used in
Xcommunication between servers to indicate new user arriving IRC.
X
XIt must be noted that Realname parameter must be the last parameter,
Xbecause it may contain space characters.
X
XExamples:
X
XMessage to identify client (note that hostname parameter is not needed,
Xbecause server always knows where user is from):
X USER guest tolmoon tolsun Ronnie Reagan
X 
X3.2. Server message
X
X   Command: SERVER
XParameters: <hostname> [<server> | <password>]
X
XServer message is used to tell server that on the other end of connection
Xresides a server. This message is also used to pass server data over
Xwhole net. Always when a new server is connected to net, info about
Xit should go through whole network.
X
XExample:
X  SERVER testhost                ; tells server I am testhost
X  SERVER tolmoon tolsun          ; tells server that behind me
X                                 ; resides a server tolmoon who is
X                                 ; connected to server at tolsun
X
X3.3. Oper message
X
X   Command: OPER
XParameters: <user> <password>
X
XOper message is used by normal user to obtain operator privileges.
X
X3.4. Password message
X
X   Command: PASS
XParameters: <password>
X
XPassword message is used to give password if secure version of irc is used.
X
X3.5. Nick message
X
X   Command: NICK
XParameters: <nickname>
X
XNICK message is used to give user a nickname.
X
X3.6. Quit message
X
X   Command: QUIT
XParameters: none
X
XThe session is finished with a quit message.
X
X3.7. Squit message
X
X   Command: SQUIT
XParameters: <server>
X
XSquit message is needed to tell about quitting or died servers.
X
X3.8. Text message
X
X   Command: MSG
XParameters: <text to be sent to channel>
X
XText message is needed to send message to all users on current channel.
X
XExamples:
X :Wiz MSG This is text message to the channel Wiz is logged on.
X MSG Another message to be sent to current channel !
X
X3.9. Private message
X
X   Command: PRIVMSG
XParameters: <receiver> <text to be sent>
X
XPrivate message is used to send private messages between users.
X<receiver> is the nickname of the receiver of the message.
X
XExamples:
X :Angel PRIVMSG Wiz Hello, are you receiving this message ?
X PRIVMSG Angel yes, I'm receiving !
X PRIVMSG jto at tolsun.oulu.fi Hello!
X
X3.10. Who message
X
X   Command: WHO
XParameters: [<channel>]
X
XWho message is used to query all users on IRC net. Server will answer
Xthis message with series of WHOREPLY messages. However it must be noted
Xthat the response may not come at once, and client must be able to accept
Xother messages before receiving user message. Channel is the number of
Xthe channel or an asterisk '*' to specify current channel. If <channel>
Xis omitted, all users (not the ones on secret channels) are shown.
X
XExamples:
X WHO
X
X3.11. Whois message
X
X   Command: WHOIS
XParameters: <nickname>
X
XThis message is used to query information about particular user. Server
Xwill answer this message with two text messages.
X
XExamples:
X WHOIS wiz
X WHOIS jto at tolsun.oulu.fi
X
X3.12. List message
X
X   Command: LIST
XParameters: [<channel>]
X
XList message is used to list channels and their topics. If <channel>
Xparameter is used, only status of that channel is displayed. Negative
Xchannels do not have topics, so negative channel is not allowed here.
X
XExamples:
X LIST                              ; List all channels
X LIST 7                            ; List channel 7
X LIST *                            ; List current channel
X
X3.13. Topic message
X
X   Command: TOPIC
XParameters: <topic>
X
XTopic message is used to change topic of current channel.
X
XExamples:
X :Wiz TOPIC New topic
X TOPIC Another topic
X
X3.14. Invite message
X        
X   Command: INVITE
XParameters: <nickname> [<channel>]
X
XInvite message is used to invite users on channel. Parameter
X<nickname> is the nickname of the person to be invited, or his/hers
XUserID. E.g. jto at tolsun.oulu.fi is a syntactically valid UserID. Channel
Xparameter is optional in messages from clients, but necessary
Xin messages from servers.
X
XExamples:
X :Angel INVITE Wiz 7
X INVITE Wiz -13
X
X3.15. Channel message
X
X   Command: CHANNEL
XParameters: <channel> [<flag>]
X
XChannel message is the way to change channel in IRC. There are three types
Xof channels: Channel numbers from 1 to 999 are public channels, ie: everyone
Xsees who are in there. Channel numbers > 1000 are secret channels, so
Xif somebody is on channel > 1000, you can see that he is in there, but
Xyou cannot see the channel number. Channels < 1000 are hidden channels,
Xyou cannot see users in there (and of course channel number either).
X
XExamples:
X :Wiz CHANNEL -13
X CHANNEL 7
X
X3.16. Version message
X
X   Command: VERSION
XParameters: [<server>]
X
XVersion message is used to query version of the server program.
XOptional parameter <server> is used to query version of the server
Xprogram on another host.
X
X3.17. Kill message
X
X   Command: KILL
XParameters: <nickname>
X
XOnly Operators may kill other users with kill message. 
X
X3.18. Stats message
X
X   Command: STATS
XParamaters: [<server>]
X
XStats message is used to query statistics of certain server. If <server>
Xparameter is omitted, current server processes this message.
X
X3.19. Service message
X
X   Command: SERVICE
XParamaters: <name>
X
XService command is used by a service to identify himself to server.
XName is the name of the service. Service which knows about IRCnet
Xtopology and connections between servers is called 'IRC' and servers
Xshould query their data from that service from time to time.
X
X3.20. Query message
X
X   Command: QUERY
XParamaters: <server> <service> <parameters>
X
XQuery message is used to send messages to services. Service responds
Xto queries by REPLY command. IRC service should be specifically noted
Xas that service which spreads access lists to each server in IRCnet.
X<server> parameter specifies the name of that server who sent that query,
X<service> is the name of the service and <parameters> may have a different
Xsyntax depending on which service the query is directed to.
X
X3.21. Links message
X
X   Command: LINKS
XParamaters: none
X
XWith links message user can list all servers and their connections on
XIRC net. LINKS message is replied by LINREPLY message by the server.
X
X3.22. Summon message
X
X   Command: SUMMON
XParameters: <user>
X
XSummon command is used to invite users not in IRC. <user> parameter
Xconsists of username and host separated with '@' sign, eg. jto at tolsun
X
X3.23. Users message
X
X   Command: USERS
XParameters: <host>
X
XWith USERS command it is possible to query users on another host.
X
X3.24. Notice message
X
X   Command: NOTICE
XParameters: <nickname> <text>
X
XNOTICE message is used similarly to PRIVMSG. The difference between NOTICE
Xand PRIVMSG is that automatic replies, etc. may NEVER reply to notice
Xmessage. Notice messages are generally used only by servers, but may
Xalso be used by client. Not yet implemented.
X
X3.25. Connect message
X
X   Command: CONNECT
XParameters: <host> <port>
X
XCONNECT message can be used to force a server to try to establish a new
Xconnection to another server immediately. CONNECT message is privileged
Xmessage and should be available only to ircd administrator(s).
X
X3.26. Ping message
X
X   Command: PING
XParameters: <daemon1> [<daemon2>]
X
XPING message must be always replied with PONG message as fast as possible.
XIf parameter <daemon2> is specified, ping gets forwarded there. <daemon1>
Xparameter specifies the querying daemon.
X
X3.27. Pong message
X
X   Command: PONG
XParameters: <daemon> [<daemon2>]
X
XPONG message is a reply to ping message. If paramater <daemon2> is given,
Xthis message must be forwarded to given daemon. <daemon> parameter is
Xthe name of the daemon who has responded to PING message and generated this
Xmessage.
X
X3.28. Reply message
X
X   Command: REPLY
XParameters: <service> <recipient> <parameters>
X
X3.29. Wall message
X
X   Command: WALL
XParameters: <msg>
X
XWALL message is used to send a broadcast message to everyone
Xconnected to IRCnet.
X
X3.30. Trace command
X
X   Command: TRACE
XParameters: [<server>]
X
XTRACE command is used to find out the route to specific server.
XEach server should process this message, tell the sender about it
Xand then send it to next server until given server is reached.
XIf <server> parameter is omitted, it is recommended that TRACE command
Xcould send a message to user telling to which servers current server
Xhas direct connection (and maybe the delay time to that server, too).
X
X3.31. Route command
X
X   Command: ROUTE
XParameters: <server1> <server2> <distance>
X
XROUTE message is sent to irc network when a connection between some
Xservers has been set up correctly. Distance tells the time delay between
Xservers so that other servers could optimize IRC network to be as fast
Xas possible and possibly alter the topology of IRC network.
X
X3.32. Linreply command
X
X   Command: LINREPLY
XParameters: <server> <location>
X
XLINKS command is replied by series of LINREPLY commands. Each LINSERVER
Xreply describes one server entry in IRC network.
X
X4. Optional messages
X
XOptional messages are described next. This means that valid and
Xworking server does not need to understand there messages. 
X
X4.1. Debug message
X
X   Command: DEBUG
X
XDebug command is reserved for testing purposes. Parameters and replies
Xare implementation specific and they are not listed here.
X
X4.2. Hide message
X
X   Command: HIDE 
XParameters: [nickname|id at host]
X
XMessages from specific nickname/id will not be displayed.
XHide without parameters hides all messages.
X
X4.3. Reset message
X
X   Command: RESET
XParameters: [nickname|id at host]
X
XResets messages from specific nickname/id to normal state, ie.
Xif HIDE or command has been issued, this removes it's effect.
XReset without any parameters undoes all previous hide messages.
X
X4.4. Status message
X
X   Command: STATUS
XParameters: [nickname|id at host]
X
XReturns status of given nickname/id. Ie. if messages are ignored
X(with HIDE command), status is HIDE. Status without parameters
Xreturns status of all changed nickname/id entries.
X
X4.5. Away message
X
X   Command: AWAY
XParameters: [message]
X
XWith away message you can set an automatic reply for messages.
XAway with parameter sets this mode on, and without parameter
Xresets modes. If away is on and somebody sends you a message,
Xresponse message is sent out automatically. Note that you cannot send
Xany messages while in away mode.
X
X4.6. Alias message
X
X   Command: ALIAS
XParameters: [nick [nick|id at host]]
X
XAlias message is used to set up aliases for some user. If you g.e.
Xspecify alias 'ALIAS Wiz jto at tolsun', all messages you send to
Xnickname Wiz are redirected to user jto at tolsun. If there already
Xexists nickname Wiz, then you cannot send messages to him/her
Xwithout first turning alias off (ALIAS Wiz). Alias without parameters
Xdisplays all current aliases.
X
X4.7. Expand message
X
X   Command: EXPAND
XParameters: [1|0]
X
XExpand message is used to switch on/off expand mode, ie. if expand mode
Xis on, then ids and hosts of message senders are given instead of bare
Xnickname. Expand mode is switched on with parameter 1 and off with
Xparameter 0. Expand called without parameters sets expand off.
X
X4.8. Die message
X
X   Command: DIE
XParameters: None
X
XDie message can be used to kill a certain server. That might be needed
Xin certain error conditions, hopefully never. Die should not be available
Xto normal users, only to ones with special privileges.
X
X4.9. Zkey message
X
X   Command: ZKEY
XParameters: <public encryption key>
X
XZkey message is used by the clients to give away their public encryption
Xkey which can then be used to encrypt private messages sent to the clients.
XThe encryption method is yet to be defined. See also ZMSG command.
X
X4.10. Zmsg message
X
X   Command: ZMSG
XParameters: <receiver> <encrypted text to be sent>
X
XZmsg message is used to send encrypted messages to users. Encryption key
Xis given with ZKEY command. Server knows that clients which have sent
Xtheir public key do accept encrypted messages, clients which have not
Xtold specifically with ZKEY that they want to have encrypted messages
Xshould never be sent them, because they probably wouldn't understand
Xthem.
X
X4.11. Time message
X
X   Command: TIME
XParameters: [<daemon>]
X
XTime message is used to query local time from given daemon. Default
Xdaemon is current daemon. Daemon should reply to this message with
XPRIVMSG or NOTICE command. (PRIVMSG as long as NOTICE is not
Ximplemented on current ircd's).
X
X4.12. Rehash message
X
X   Command: REHASH
XParameters: None
X
XRehash message can be used by the operator to force server reread
Xits irc.conf file.
X
X4.13. Names message
X
X   Command: NAMES
XParameters: [<channel>]
X
XWith names parameter you can list all nicknames on specified channel or,
Xif <channel> parameter is omitted, on all channels. If '*' is used
Xinstead of channel name, nicknames on current channel are listed.
XNAMES command is always replied by one or more NAMREPLY commands
Xcontaining channel types, names and users on channels.
X
X4.14. Namreply message
X
X   Command: NAMREPLY
XParameters: <type> <channel> {<nickname>}
X
XNAMREPLY command is a reply to NAMES command. <type> parameter is
X'*' for private channels, '=' for public channels and '?' for secret
Xchannels. <channel> is channels name. Usually NAMES query will be
Xresponded with several NAMREPLY commands, one for each public channel,
Xone for private/secret channel querying user is possibly a member and
Xthen all users on other private channels are marked as being on one
Xprivate channel, who's name is '*'.
X
XExample:
X
XNAMREPLY = 7 Angel Kilroy
XNAMREPLY * 1234 Jeff WiZ
XNAMREPLY * * Lars Karl Jim
X
XLast line indicates that Lars, Karl and Jim are on some private channel
Xor on NULL channel, they are not necessarily on same channel with each
Xother.
X
X4.15. Admin command
X
X   Command: ADMIN
XParameters: [<server>]
X
XAdmin message is used to tell the name of the administrator of given
Xserver (current server if <server> parameter is omitted). Each server
Xshould have the ability to forward ADMIN messages to other servers.
X
X5.0. Messages implemented in clients
X
XFollowing is a recommendation of messages that should be implemented in
Xclients. These messages do not actually belong to Internet Relay Chat
XProtocol, and should be used as guidelines and advices.
X
X5.1. Send message
X
X   Command: SEND
XParameters: filename
X	
XSend specified filenames contents to irc as normal messages.
XSend should not be implemented in server, but only on client.
X
X5.2. Beep message
X
X   Command: BEEP
XParameters: [2|1|0]
X
XBeep command is used to tell client that it should beep after
Xeach received line. BEEP can be set off by using '1' as a parameter
Xof calling BEEP without any parameters at all. Calling BEEP with
Xparameter 2 disables the use of BELL ('\007') completely, even
Xmessages containing BELLs are stripped from BELLs.
XBeep should not be implemented in server, but only on client.
X
X5.3. Cmdchar message
X
X   Command: CMDCH
XParameters: [char]
X
XWith this command you can set/reset the command character that
Xtells client this line is a command and not a simple message.
XCMD without parameter resets command character to '/'.
XCmd should as well be implemented only in clients.
X
X5.4. Query message
X  
X   Command: QUERY
XParameters: [user|id at host]
X
XQuery message is used specify that all folowing lines should be
Xsent to specific user as private messages. Query should be
Ximplemented in client, but may be used on servers as well.
XQuery without parameters stops sending messages as private ones
Xto some user, and sends them to current channel. QRY is only an
Xalias for QUERY.
X
X6. Replies
X
XNot implemented yet. Under construction.
X
X7. User and server authentication
X
XPasswords and host names. See the documentation for irc.conf.
SHAR_EOF
chmod 0600 Comms || echo "restore of Comms fails"
set `wc -c Comms`;Sum=$1
if test "$Sum" != "21088"
then echo original size 21088, current size $Sum;fi
echo "x - extracting INSTALL (Text)"
sed 's/^X//' << 'SHAR_EOF' > INSTALL &&
X[ Obsolete Installation file. Read README for new (and far better) document]
X
XNOTE: *READ* this file before installing ircd. 
X
XHow to INSTALL irc:
X
X1)  Scan through struct.h for machine dependent parameters and, only
X    if absolutely necessary, change the default port to a new one.
X
X2)  Check system type in Makefile
X
X3)  Run make
X
X4)  Read through example irc.conf file and set up your file.
X    You can at first just remove all links to other daemons and
X    add them when you've tested irc works ok.
X
X5)  Install irc, ircd, irc.conf, irc.1 and ircd.8 in their appropriate places.
X    Remember to install ircd as setuid program to a user who can read
X    irc.conf-file. irc.conf-file should NOT be readable by everyone.
X    If you have set up passwords for irc-client, then you should install
X    irc as a setuid program, too.
X
X6)  Check if everything seems to work:
X    Start ircd without parameters.
X    Start irc
X    Now you should be in normal irc-screen, and that means irc and ircd
X    have compiled successfully.
X
X7)  If in internet, ask from some (preferably nearest) irc-administrator
X    where you should connect your ircd to be able to chat with other hosts
X    You should get your authoritative host's domain-name and/or
X    internet address. If you do not know any irc-administrator, mail
X    a query to irc at tolsun.oulu.fi or irc%tolsun.oulu.fi at tut.fi.
X    If you're from states, you can send your queries to
X    vijay at lll-winken.llnl.gov
X
X    Then you should get an internet address and port where to connect your
X    daemon (in some cases you might get several of them) and two passwords,
X    one for other daemon to be able to log into your system and the other
X    for your daemon to be able to connect other daemon. Note that you
X    always need two passwords, both ends must have a password before
X    connection is established ok.
X
X8)  After you have got permission to connect to some other ircd,
X    start your ircd. (Remember to kill the previous one if it still is alive).
X    You should set irc so that it starts when rc.local is executed, if you
X    want to have irc running there all the time. That is; you may want to
X    add the following lines to /etc/rc.local (or some equivalent file that
X    is executed at system boot time):
X
X    if [ -f /usr/local/bin/ircd ]; then
X      /usr/local/bin/ircd & (echo -n ' ircd ') >/dev/console
X    fi
X
X    This requires of course that ircd is installed in directory
X    /usr/local/bin. 
X
X8)  Check if irc works:
X    irc
X    When irc-screen appears in front of you, type /links and see, if there
X    are other links up. If not, either irc has been started/installed
X    unsuccessfully or authoritative host/ircd is down. It is also known
X    that daemons may disconnect their links sometimes, so to be sure
X    try irc again after a half an hour or so, if it still doesn't show
X    other hosts, something is wrong somewhere... 
X
X9)  As a 'normal user' you should know about a couple of things which
X    simplify the use of irc a little bit. You can specify an environment
X    variable IRCNICK and that will become automatically your nickname
X    in irc. Also you can specify environment variable IRCSERVER and that
X    is the name of server you want to connect to. Note that these
X    variables apply only to clients, they have nothing to do when
X    starting ircdaemon (ircd).
X
XIf you encounter any bugs or other problems (you sure will have them !),
Xmail your suggestions and bug reports to me.
X
XJarkko Oikarinen            OuluBox: WIZARD     UUCP:...!mcvax!tut!oulu!jto
XInstitute of Information Processing Science    INTERNET: jto at tolsun.oulu.fi
XUniversity of Oulu, Finland                    EARN/BITNET: toljto at finou
X
SHAR_EOF
chmod 0600 INSTALL || echo "restore of INSTALL fails"
set `wc -c INSTALL`;Sum=$1
if test "$Sum" != "3696"
then echo original size 3696, current size $Sum;fi
echo "x - extracting MANUAL (Text)"
sed 's/^X//' << 'SHAR_EOF' > MANUAL &&
X                                              Author: Karl Kleinpaste
X                                                      karl at cis.ohio-state.edu
X                                                Date: 04 Apr 1989
X                                   Last modification: 04 Apr 1989
X
X			 INTERNET RELAY CHAT
X		  a real-time conversational system
X
X
X* 1: Irc - replacement for talk(1)
X
XIrc is a functional replacement for and improvement to talk(1).  Talk
Xis an old, primitive, atrocious, minimalist sort of keyboard/screen
Xconversation tool, using a grotesque, machine-dependent protocol.
XIrc does everything talk does, but with a better protocol, allowing
Xmore than 2 users to talk at once, with access across the aggregate
XInternet, and providing a whole raft of other useful features.
X
X* 2: Entering Internet Relay Chat
X
XType `irc'.  If one wishes to be known by a nickname which is not
Xone's login name, type `irc chosen-nickname' instead.
X
X* 3: How much can be seen from here
X
XThe universe - seriously.
X
XThis is most formally called Internet Relay Chat.  Server hosts are
Xconnected via a tree structure.  The various servers relay control and
Xmessage data among themselves to advertise the existence of other
Xservers, users, and the channels and other resources being occupied by
Xthose users.
X
X* 4: Structure
X
XThere is quite a lot of structure to the operation of irc, as
Xcompared to crufty old talk(1).  Since so little could be done with
Xtalk(1), it needed little structure.  But to keep track of people
Xspread literally around the world (the system was written by Jarkko
XOikarinen of Finland, usually seen on the system as `Wiz'), the
Xstructure is useful so that one can speak to exactly those people with
Xwhom one wishes to speak.
X
X** 4.1: Nicknames
X
XAll users of irc are known to the system by a `nickname.'  By
Xdefault, one's nickname is one's login name.  Nickname clashes are not
Xallowed; this is enforced by the servers.  If one's intended nickname
Xclashes with someone else as one enters chat, one will not be able to
Xcomplete entry to irc until one changes one's nickname to something
Xelse.
X
X** 4.2: Presence on a channel
X
XFundamental to the operation of irc is the concept of a channel.  All
Xusers are `on a channel' while inside irc.  One enters the `null
Xchannel,' channel 0, first.  One cannot send any messages while in
Xchannel 0 unless one has set up a private conversation in some way.
XThe number of channels is essentially unlimited - whatever will fit in
Xa 32-bit integer.
X
X** 4.3: Types of channels
X
XThere are 3 channel types, with increasing levels of privacy afforded
Xthem.
X
X*** 4.3.1: Public channels
X
XPublic channels are channels 1-999.  If one is on one of these
Xchannels, one can be seen by all other users.  Anyone can notice users
Xon a public channel and join such a channel's conversation.
X
X*** 4.3.2: Secret channels
X
XChannels 1000-up are called `secret.'  This means that, although
Xanyone can see that one is using chat, no one can tell what channel
Xone is using unless one is already on that channel with oneself.
XSince the number of potential channels is in the billions, this is
Xquite some security - all one gives away is the acknowledgement that
Xone is using chat.
X
X*** 4.3.3: Hidden channels
X
XNegative channel numbers are called `hidden.'  While one is on a
Xhidden channel, no one who is not on one's channel with oneself can
Xeven see that one is there.  One's name does not show up in a list of
Xactive users.  The only indication of one's presence is that, when
Xentering chat, all new users are told that there are "N users on P
Xservers."  If one checks on all users and finds less than N of them,
Xone knows that others are hiding on negative channels.  But a hidden
Xchannel user still cannot be found except by brute-force checking
Xthrough all channels, a hopeless proposition in the face of 10-digit
Xchannel numbers.  Security through obscurity finally means something.
X
X** 4.4: Channel limits
X
XMost channels are limited by server design to accommodate 10 users
Xeach.  The exceptions to this are channels 1-9, where no limits on
Xuser population are enforced.  But keeping track of conversations
Xamong more than 10 people is, shall we say, troublesome at best.
XUsers experienced in CompuServe's CB service, a fairly close
Xconceptual equivalent to chat, should understand this if they think
Xabout CB channel 1 on a Friday night.
X
X** 4.5: Conversations not using channels
X
XIt is possible to conduct conversations with others without using the
Xformalized channel structure.  Doing so requires that two people set
Xthemselves up for private conversation using special commands; see
XUser Commands below.
X
X* 5: Screen/keyboard structure
X
XChat is a full-screen utility.  It takes over the screen, with the
Xbulk of activity happening in the top N-2 lines, a modeline (vaguely
Xemacs-like) on the next to last line, and one's input being entered on
Xthe last line.  The rightmost position of the modeline indicates
Xeither OWR, meaning overwrite mode on input, or INS, meaning insert
Xmode.  Default is OWR.
X
X** 5.1: Keyboard input
X
XWhen typing commands at irc, one has a minimalist line-editing
Xfacility in an emacs style.  That is, ^A moves the cursor to the
Xbeginning of the line, ^E goes to the end, ^D deletes the character
Xunder the cursor, ^K kills from the cursor to the end, and so on.  If
Xone is in overwrite mode, then typing occurs on top of any characters
Xalready present in the input line.  If insert mode is active, then
Xcharacters in front of the cursor are pushed farther out as one types.
X
X** 5.2: Screen activity
X
XAlmost everything happens in the upper bulk of the screen.  This
Xincludes both messages from other users, as well as the output of the
Xcontrol commands.
X
XNormal messages from other users appear with the originating nickname
Xin <angle brackets>.  Private messages arrive with the originating
Xnickname in *asterisks*.  Messages which one sends to everyone appear
Xwith a preceding "> " whereas messages which one sends privately to
Xone other user appear with "-> *nickname*."
X
XOther output (e.g., /who commands, invitations from other users to
Xjoin channels, and so forth) appears interspersed with other activity
Xon the screen.
X
X* 6: Command structure
X
XOrdinary text typed at irc is sent as one's messages to everyone else
Xon the same channel, modulo personal choices for private messages and
Xthe like.  Commands to irc itself all begin with a command character,
Xwhich is initially `/' but may be changed to any other character
Xdesired.
X
XCommands may in general be abbreviated to a unique prefix.
X
X** 6.1: Leaving irc
X
XThe way to get out of irc is to enter the /signoff command.  "/si" is
Xsufficient.  Also equivalent are "/exit," "/bye," and perhaps "quit."
X
X** 6.2: Getting help
X
XType "/help."  Follow the instructions.
X
X** 6.3: User commands
X
XOther commands supported by irc are:
X
X      help   signoff       who     whois
X      list     topic      join   channel
X     links       msg    invite    summon
X     users     stats      nick      away
X      info     clear     query     cmdch
X      date
X
X*** 6.3.1: help
X
XInformation on how to use the rest of the system is available via
X/help.  The modeline says so as well.
X
X*** 6.3.2: signoff
X
X/signoff exits chat.
X
X*** 6.3.3: who
X
X/who returns information on who is using chat.  /who without arguments
Xprints info on all users that can be seen.  Users of public channels
Xshow up with their channel identified.  Users of secret channels
Xappear, but they are specified as being on a private, unspecified
Xchannel.  Users of hidden channels do not appear at all.
X
XGiving a numeric argument to /who returns only those users of the
Xspecified channel.  This still doesn't show users of secret or hidden
Xchannels unless one is actually on that channel.
X
X*** 6.3.4: whois
X
XThis returns information about individual users.  Say "/whois
Xnickname" to get information on the login name and host from which the
Xnicknamed user comes.
X
X*** 6.3.5: topic
X
XChannels can be given off-the-cuff "topics."  Saying "/topic some
Xstring of text" will associate that topic with the current channel.
X
X*** 6.3.6: list
X
X/list will give lists of active channels, the number of users of each,
Xand the topics therewith associated.  Again, secret and hidden
Xchannels do not appear.
X
X*** 6.3.7: join & channel
X
X/join or /channel are the means to enter a channel.  Give a numeric
Xargument for the channel one wishes to enter.  If this is a secret or
Xhidden channel, /who commands will show oneself and any other users of
Xone's channel.
X
XOne's arrival on a channel is announced to the rest of the users
Xalready on that channel.  Silent, anonymous "lurking" is not
Xsupported.
X
X*** 6.3.8: links
X
X/links lists the currently-active set of chat servers.  Beware: this
Xlist can be quite long, and will undoubtedly get longer as chat gains
Xwider use.  As of 22 March 1989, about 15-20 servers is typical.
X
X*** 6.3.9: msg
X
XA single message can be sent privately to a certain user with /msg.
XType /msg nickname and the text to be sent.  It will be sent privately
Xto the indicated nickname.
X
X*** 6.3.10: invite
X
XIf there is a user online to whom one wishes to speak, one may invite
Xthat user to join oneself on a certain channel.  One types "/invite
Xnickname" with an optional channel number.  The receiving user gets a
Xone-line message indicating the sender and the invitation.  The
Xreceiving user is free to ignore the invitation, of course.
X
X*** 6.3.11: summon
X
XAn extreme form of /invite is /summon.  "/summon user at host" will
Xrequest the user on the specified host to enter the chat system.  Do
Xnot do this unless one is fairly sure that one's request will be
Xwelcome - it can be a fairly disturbing and sometimes irritating
Xintrusion.  In order for /summon to work, the specified host must be a
Xconnected chat server - one can't summon random people from around the
XInternet.
X
X*** 6.3.12: users
X
X/users will return a list of the users logged into one's system.  With
Xan optional hostname identifying a chat server host, the users logged
Xinto that system will be listed.
X
X*** 6.3.13: stats
X
XThis command returns counts of various protocol operations of one's
Xchat server.  It is neither particularly useful nor interesting; it
Xwas, at one time, a debugging aid.
X
X*** 6.3.14: nick
X
XOne can change nicknames by issuing "/nick new-nickname."  All users
Xon one's channel will be advised of the change.  NOTE: If one enters
Xchat with a nickname clash (e.g., one's login name is the same as
Xsomeone else's, and the other user got there first), the system will
Xnot let one enter until one issues a /nick command with a unique
Xnickname.
X
X*** 6.3.15: away
X
XSometimes, one wishes to remain connected to the chat system, but one
Xmust be elsewhere for a while.  One can issue an /away command with
Xarbitrary text as argument, which will mark oneself as being away.  If
Xsomeone sends an away'd user a private message (via /msg or in a
Xprivate session set up via /query; see below), the sender will get a
Xmessage back from the server indicating the away-ness and the message
Xwhich was set.
X
X*** 6.3.16: info
X
X/info returns information regarding the author and copyright of the
Xchat system.
X
X*** 6.3.17: clear
X
XAt times, one wishes that one's screen weren't so cluttered.  /clear
Xmakes it so.
X
X*** 6.3.18: query
X
XThis command is used to set up private communications `outside' the
Xnormal channel system.
X
XWhen one enters "/query nickname," the indicated nickname is set up as
Xthe sole recipient of anything which one types thereafter.  Thus, if
Xuser A executes "/query B" and user B executes "/query A," they have
Xset up a private communication between themselves.  Significantly, it
Xremains possible for them to stay on their respective channels, which
Xneed not be the same, and listen to whatever conversation is going on
Xaround them as well, though they cannot respond to that ambient
Xconversation without leaving the private conversation they have set up.
X
XOne leaves this private mode by issuing /query without arguments.
X
X*** 6.3.19: cmdch
X
XThe `/' character may not be best for some people to use as their
Xcommand character.  It can be changed with "/cmdch <character>."
X
X** 6.4: Operator commands
X
XThe chat system administrators on each host have additional
Xresponsibilities and power over the configuration and operation of the
Xservers.  The commands to do so are delineated below.
X
X*** 6.4.1: oper
X
XUsers who have the potential for operator privileges initially invoke
Xthose privileges by "/oper nickname password," where nickname is the
Xnickname under which operation is intended, and password is the
Xpassword known to the chat system for that nickname.
X
X*** 6.4.2: kill
X
XObnoxious users had best beware the operator who's fast on the /kill
Xcommand.  "/kill nickname" blows any given nickname completely out of
Xthe chat system.
X
XObnoxiousness is not to be tolerated.  But operators do not use /kill
Xlightly.
X
X*** 6.4.3: quote
X
XRaw access to the underlying server protocol is possible through the
Xuser of the /quote command.  "/quote any text at all" is used to send
Xdirect, unmodified commands to the servers.  This has a wide variety
Xof uses, such as deliberately killing a local or remote chat daemon,
Xinvoking operator privileges for otherwise-operator-priv-forbidden
Xusers, and related tasks.  It is, again, a very powerful operation,
Xand not to be used lightly.
X
X* 7: Questions, problems, troubles?
X
XWrite mail to local irc coordinator.
SHAR_EOF
chmod 0600 MANUAL || echo "restore of MANUAL fails"
set `wc -c MANUAL`;Sum=$1
if test "$Sum" != "13403"
then echo original size 13403, current size $Sum;fi
echo "x - extracting Makefile (Text)"
sed 's/^X//' << 'SHAR_EOF' > Makefile &&
X#
X# See struct.h for machine dependent parameters    --Jto
X#
X# Format of command lines:
X# ircd {<hostname> <portnum>}
X# irc [<nickname> [<hostname>]]
X# Some options are available too. See manual pages.
X#
X# Thanx to mta at tut.fi for creating emacs-like interface in irc.
X#
X# Thanx to kim at kannel.lut.fi for creating hpux-version.
X#
X# Thanx to jtrim at orion.cair.du.edu for some enchantments and
X#   lotsa good advice and suggestions.
X#
X# Thanx to vijay at lll-winken.llnl.gov for lotsa advice and
X#   telling many people about irc.
X#
X# Thanx to karl at cis.ohio-state.edu for user's manual.
X#
X# Thanx to gl8f at astsun3.astro.virginia.edu for pointing out several
X#   FEATURES ;-) in irc...
X#
X# Thanx to all others who have given good advice, opinions and written
X# code for irc.
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# SYS = sysv   SysV NOT working... under construction...
X# Use bsd for HPUX, SUNs, ULTRIX, ...
XSYS = bsd
X
XDOBJS= ircd.o debug.o s_msg.o parse.o packet.o send.o list.o s_sys.o sys.o\
X       s_conf.o date.o channel.o
XCOBJS= irc.o parse.o packet.o send.o c_msg.o debug.o str.o edit.o screen.o\
X       c_sys.o sys.o c_conf.o help.o ignore.o
XROBJS= card.o parse.o packet.o send.o r_msg.o debug.o str.o r_sys.o sys.o\
X       c_conf.o deck.o
X
XCFLAGS = -g
X#CFLAGS = -O
X
X# At least HPUX needs only curses library, not termcap...
X#TLIBS = -lcurses
X
XTLIBS = -lcurses -ltermcap
SHAR_EOF
echo "End of part 1"
echo "File Makefile is continued in part 2"
echo "2" > s2_seq_.tmp
exit 0



More information about the Alt.sources mailing list