MNNH News English :verified:<p>BREAKING:</p><p>Network Working Group J. Oikarinen<br>Request for Comments: 1459 D. Reed<br> May 1993</p><p> Internet Relay Chat Protocol</p><p>Status of This Memo</p><p> This memo defines an Experimental Protocol for the Internet<br> community. Discussion and suggestions for improvement are requested.<br> Please refer to the current edition of the "IAB Official Protocol<br> Standards" for the standardization state and status of this protocol.<br> Distribution of this memo is unlimited.</p><p>Abstract</p><p> The IRC protocol was developed over the last 4 years since it was<br> first implemented as a means for users on a BBS to chat amongst<br> themselves. Now it supports a world-wide network of servers and<br> clients, and is stringing to cope with growth. Over the past 2 years,<br> the average number of users connected to the main IRC network has<br> grown by a factor of 10.</p><p> The IRC protocol is a text-based protocol, with the simplest client<br> being any socket program capable of connecting to the server.</p><p>Table of Contents</p><p> 1. INTRODUCTION ............................................... 4<br> 1.1 Servers ................................................ 4<br> 1.2 Clients ................................................ 5<br> 1.2.1 Operators .......................................... 5<br> 1.3 Channels ................................................ 5<br> 1.3.1 Channel Operators .................................... 6<br> 2. THE IRC SPECIFICATION ....................................... 7<br> 2.1 Overview ................................................ 7<br> 2.2 Character codes ......................................... 7<br> 2.3 Messages ................................................ 7<br> 2.3.1 Message format in 'pseudo' BNF .................... 8<br> 2.4 Numeric replies ......................................... 10<br> 3. IRC Concepts ................................................ 10<br> 3.1 One-to-one communication ................................ 10<br> 3.2 One-to-many ............................................. 11<br> 3.2.1 To a list .......................................... 11<br> 3.2.2 To a group (channel) ............................... 11<br> 3.2.3 To a host/server mask .............................. 12<br> 3.3 One to all .............................................. 12</p><p>Oikarinen & Reed [Page 1]<br><br>RFC 1459 Internet Relay Chat Protocol May 1993</p><p> 3.3.1 Client to Client ................................... 12<br> 3.3.2 Clients to Server .................................. 12<br> 3.3.3 Server to Server ................................... 12<br> 4. MESSAGE DETAILS ............................................. 13<br> 4.1 Connection Registration ................................. 13<br> 4.1.1 Password message ................................... 14<br> 4.1.2 Nickname message ................................... 14<br> 4.1.3 User message ....................................... 15<br> 4.1.4 Server message ..................................... 16<br> 4.1.5 Operator message ................................... 17<br> 4.1.6 Quit message ....................................... 17<br> 4.1.7 Server Quit message ................................ 18<br> 4.2 Channel operations ...................................... 19<br> 4.2.1 Join message ....................................... 19<br> 4.2.2 Part message ....................................... 20<br> 4.2.3 Mode message ....................................... 21<br> 4.2.3.1 Channel modes ................................. 21<br> 4.2.3.2 User modes .................................... 22<br> 4.2.4 Topic message ...................................... 23<br> 4.2.5 Names message ...................................... 24<br> 4.2.6 List message ....................................... 24<br> 4.2.7 Invite message ..................................... 25<br> 4.2.8 Kick message ....................................... 25<br> 4.3 Server queries and commands ............................. 26<br> 4.3.1 Version message .................................... 26<br> 4.3.2 Stats message ...................................... 27<br> 4.3.3 Links message ...................................... 28<br> 4.3.4 Time message ....................................... 29<br> 4.3.5 Connect message .................................... 29<br> 4.3.6 Trace message ...................................... 30<br> 4.3.7 Admin message ...................................... 31<br> 4.3.8 Info message ....................................... 31<br> 4.4 Sending messages ........................................ 32<br> 4.4.1 Private messages ................................... 32<br> 4.4.2 Notice messages .................................... 33<br> 4.5 User-based queries ...................................... 33<br> 4.5.1 Who query .......................................... 33<br> 4.5.2 Whois query ........................................ 34<br> 4.5.3 Whowas message ..................................... 35<br> 4.6 Miscellaneous messages .................................. 35<br> 4.6.1 Kill message ....................................... 36<br> 4.6.2 Ping message ....................................... 37<br> 4.6.3 Pong message ....................................... 37<br> 4.6.4 Error message ...................................... 38<br> 5. OPTIONAL MESSAGES ........................................... 38<br> 5.1 Away message ............................................ 38<br> 5.2 Rehash command .......................................... 39<br> 5.3 Restart command ......................................... 39</p><p>Oikarinen & Reed [Page 2]<br><br>RFC 1459 Internet Relay Chat Protocol May 1993</p><p> 5.4 Summon message .......................................... 40<br> 5.5 Users message ........................................... 40<br> 5.6 Operwall command ........................................ 41<br> 5.7 Userhost message ........................................ 42<br> 5.8 Ison message ............................................ 42<br> 6. REPLIES ..................................................... 43<br> 6.1 Error Replies ........................................... 43<br> 6.2 Command responses ....................................... 48<br> 6.3 Reserved numerics ....................................... 56<br> 7. Client and server authentication ............................ 56<br> 8. Current Implementations Details ............................. 56<br> 8.1 Network protocol: TCP ................................... 57<br> 8.1.1 Support of Unix sockets ............................ 57<br> 8.2 Command Parsing ......................................... 57<br> 8.3 Message delivery ........................................ 57<br> 8.4 Connection 'Liveness' ................................... 58<br> 8.5 Establishing a server-client connection ................. 58<br> 8.6 Establishing a server-server connection ................. 58<br> 8.6.1 State information exchange when connecting ......... 59<br> 8.7 Terminating server-client connections ................... 59<br> 8.8 Terminating server-server connections ................... 59<br> 8.9 Tracking nickname changes ............................... 60<br> 8.10 Flood control of clients ............................... 60<br> 8.11 Non-blocking lookups ................................... 61<br> 8.11.1 Hostname (DNS) lookups ............................ 61<br> 8.11.2 Username (Ident) lookups .......................... 61<br> 8.12 Configuration file ..................................... 61<br> 8.12.1 Allowing clients to connect ....................... 62<br> 8.12.2 Operators ......................................... 62<br> 8.12.3 Allowing servers to connect ....................... 62<br> 8.12.4 Administrivia ..................................... 63<br> 8.13 Channel membership ..................................... 63<br> 9. Current problems ............................................ 63<br> 9.1 Scalability ............................................. 63<br> 9.2 Labels .................................................. 63<br> 9.2.1 Nicknames .......................................... 63<br> 9.2.2 Channels ........................................... 64<br> 9.2.3 Servers ............................................ 64<br> 9.3 Algorithms .............................................. 64<br> 10. Support and availability ................................... 64<br> 11. Security Considerations .................................... 65<br> 12. Authors' Addresses ......................................... 65</p><p>Oikarinen & Reed [Page 3]<br><br>RFC 1459 Internet Relay Chat Protocol May 1993</p><p>1. INTRODUCTION</p><p> The IRC (Internet Relay Chat) protocol has been designed over a<br> number of years for use with text based conferencing. This document<br> describes the current IRC protocol.</p><p> The IRC protocol has been developed on systems using the TCP/IP<br> network protocol, although there is no requirement that this remain<br> the only sphere in which it operates.</p><p> IRC itself is a teleconferencing system, which (through the use of<br> the client-server model) is well-suited to running on many machines<br> in a distributed fashion. A typical setup involves a single process<br> (the server) forming a central point for clients (or other servers)<br> to connect to, performing the required message delivery/multiplexing<br> and other functions.</p><p>1.1 Servers</p><p> The server forms the backbone of IRC, providing a point to which<br> clients may connect to to talk to each other, and a point for other<br> servers to connect to, forming an IRC network. The only network<br> configuration allowed for IRC servers is that of a spanning tree [see<br> Fig. 1] where each server acts as a central node for the rest of the<br> net it sees.</p><p> [ Server 15 ] [ Server 13 ] [ Server 14]<br> / \ /<br> / \ /<br> [ Server 11 ] ------ [ Server 1 ] [ Server 12]<br> / \ /<br> / \ /<br> [ Server 2 ] [ Server 3 ]<br> / \ \<br> / \ \<br> [ Server 4 ] [ Server 5 ] [ Server 6 ]<br> / | \ /<br> / | \ /<br> / | \____ /<br> / | \ /<br> [ Server 7 ] [ Server 8 ] [ Server 9 ] [ Server 10 ]</p><p> :<br> [ etc. ]<br> :</p><p> [ Fig. 1. Format of IRC server network ]</p><p>Oikarinen & Reed [Page 4]<br><br>RFC 1459 Internet Relay Chat Protocol May 1993</p><p>1.2 Clients</p><p> A client is anything connecting to a server that is not another<br> server. Each client is distinguished from other clients by a unique<br> nickname having a maximum length of nine (9) characters. See the<br> protocol grammar rules for what may and may not be used in a<br> nickname. In addition to the nickname, all servers must have the<br> following information about all clients: the real name of the host<br> that the client is running on, the username of the client on that<br> host, and the server to which the client is connected.</p><p>1.2.1 Operators</p><p> To allow a reasonable amount of order to be kept within the IRC<br> network, a special class of clients (operators) is allowed to perform<br> general maintenance functions on the network. Although the powers<br> granted to an operator can be considered as 'dangerous', they are<br> nonetheless required. Operators should be able to perform basic<br> network tasks such as disconnecting and reconnecting servers as<br> needed to prevent long-term use of bad network routing. In<br> recognition of this need, the protocol discussed herein provides for<br> operators only to be able to perform such functions. See sections<br> 4.1.7 (SQUIT) and 4.3.5 (CONNECT).</p><p> A more controversial power of operators is the ability to remove a<br> user from the connected network by 'force', i.e. operators are able<br> to close the connection between any client and server. The<br> justification for this is delicate since its abuse is both<br> destructive and annoying. For further details on this type of<br> action, see section 4.6.1 (KILL).</p><p>1.3 Channels</p><p> A channel is a named group of one or more clients which will all<br> receive messages addressed to that channel. The channel is created<br> implicitly when the first client joins it, and the channel ceases to<br> exist when the last client leaves it. While channel exists, any<br> client can reference the channel using the name of the channel.</p><p> Channels names are strings (beginning with a '&' or '#' character) of<br> length up to 200 characters. Apart from the the requirement that the<br> first character being either '&' or '#'; the only restriction on a<br> channel name is that it may not contain any spaces (' '), a control G<br> (^G or ASCII 7), or a comma (',' which is used as a list item<br> separator by the protocol).</p><p> There are two types of channels allowed by this protocol. One is a<br> distributed channel which is known to all the servers that are</p><p>Oikarinen & Reed [Page 5]<br><br>RFC 1459 Internet Relay Chat Protocol May 1993</p><p> connected to the network. These channels are marked by the first<br> character being a only clients on the server where it exists may join<br> it. These are distinguished by a leading '&' character. On top of<br> these two types, there are the various channel modes available to<br> alter the characteristics of individual channels. See section 4.2.3<br> (MODE command) for more details on this.</p><p> To create a new channel or become part of an existing channel, a user<br> is required to JOIN the channel. If the channel doesn't exist prior<br> to joining, the channel is created and the creating user becomes a<br> channel operator. If the channel already exists, whether or not your<br> request to JOIN that channel is honoured depends on the current modes<br> of the channel. For example, if the channel is invite-only, (+i),<br> then you may only join if invited. As part of the protocol, a user<br> may be a part of several channels at once, but a limit of ten (10)<br> channels is recommended as being ample for both experienced and<br> novice users. See section 8.13 for more information on this.</p><p> If the IRC network becomes disjoint because of a split between two<br> servers, the channel on each side is only composed of those clients<br> which are connected to servers on the respective sides of the split,<br> possibly ceasing to exist on one side of the split. When the split<br> is healed, the connecting servers announce to each other who they<br> think is in each channel and the mode of that channel. If the<br> channel exists on both sides, the JOINs and MODEs are interpreted in<br> an inclusive manner so that both sides of the new connection will<br> agree about which clients are in the channel and what modes the<br> channel has.</p><p>1.3.1 Channel Operators</p><p> The channel operator (also referred to as a "chop" or "chanop") on a<br> given channel is considered to 'own' that channel. In recognition of<br> this status, channel operators are endowed with certain powers which<br> enable them to keep control and some sort of sanity in their channel.<br> As an owner of a channel, a channel operator is not required to have<br> reasons for their actions, although if their actions are generally<br> antisocial or otherwise abusive, it might be reasonable to ask an IRC<br> operator to intervene, or for the usersjust leave and go elsewhere<br> and form their own channel.</p><p> The commands which may only be used by channel operators are:</p><p> KICK - Eject a client from the channel<br> MODE - Change the channel's mode<br> INVITE - Invite a client to an invite-only channel (mode +i)<br> TOPIC - Change the channel topic in a mode +t channel</p><p>Oikarinen & Reed [Page 6]<br><br>RFC 1459 Internet Relay Chat Protocol May 1993</p><p> A channel operator is identified by the '@' symbol next to their<br> nickname whenever it is associated with a channel (ie replies to the<br> NAMES, WHO and WHOIS commands).</p><p>2. The IRC Specification</p><p>2.1 Overview</p><p> The protocol as described herein is for use both with server to<br> server and client to server connections. There are, however, more<br> restrictions on client connections (which are considered to be<br> untrustworthy) than on server connections.</p><p>2.2 Character codes</p><p> No specific character set is specified. The protocol is based on a a<br> set of codes which are composed of eight (8) bits, making up an<br> octet. Each message may be composed of any number of these octets;<br> however, some octet values are used for control codes which act as<br> message delimiters.</p><p> Regardless of being an 8-bit protocol, the delimiters and keywords<br> are such that protocol is mostly usable from USASCII terminal and a<br> telnet connection.</p><p> Because of IRC's scandanavian origin, the characters {}| are<br> considered to be the lower case equivalents of the characters []\,<br> respectively. This is a critical issue when determining the<br> equivalence of two nicknames.</p><p>2.3 Messages</p><p> Servers and clients send eachother messages which may or may not<br> generate a reply. If the message contains a valid command, as<br> described in later sections, the client should expect a reply as<br> specified but it is not advised to wait forever for the reply; client<br> to server and server to server communication is essentially<br> asynchronous in nature.</p><p> Each IRC message may consist of up to three main parts: the prefix<br> (optional), the command, and the command parameters (of which there<br> may be up to 15). The prefix, command, and all parameters are<br> separated by one (or more) ASCII space character(s) (0x20).</p><p> The presence of a prefix is indicated with a single leading ASCII<br> colon character (':', 0x3b), which must be the first character of the<br> message itself. There must be no gap (whitespace) between the colon<br> and the prefix. The prefix is used by servers to indicate the true</p><p>Oikarinen & Reed [Page 7]<br><br>RFC 1459 Internet Relay Chat Protocol May 1993</p><p> origin of the message. If the prefix is missing from the message, it<br> is assumed to have originated from the connection from which it was<br> received. Clients should not use prefix when sending a message from<br> themselves; if they use a prefix, the only valid prefix is the<br> registered nickname associated with the client. If the source<br> identified by the prefix cannot be found from the server's internal<br> database, or if the source is registered from a different link than<br> from which the message arrived, the server must ignore the message<br> silently.</p><p> The command must either be a valid IRC command or a three (3) digit<br> number represented in ASCII text.</p><p> IRC messages are always lines of characters terminated with a CR-LF<br> (Carriage Return - Line Feed) pair, and these messages shall not<br> exceed 512 characters in length, counting all characters including<br> the trailing CR-LF. Thus, there are 510 characters maximum allowed<br> for the command and its parameters. There is no provision for<br> continuation message lines. See section 7 for more details about<br> current implementations.</p><p>2.3.1 Message format in 'pseudo' BNF</p><p> The protocol messages must be extracted from the contiguous stream of<br> octets. The current solution is to designate two characters, CR and<br> LF, as message separators. Empty messages are silently ignored,<br> which permits use of the sequence CR-LF between messages<br> without extra problems.</p><p> The extracted message is parsed into the components <prefix>,<br> <command> and list of parameters matched either by <middle> or<br> <trailing> components.</p><p> The BNF representation for this is:</p><p><message> ::= [':' <prefix> <SPACE> ] <command> <params> <crlf><br><prefix> ::= <servername> | <nick> [ '!' <user> ] [ '@' <host> ]<br><command> ::= <letter> { <letter> } | <number> <number> <number><br><SPACE> ::= ' ' { ' ' }<br><params> ::= <SPACE> [ ':' <trailing> | <middle> <params> ]</p><p><middle> ::= <Any *non-empty* sequence of octets not including SPACE<br> or NUL or CR or LF, the first of which may not be ':'><br><trailing> ::= <Any, possibly *empty*, sequence of octets not including<br> NUL or CR or LF></p><p><crlf> ::= CR LF</p><p>Oikarinen & Reed [Page 8]<br><br>RFC 1459 Internet Relay Chat Protocol May 1993</p><p>NOTES:</p><p> 1) <SPACE> is consists only of SPACE character(s) (0x20).<br> Specially notice that TABULATION, and all other control<br> characters are considered NON-WHITE-SPACE.</p><p> 2) After extracting the parameter list, all parameters are equal,<br> whether matched by <middle> or <trailing>. <Trailing> is just<br> a syntactic trick to allow SPACE within parameter.</p><p> 3) The fact that CR and LF cannot appear in parameter strings is<br> just artifact of the message framing. This might change later.</p><p> 4) The NUL character is not special in message framing, and<br> basically could end up inside a parameter, but as it would<br> cause extra complexities in normal C string handling. Therefore<br> NUL is not allowed within messages.</p><p> 5) The last parameter may be an empty string.</p><p> 6) Use of the extended prefix (['!' <user> ] ['@' <host> ]) must<br> not be used in server to server communications and is only<br> intended for server to client messages in order to provide<br> clients with more useful information about who a message is<br> from without the need for additional queries.</p><p> Most protocol messages specify additional semantics and syntax for<br> the extracted parameter strings dictated by their position in the<br> list. For example, many server commands will assume that the first<br> parameter after the command is the list of targets, which can be<br> described with:</p><p> <target> ::= <to> [ "," <target> ]<br> <to> ::= <channel> | <user> '@' <servername> | <nick> | <mask><br> <channel> ::= ('#' | '&') <chstring><br> <servername> ::= <host><br> <host> ::= see RFC 952 [DNS:4] for details on allowed hostnames<br> <nick> ::= <letter> { <letter> | <number> | <special> }<br> <mask> ::= ('#' | '$') <chstring><br> <chstring> ::= <any 8bit code except SPACE, BELL, NUL, CR, LF and<br> comma (',')></p><p> Other parameter syntaxes are:</p><p> <user> ::= <nonwhite> { <nonwhite> }<br> <letter> ::= 'a' ... 'z' | 'A' ... 'Z'<br> <number> ::= '0' ... '9'<br> <special> ::= '-' | '[' | ']' | '\' | '`' | '^' | '{' | '}'</p><p>Oikarinen & Reed [Page 9]<br><br>RFC 1459 Internet Relay Chat Protocol May 1993</p><p> <nonwhite> ::= <any 8bit code except SPACE (0x20), NUL (0x0), CR<br> (0xd), and LF (0xa)></p><p>2.4 Numeric replies</p><p> Most of the messages sent to the server generate a reply of some<br> sort. The most common reply is the numeric reply, used for both<br> errors and normal replies. The numeric reply must be sent as one<br> message consisting of the sender prefix, the three digit numeric, and<br> the target of the reply. A numeric reply is not allowed to originate<br> from a client; any such messages received by a server are silently<br> dropped. In all other respects, a numeric reply is just like a normal<br> message, except that the keyword is made up of 3 numeric digits<br> rather than a string of letters. A list of different replies is<br> supplied in section 6.</p><p>3. IRC Concepts.</p><p> This section is devoted to describing the actual concepts behind the<br> organization of the IRC protocol and how the current<br> implementations deliver different classes of messages.</p><p> 1--\<br> A D---4<br> 2--/ \ /<br> B----C<br> / \<br> 3 E</p><p> Servers: A, B, C, D, E Clients: 1, 2, 3, 4</p><p> [ Fig. 2. Sample small IRC network ]</p><p>3.1 One-to-one communication</p><p> Communication on a one-to-one basis is usually only performed by<br> clients, since most server-server traffic is not a result of servers<br> talking only to each other. To provide a secure means for clients to<br> talk to each other, it is required that all servers be able to send a<br> message in exactly one direction along the spanning tree in order to<br> reach any client. The path of a message being delivered is the<br> shortest path between any two points on the spanning tree.</p><p> The following examples all refer to Figure 2 above.</p><p>Oikarinen & Reed [Page 10]<br><br>RFC 1459 Internet Relay Chat Protocol May 1993</p><p>Example 1:<br> A message between clients 1 and 2 is only seen by server A, which<br> sends it straight to client 2.</p><p>Example 2:<br> A message between clients 1 and 3 is seen by servers A & B, and<br> client 3. No other clients or servers are allowed see the message.</p><p>Example 3:<br> A message between clients 2 and 4 is seen by servers A, B, C & D<br> and client 4 only.</p><p>3.2 One-to-many</p><p> The main goal of IRC is to provide a forum which allows easy and<br> efficient conferencing (one to many conversations). IRC offers<br> several means to achieve this, each serving its own purpose.</p><p>3.2.1 To a list</p><p> The least efficient style of one-to-many conversation is through<br> clients talking to a 'list' of users. How this is done is almost<br> self explanatory: the client gives a list of destinations to which<br> the message is to be delivered and the server breaks it up and<br> dispatches a separate copy of the message to each given destination.<br> This isn't as efficient as using a group since the destination list<br> is broken up and the dispatch sent without checking to make sure<br> duplicates aren't sent down each path.</p><p>3.2.2 To a group (channel)</p><p> In IRC the channel has a role equivalent to that of the multicast<br> group; their existence is dynamic (coming and going as people join<br> and leave channels) and the actual conversation carried out on a<br> channel is only sent to servers which are supporting users on a given<br> channel. If there are multiple users on a server in the same<br> channel, the message text is sent only once to that server and then<br> sent to each client on the channel. This action is then repeated for<br> each client-server combination until the original message has fanned<br> out and reached each member of the channel.</p><p> The following examples all refer to Figure 2.</p><p>Example 4:<br> Any channel with 1 client in it. Messages to the channel go to the<br> server and then nowhere else.</p><p>Oikarinen & Reed [Page 11]<br><br>RFC 1459 Internet Relay Chat Protocol May 1993</p><p>Example 5:<br> 2 clients in a channel. All messages traverse a path as if they<br> were private messages between the two clients outside a channel.</p><p>Example 6:<br> Clients 1, 2 and 3 in a channel. All messages to the channel are<br> sent to all clients and only those servers which must be traversed<br> by the message if it were a private message to a single client. If<br> client 1 sends a message, it goes back to client 2 and then via<br> server B to client 3.</p><p>3.2.3 To a host/server mask</p><p> To provide IRC operators with some mechanism to send messages to a<br> large body of related users, host and server mask messages are<br> provided. These messages are sent to users whose host or server<br> information match that of the mask. The messages are only sent to<br> locations where users are, in a fashion similar to that of channels.</p><p>3.3 One-to-all</p><p> The one-to-all type of message is better described as a broadcast<br> message, sent to all clients or servers or both. On a large network<br> of users and servers, a single message can result in a lot of traffic<br> being sent over the network in an effort to reach all of the desired<br> destinations.</p><p> For some messages, there is no option but to broadcast it to all<br> servers so that the state information held by each server is<br> reasonably consistent between servers.</p><p>3.3.1 Client-to-Client</p><p> There is no class of message which, from a single message, results in<br> a message being sent to every other client.</p><p>3.3.2 Client-to-Server</p><p> Most of the commands which result in a change of state information<br> (such as channel membership, channel mode, user status, etc) must be<br> sent to all servers by default, and this distribution may not be<br> changed by the client.</p><p>3.3.3 Server-to-Server.</p><p> While most messages between servers are distributed to all 'other'<br> servers, this is only required for any message that affects either a<br> user, channel or server. Since these are the basic items found in</p><p>Oikarinen & Reed [Page 12]<br><br>RFC 1459 Internet Relay Chat Protocol May 1993</p><p> IRC, nearly all messages originating from a server are broadcast to<br> all other connected servers.</p><p>4. Message details</p><p> On the following pages are descriptions of each message recognized by<br> the IRC server and client. All commands described in this section<br> must be implemented by any server for this protocol.</p><p> Where the reply ERR_NOSUCHSERVER is listed, it means that the<br> <server> parameter could not be found. The server must not send any<br> other replies after this for that command.</p><p> The server to which a client is connected is required to parse the<br> complete message, returning any appropriate errors. If the server<br> encounters a fatal error while parsing a message, an error must be<br> sent back to the client and the parsing terminated. A fatal error<br> may be considered to be incorrect command, a destination which is<br> otherwise unknown to the server (server, nick or channel names fit<br> this category), not enough parameters or incorrect privileges.</p><p> If a full set of parameters is presented, then each must be checked<br> for validity and appropriate responses sent back to the client. In<br> the case of messages which use parameter lists using the comma as an<br> item separator, a reply must be sent for each item.</p><p> In the examples below, some messages appear using the full format:</p><p> :Name COMMAND parameter list</p><p> Such examples represent a message from "Name" in transit between<br> servers, where it is essential to include the name of the original<br> sender of the message so remote servers may send back a reply along<br> the correct path.</p><p>4.1 Connection Registration</p><p> The commands described here are used to register a connection with an<br> IRC server as either a user or a server as well as correctly<br> disconnect.</p><p> A "PASS" command is not required for either client or server<br> connection to be registered, but it must precede the server message<br> or the latter of the NICK/USER combination. It is strongly<br> recommended that all server connections have a password in order to<br> give some level of security to the actual connections. The<br> recommended order for a client to register is as follows:</p><p>Oikarinen & Reed [Page 13]<br><br>RFC 1459 Internet Relay Chat Protocol May 1993</p><p> 1. Pass message<br> 2. Nick message<br> 3. User message</p><p>4.1.1 Password message</p><p> Command: PASS<br> Parameters: <password></p><p> The PASS command is used to set a 'connection password'. The<br> password can and must be set before any attempt to register the<br> connection is made. Currently this requires that clients send a PASS<br> command before sending the NICK/USER combination and servers *must*<br> send a PASS command before any SERVER command. The password supplied<br> must match the one contained in the C/N lines (for servers) or I<br> lines (for clients). It is possible to send multiple PASS commands<br> before registering but only the last one sent is used for<br> verification and it may not be changed once registered. Numeric<br> Replies:</p><p> ERR_NEEDMOREPARAMS ERR_ALREADYREGISTRED</p><p> Example:</p><p> PASS secretpasswordhere</p><p>4.1.2 Nick message</p><p> Command: NICK<br> Parameters: <nickname> [ <hopcount> ]</p><p> NICK message is used to give user a nickname or change the previous<br> one. The <hopcount> parameter is only used by servers to indicate<br> how far away a nick is from its home server. A local connection has<br> a hopcount of 0. If supplied by a client, it must be ignored.</p><p> If a NICK message arrives at a server which already knows about an<br> identical nickname for another client, a nickname collision occurs.<br> As a result of a nickname collision, all instances of the nickname<br> are removed from the server's database, and a KILL command is issued<br> to remove the nickname from all other server's database. If the NICK<br> message causing the collision was a nickname change, then the<br> original (old) nick must be removed as well.</p><p> If the server recieves an identical NICK from a client which is<br> directly connected, it may issue an ERR_NICKCOLLISION to the local<br> client, drop the NICK command, and not generate any kills.</p><p>Oikarinen & Reed [Page 14]<br><br>RFC 1459 Internet Relay Chat Protocol May 1993</p><p> Numeric Replies:</p><p> ERR_NONICKNAMEGIVEN ERR_ERRONEUSNICKNAME<br> ERR_NICKNAMEINUSE ERR_NICKCOLLISION</p><p> Example:</p><p> NICK Wiz ; Introducing new nick "Wiz".</p><p> :WiZ NICK Kilroy ; WiZ changed his nickname to Kilroy.</p><p>4.1.3 User message</p><p> Command: USER<br> Parameters: <username> <hostname> <servername> <realname></p><p> The USER message is used at the beginning of connection to specify<br> the username, hostname, servername and realname of s new user. It is<br> also used in communication between servers to indicate new user<br> arriving on IRC, since only after both USER and NICK have been<br> received from a client does a user become registered.</p><p> Between servers USER must to be prefixed with client's NICKname.<br> Note that hostname and servername are normally ignored by the IRC<br> server when the USER command comes from a directly connected client<br> (for security reasons), but they are used in server to server<br> communication. This means that a NICK must always be sent to a<br> remote server when a new user is being introduced to the rest of the<br> network before the accompanying USER is sent.</p><p> It must be noted that realname parameter must be the last parameter,<br> because it may contain space characters and must be prefixed with a<br> colon (':') to make sure this is recognised as such.</p><p> Since it is easy for a client to lie about its username by relying<br> solely on the USER message, the use of an "Identity Server" is<br> recommended. If the host which a user connects from has such a<br> server enabled the username is set to that as in the reply from the<br> "Identity Server".</p><p> Numeric Replies:</p><p> ERR_NEEDMOREPARAMS ERR_ALREADYREGISTRED</p><p> Examples:</p><p> USER guest tolmoon tolsun :Ronnie Reagan</p><p>Oikarinen & Reed [Page 15]<br><br>RFC 1459 Internet Relay Chat Protocol May 1993</p><p> ; User registering themselves with a<br> username of "guest" and real name<br> "Ronnie Reagan".</p><p> :testnick USER guest tolmoon tolsun :Ronnie Reagan<br> ; message between servers with the<br> nickname for which the USER command<br> belongs to</p><p>4.1.4 Server message</p><p> Command: SERVER<br> Parameters: <servername> <hopcount> <info></p><p> The server message is used to tell a server that the other end of a<br> new connection is a server. This message is also used to pass server<br> data over whole net. When a new server is connected to net,<br> information about it be broadcast to the whole network. <hopcount><br> is used to give all servers some internal information on how far away<br> all servers are. With a full server list, it would be possible to<br> construct a map of the entire server tree, but hostmasks prevent this<br> from being done.</p><p> The SERVER message must only be accepted from either (a) a connection<br> which is yet to be registered and is attempting to register as a<br> server, or (b) an existing connection to another server, in which<br> case the SERVER message is introducing a new server behind that<br> server.</p><p> Most errors that occur with the receipt of a SERVER command result in<br> the connection being terminated by the destination host (target<br> SERVER). Error replies are usually sent using the "ERROR" command<br> rather than the numeric since the ERROR command has several useful<br> properties which make it useful here.</p><p> If a SERVER message is parsed and attempts to introduce a server<br> which is already known to the receiving server, the connection from<br> which that message must be closed (following the correct procedures),<br> since a duplicate route to a server has formed and the acyclic nature<br> of the IRC tree broken.</p><p> Numeric Replies:</p><p> ERR_ALREADYREGISTRED</p><p> Example:</p><p>Oikarinen & Reed [Page 16]<br><br>RFC 1459 Internet Relay Chat Protocol May 1993</p><p>SERVER test.oulu.fi 1 :[tolsun.oulu.fi] Experimental server<br> ; New server test.oulu.fi introducing<br> itself and attempting to register. The<br> name in []'s is the hostname for the<br> host running test.oulu.fi.</p><p>:tolsun.oulu.fi SERVER csd.bu.edu 5 :BU Central Server<br> ; Server tolsun.oulu.fi is our uplink<br> for csd.bu.edu which is 5 hops away.</p><p>4.1.5 Oper</p><p> Command: OPER<br> Parameters: <user> <password></p><p> OPER message is used by a normal user to obtain operator privileges.<br> The combination of <user> and <password> are required to gain<br> Operator privileges.</p><p> If the client sending the OPER command supplies the correct password<br> for the given user, the server then informs the rest of the network<br> of the new operator by issuing a "MODE +o" for the clients nickname.</p><p> The OPER message is client-server only.</p><p> Numeric Replies:</p><p> ERR_NEEDMOREPARAMS RPL_YOUREOPER<br> ERR_NOOPERHOST ERR_PASSWDMISMATCH</p><p> Example:</p><p> OPER foo bar ; Attempt to register as an operator<br> using a username of "foo" and "bar" as<br> the password.</p><p>4.1.6 Quit</p><p> Command: QUIT<br> Parameters: [<Quit message>]</p><p> A client session is ended with a quit message. The server must close<br> the connection to a client which sends a QUIT message. If a "Quit<br> Message" is given, this will be sent instead of the default message,<br> the nickname.</p><p> When netsplits (disconnecting of two servers) occur, the quit message</p><p>Oikarinen & Reed [Page 17]<br><br>RFC 1459 Internet Relay Chat Protocol May 1993</p><p> is composed of the names of two servers involved, separated by a<br> space. The first name is that of the server which is still connected<br> and the second name is that of the server that has become<br> disconnected.</p><p> If, for some other reason, a client connection is closed without the<br> client issuing a QUIT command (e.g. client dies and EOF occurs<br> on socket), the server is required to fill in the quit message with<br> some sort of message reflecting the nature of the event which<br> caused it to happen.</p><p> Numeric Replies:</p><p> None.</p><p> Examples:</p><p> QUIT :Gone to have lunch ; Preferred message format.</p><p>4.1.7 Server quit message</p><p> Command: SQUIT<br> Parameters: <server> <comment></p><p> The SQUIT message is needed to tell about quitting or dead servers.<br> If a server wishes to break the connection to another server it must<br> send a SQUIT message to the other server, using the the name of the<br> other server as the server parameter, which then closes its<br> connection to the quitting server.</p><p> This command is also available operators to help keep a network of<br> IRC servers connected in an orderly fashion. Operators may also<br> issue an SQUIT message for a remote server connection. In this case,<br> the SQUIT must be parsed by each server inbetween the operator and<br> the remote server, updating the view of the network held by each<br> server as explained below.</p><p> The <comment> should be supplied by all operators who execute a SQUIT<br> for a remote server (that is not connected to the server they are<br> currently on) so that other operators are aware for the reason of<br> this action. The <comment> is also filled in by servers which may<br> place an error or similar message here.</p><p> Both of the servers which are on either side of the connection being<br> closed are required to to send out a SQUIT message (to all its other<br> server connections) for all other servers which are considered to be<br> behind that link.</p><p>Oikarinen & Reed [Page 18]<br><br>RFC 1459 Internet Relay Chat Protocol May 1993</p><p> Similarly, a QUIT message must be sent to the other connected servers<br> rest of the network on behalf of all clients behind that link. In<br> addition to this, all channel members of a channel which lost a<br> member due to the split must be sent a QUIT message.</p><p> If a server connection is terminated prematurely (e.g. the server on<br> the other end of the link died), the server which detects<br> this disconnection is required to inform the rest of the network<br> that the connection has closed and fill in the comment field<br> with something appropriate.</p><p> Numeric replies:</p><p> ERR_NOPRIVILEGES ERR_NOSUCHSERVER</p><p> Example:</p><p> SQUIT tolsun.oulu.fi :Bad Link ? ; the server link tolson.oulu.fi has<br> been terminated because of "Bad Link".</p><p> :Trillian SQUIT cm22.eng.umd.edu :Server out of control<br> ; message from Trillian to disconnect<br> "cm22.eng.umd.edu" from the net<br> because "Server out of control".</p><p>4.2 Channel operations</p><p> This group of messages is concerned with manipulating channels, their<br> properties (channel modes), and their contents (typically clients).<br> In implementing these, a number of race conditions are inevitable<br> when clients at opposing ends of a network send commands which will<br> ultimately clash. It is also required that servers keep a nickname<br> history to ensure that wherever a <nick> parameter is given, the<br> server check its history in case it has recently been changed.</p><p>4.2.1 Join message</p><p> Command: JOIN<br> Parameters: <channel>{,<channel>} [<key>{,<key>}]</p><p> The JOIN command is used by client to start listening a specific<br> channel. Whether or not a client is allowed to join a channel is<br> checked only by the server the client is connected to; all other<br> servers automatically add the user to the channel when it is received<br> from other servers. The conditions which affect this are as follows:</p><p> 1. the user must be invited if the channel is invite-only;</p><p>Oikarinen & Reed [Page 19]<br><br>RFC 1459 Internet Relay Chat Protocol May 1993</p><p> 2. the user's nick/username/hostname must not match any<br> active bans;</p><p> 3. the correct key (password) must be given if it is set.</p><p> These are discussed in more detail under the MODE command (see<br> section 4.2.3 for more details).</p><p> Once a user has joined a channel, they receive notice about all<br> commands their server receives which affect the channel. This<br> includes MODE, KICK, PART, QUIT and of course PRIVMSG/NOTICE. The<br> JOIN command needs to be broadcast to all servers so that each server<br> knows where to find the users who are on the channel. This allows<br> optimal delivery of PRIVMSG/NOTICE messages to the channel.</p><p> If a JOIN is successful, the user is then sent the channel's topic<br> (using RPL_TOPIC) and the list of users who are on the channel (using<br> RPL_NAMREPLY), which must include the user joining.</p><p> Numeric Replies:</p><p> ERR_NEEDMOREPARAMS ERR_BANNEDFROMCHAN<br> ERR_INVITEONLYCHAN ERR_BADCHANNELKEY<br> ERR_CHANNELISFULL ERR_BADCHANMASK<br> ERR_NOSUCHCHANNEL ERR_TOOMANYCHANNELS<br> RPL_TOPIC</p><p> Examples:</p><p> JOIN <a href="https://hellsite.site/tags/foobar" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>foobar</span></a> ; join channel <a href="https://hellsite.site/tags/foobar" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>foobar</span></a>.</p><p> JOIN &foo fubar ; join channel &foo using key "fubar".</p><p> JOIN <a href="https://hellsite.site/tags/foo" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>foo</span></a>,&bar fubar ; join channel <a href="https://hellsite.site/tags/foo" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>foo</span></a> using key "fubar"<br> and &bar using no key.</p><p> JOIN <a href="https://hellsite.site/tags/foo" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>foo</span></a>,<a href="https://hellsite.site/tags/bar" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>bar</span></a> fubar,foobar ; join channel <a href="https://hellsite.site/tags/foo" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>foo</span></a> using key "fubar".<br> and channel <a href="https://hellsite.site/tags/bar" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>bar</span></a> using key "foobar".</p><p> JOIN <a href="https://hellsite.site/tags/foo" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>foo</span></a>,<a href="https://hellsite.site/tags/bar" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>bar</span></a> ; join channels <a href="https://hellsite.site/tags/foo" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>foo</span></a> and <a href="https://hellsite.site/tags/bar" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>bar</span></a>.</p><p> :WiZ JOIN <a href="https://hellsite.site/tags/Twilight_zone" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Twilight_zone</span></a> ; JOIN message from WiZ</p><p>4.2.2 Part message</p><p> Command: PART<br> Parameters: <channel>{,<channel>}</p><p>Oikarinen & Reed [Page 20]<br><br>RFC 1459 Internet Relay Chat Protocol May 1993</p><p> The PART message causes the client sending the message to be removed<br> from the list of active users for all given channels listed in the<br> parameter string.</p><p> Numeric Replies:</p><p> ERR_NEEDMOREPARAMS ERR_NOSUCHCHANNEL<br> ERR_NOTONCHANNEL</p><p> Examples:</p><p> PART <a href="https://hellsite.site/tags/twilight_zone" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>twilight_zone</span></a> ; leave channel "<a href="https://hellsite.site/tags/twilight_zone" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>twilight_zone</span></a>"</p><p> PART <a href="https://hellsite.site/tags/oz" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>oz</span></a>-ops,&group5 ; leave both channels "&group5" and<br> "<a href="https://hellsite.site/tags/oz" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>oz</span></a>-ops".</p><p>4.2.3 Mode message</p><p> Command: MODE</p><p> The MODE command is a dual-purpose command in IRC. It allows both<br> usernames and channels to have their mode changed. The rationale for<br> this choice is that one day nicknames will be obsolete and the<br> equivalent property will be the channel.</p><p> When parsing MODE messages, it is recommended that the entire message<br> be parsed first and then the changes which resulted then passed on.</p><p>4.2.3.1 Channel modes</p><p> Parameters: <channel> {[+|-]|o|p|s|i|t|n|b|v} [<limit>] [<user>]<br> [<ban mask>]</p><p> The MODE command is provided so that channel operators may change the<br> characteristics of `their' channel. It is also required that servers<br> be able to change channel modes so that channel operators may be<br> created.</p><p> The various modes available for channels are as follows:</p><p> o - give/take channel operator privileges;<br> p - private channel flag;<br> s - secret channel flag;<br> i - invite-only channel flag;<br> t - topic settable by channel operator only flag;<br> n - no messages to channel from clients on the outside;<br> m - moderated channel;<br> l - set the user limit to channel;</p><p>Oikarinen & Reed [Page 21]<br><br>RFC 1459 Internet Relay Chat Protocol May 1993</p><p> b - set a ban mask to keep users out;<br> v - give/take the ability to speak on a moderated channel;<br> k - set a channel key (password).</p><p> When using the 'o' and 'b' options, a restriction on a total of three<br> per mode command has been imposed. That is, any combination of 'o'<br> and</p><p>4.2.3.2 User modes</p><p> Parameters: <nickname> {[+|-]|i|w|s|o}</p><p> The user MODEs are typically changes which affect either how the<br> client is seen by others or what 'extra' messages the client is sent.<br> A user MODE command may only be accepted if both the sender of the<br> message and the nickname given as a parameter are both the same.</p><p> The available modes are as follows:</p><p> i - marks a users as invisible;<br> s - marks a user for receipt of server notices;<br> w - user receives wallops;<br> o - operator flag.</p><p> Additional modes may be available later on.</p><p> If a user attempts to make themselves an operator using the "+o"<br> flag, the attempt should be ignored. There is no restriction,<br> however, on anyone `deopping' themselves (using "-o"). Numeric<br> Replies:</p><p> ERR_NEEDMOREPARAMS RPL_CHANNELMODEIS<br> ERR_CHANOPRIVSNEEDED ERR_NOSUCHNICK<br> ERR_NOTONCHANNEL ERR_KEYSET<br> RPL_BANLIST RPL_ENDOFBANLIST<br> ERR_UNKNOWNMODE ERR_NOSUCHCHANNEL</p><p> ERR_USERSDONTMATCH RPL_UMODEIS<br> ERR_UMODEUNKNOWNFLAG</p><p> Examples:</p><p> Use of Channel Modes:</p><p>MODE <a href="https://hellsite.site/tags/Finnish" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Finnish</span></a> +im ; Makes <a href="https://hellsite.site/tags/Finnish" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Finnish</span></a> channel moderated and<br> 'invite-only'.</p><p>MODE <a href="https://hellsite.site/tags/Finnish" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Finnish</span></a> +o Kilroy ; Gives 'chanop' privileges to Kilroy on</p><p>Oikarinen & Reed [Page 22]<br><br>RFC 1459 Internet Relay Chat Protocol May 1993</p><p> channel <a href="https://hellsite.site/tags/Finnish" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Finnish</span></a>.</p><p>MODE <a href="https://hellsite.site/tags/Finnish" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Finnish</span></a> +v Wiz ; Allow WiZ to speak on <a href="https://hellsite.site/tags/Finnish" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Finnish</span></a>.</p><p>MODE <a href="https://hellsite.site/tags/Fins" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Fins</span></a> -s ; Removes 'secret' flag from channel<br> <a href="https://hellsite.site/tags/Fins" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Fins</span></a>.</p><p>MODE #42 +k oulu ; Set the channel key to "oulu".</p><p>MODE <a href="https://hellsite.site/tags/eu" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>eu</span></a>-opers +l 10 ; Set the limit for the number of users<br> on channel to 10.</p><p>MODE &oulu +b ; list ban masks set for channel.</p><p>MODE &oulu +b *!*@* ; prevent all users from joining.</p><p>MODE &oulu +b *!*@*.edu ; prevent any user from a hostname<br> matching *.edu from joining.</p><p> Use of user Modes:</p><p>:MODE WiZ -w ; turns reception of WALLOPS messages<br> off for WiZ.</p><p>:Angel MODE Angel +i ; Message from Angel to make themselves<br> invisible.</p><p>MODE WiZ -o ; WiZ 'deopping' (removing operator<br> status). The plain reverse of this<br> command ("MODE WiZ +o") must not be<br> allowed from users since would bypass<br> the OPER command.</p><p>4.2.4 Topic message</p><p> Command: TOPIC<br> Parameters: <channel> [<topic>]</p><p> The TOPIC message is used to change or view the topic of a channel.<br> The topic for channel <channel> is returned if there is no <topic><br> given. If the <topic> parameter is present, the topic for that<br> channel will be changed, if the channel modes permit this action.</p><p> Numeric Replies:</p><p> ERR_NEEDMOREPARAMS ERR_NOTONCHANNEL<br> RPL_NOTOPIC RPL_TOPIC<br> ERR_CHANOPRIVSNEEDED</p><p>Oikarinen & Reed [Page 23]<br><br>RFC 1459 Internet Relay Chat Protocol May 1993</p><p> Examples:</p><p> :Wiz TOPIC <a href="https://hellsite.site/tags/test" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>test</span></a> :New topic ;User Wiz setting the topic.</p><p> TOPIC <a href="https://hellsite.site/tags/test" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>test</span></a> :another topic ;set the topic on <a href="https://hellsite.site/tags/test" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>test</span></a> to "another<br> topic".</p><p> TOPIC <a href="https://hellsite.site/tags/test" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>test</span></a> ; check the topic for <a href="https://hellsite.site/tags/test" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>test</span></a>.</p><p>4.2.5 Names message</p><p> Command: NAMES<br> Parameters: [<channel>{,<channel>}]</p><p> By using the NAMES command, a user can list all nicknames that are<br> visible to them on any channel that they can see. Channel names<br> which they can see are those which aren't private (+p) or secret (+s)<br> or those which they are actually on. The <channel> parameter<br> specifies which channel(s) to return information about if valid.<br> There is no error reply for bad channel names.</p><p> If no <channel> parameter is given, a list of all channels and their<br> occupants is returned. At the end of this list, a list of users who<br> are visible but either not on any channel or not on a visible channel<br> are listed as being on `channel' "*".</p><p> Numerics:</p><p> RPL_NAMREPLY RPL_ENDOFNAMES</p><p> Examples:</p><p> NAMES <a href="https://hellsite.site/tags/twilight_zone" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>twilight_zone</span></a>,#42 ; list visible users on <a href="https://hellsite.site/tags/twilight_zone" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>twilight_zone</span></a><br> and #42 if the channels are visible to<br> you.</p><p> NAMES ; list all visible channels and users</p><p>4.2.6 List message</p><p> Command: LIST<br> Parameters: [<channel>{,<channel>} [<server>]]</p><p> The list message is used to list channels and their topics. If the<br> <channel> parameter is used, only the status of that channel<br> is displayed. Private channels are listed (without their<br> topics) as channel "Prv" unless the client generating the query is<br> actually on that channel. Likewise, secret channels are not listed</p><p>Oikarinen & Reed [Page 24]<br><br>RFC 1459 Internet Relay Chat Protocol May 1993</p><p> at all unless the client is a member of the channel in question.</p><p> Numeric Replies:</p><p> ERR_NOSUCHSERVER RPL_LISTSTART<br> RPL_LIST RPL_LISTEND</p><p> Examples:</p><p> LIST ; List all channels.</p><p> LIST <a href="https://hellsite.site/tags/twilight_zone" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>twilight_zone</span></a>,#42 ; List channels <a href="https://hellsite.site/tags/twilight_zone" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>twilight_zone</span></a> and #42</p><p>4.2.7 Invite message</p><p> Command: INVITE<br> Parameters: <nickname> <channel></p><p> The INVITE message is used to invite users to a channel. The<br> parameter <nickname> is the nickname of the person to be invited to<br> the target channel <channel>. There is no requirement that the<br> channel the target user is being invited to must exist or be a valid<br> channel. To invite a user to a channel which is invite only (MODE<br> +i), the client sending the invite must be recognised as being a<br> channel operator on the given channel.</p><p> Numeric Replies:</p><p> ERR_NEEDMOREPARAMS ERR_NOSUCHNICK<br> ERR_NOTONCHANNEL ERR_USERONCHANNEL<br> ERR_CHANOPRIVSNEEDED<br> RPL_INVITING RPL_AWAY</p><p> Examples:</p><p> :Angel INVITE Wiz <a href="https://hellsite.site/tags/Dust" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Dust</span></a> ; User Angel inviting WiZ to channel<br> <a href="https://hellsite.site/tags/Dust" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Dust</span></a></p><p> INVITE Wiz <a href="https://hellsite.site/tags/Twilight_Zone" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Twilight_Zone</span></a> ; Command to invite WiZ to<br> <a href="https://hellsite.site/tags/Twilight_zone" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Twilight_zone</span></a></p><p>4.2.8 Kick command</p><p> Command: KICK<br> Parameters: <channel> <user> [<comment>]</p><p> The KICK command can be used to forcibly remove a user from a<br> channel. It 'kicks them out' of the channel (forced PART).</p><p>Oikarinen & Reed [Page 25]<br><br>RFC 1459 Internet Relay Chat Protocol May 1993</p><p> Only a channel operator may kick another user out of a channel.<br> Each server that receives a KICK message checks that it is valid<br> (ie the sender is actually a channel operator) before removing<br> the victim from the channel.</p><p> Numeric Replies:</p><p> ERR_NEEDMOREPARAMS ERR_NOSUCHCHANNEL<br> ERR_BADCHANMASK ERR_CHANOPRIVSNEEDED<br> ERR_NOTONCHANNEL</p><p> Examples:</p><p>KICK &Melbourne Matthew ; Kick Matthew from &Melbourne</p><p>KICK <a href="https://hellsite.site/tags/Finnish" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Finnish</span></a> John :Speaking English<br> ; Kick John from <a href="https://hellsite.site/tags/Finnish" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Finnish</span></a> using<br> "Speaking English" as the reason<br> (comment).</p><p>:WiZ KICK <a href="https://hellsite.site/tags/Finnish" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Finnish</span></a> John ; KICK message from WiZ to remove John<br> from channel <a href="https://hellsite.site/tags/Finnish" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Finnish</span></a></p><p>NOTE:<br> It is possible to extend the KICK command parameters to the<br>following:</p><p><channel>{,<channel>} <user>{,<user>} [<comment>]</p><p>4.3 Server queries and commands</p><p> The server query group of commands has been designed to return<br> information about any server which is connected to the network. All<br> servers connected must respond to these queries and respond<br> correctly. Any invalid response (or lack thereof) must be considered<br> a sign of a broken server and it must be disconnected/disabled as<br> soon as possible until the situation is remedied.</p><p> In these queries, where a parameter appears as "<server>", it will<br> usually mean it can be a nickname or a server or a wildcard name of<br> some sort. For each parameter, however, only one query and set of<br> replies is to be generated.</p><p>4.3.1 Version message</p><p> Command: VERSION<br> Parameters: [<server>]</p><p>Oikarinen & Reed [Page 26]<br><br>RFC 1459 Internet Relay Chat Protocol May 1993</p><p> The VERSION message is used to query the version of the server<br> program. An optional parameter <server> is used to query the version<br> of the server program which a client is not directly connected to.</p><p> Numeric Replies:</p><p> ERR_NOSUCHSERVER RPL_VERSION</p><p> Examples:</p><p> :Wiz VERSION *.se ; message from Wiz to check the version<br> of a server matching "*.se"</p><p> VERSION tolsun.oulu.fi ; check the version of server<br> "tolsun.oulu.fi".</p><p>4.3.2 Stats message</p><p> Command: STATS<br> Parameters: [<query> [<server>]]</p><p> The stats message is used to query statistics of certain server. If<br> <server> parameter is omitted, only the end of stats reply is sent<br> back. The implementation of this command is highly dependent on the<br> server which replies, although the server must be able to supply<br> information as described by the queries below (or similar).</p><p> A query may be given by any single letter which is only checked by<br> the destination server (if given as the <server> parameter) and is<br> otherwise passed on by intermediate servers, ignored and unaltered.<br> The following queries are those found in the current IRC<br> implementation and provide a large portion of the setup information<br> for that server. Although these may not be supported in the same way<br> by other versions, all servers should be able to supply a valid reply<br> to a STATS query which is consistent with the reply formats currently<br> used and the purpose of the query.</p><p> The currently supported queries are:</p><p> c - returns a list of servers which the server may connect<br> to or allow connections from;<br> h - returns a list of servers which are either forced to be<br> treated as leaves or allowed to act as hubs;<br> i - returns a list of hosts which the server allows a client<br> to connect from;<br> k - returns a list of banned username/hostname combinations<br> for that server;<br> l - returns a list of the server's connections, showing how</p><p>Oikarinen & Reed [Page 27]<br><br>RFC 1459 Internet Relay Chat Protocol May 1993</p><p> long each connection has been established and the traffic<br> over that connection in bytes and messages for each<br> direction;<br> m - returns a list of commands supported by the server and<br> the usage count for each if the usage count is non zero;<br> o - returns a list of hosts from which normal clients may<br> become operators;<br> y - show Y (Class) lines from server's configuration file;<br> u - returns a string showing how long the server has been up.</p><p> Numeric Replies:</p><p> ERR_NOSUCHSERVER<br> RPL_STATSCLINE RPL_STATSNLINE<br> RPL_STATSILINE RPL_STATSKLINE<br> RPL_STATSQLINE RPL_STATSLLINE<br> RPL_STATSLINKINFO RPL_STATSUPTIME<br> RPL_STATSCOMMANDS RPL_STATSOLINE<br> RPL_STATSHLINE RPL_ENDOFSTATS</p><p> Examples:</p><p>STATS m ; check the command usage for the server<br> you are connected to</p><p>:Wiz STATS c eff.org ; request by WiZ for C/N line<br> information from server eff.org</p><p>4.3.3 Links message</p><p> Command: LINKS<br> Parameters: [[<remote server>] <server mask>]</p><p> With LINKS, a user can list all servers which are known by the server<br> answering the query. The returned list of servers must match the<br> mask, or if no mask is given, the full list is returned.</p><p> If <remote server> is given in addition to <server mask>, the LINKS<br> command is forwarded to the first server found that matches that name<br> (if any), and that server is then required to answer the query.</p><p> Numeric Replies:</p><p> ERR_NOSUCHSERVER<br> RPL_LINKS RPL_ENDOFLINKS</p><p> Examples:</p><p>Oikarinen & Reed [Page 28]<br><br>RFC 1459 Internet Relay Chat Protocol May 1993</p><p>LINKS *.au ; list all servers which have a name<br> that matches *.au;</p><p>:WiZ LINKS *.bu.edu *.edu ; LINKS message from WiZ to the first<br> server matching *.edu for a list of<br> servers matching *.bu.edu.</p><p>4.3.4 Time message</p><p> Command: TIME<br> Parameters: [<server>]</p><p> The time message is used to query local time from the specified<br> server. If the server parameter is not given, the server handling the<br> command must reply to the query.</p><p> Numeric Replies:</p><p> ERR_NOSUCHSERVER RPL_TIME</p><p> Examples:</p><p> TIME tolsun.oulu.fi ; check the time on the server<br> "tolson.oulu.fi"</p><p> Angel TIME *.au ; user angel checking the time on a<br> server matching "*.au"</p><p>4.3.5 Connect message</p><p> Command: CONNECT<br> Parameters: <target server> [<port> [<remote server>]]</p><p> The CONNECT command can be used to force a server to try to establish<br> a new connection to another server immediately. CONNECT is a<br> privileged command and is to be available only to IRC Operators. If<br> a remote server is given then the CONNECT attempt is made by that<br> server to <target server> and <port>.</p><p> Numeric Replies:</p><p> ERR_NOSUCHSERVER ERR_NOPRIVILEGES<br> ERR_NEEDMOREPARAMS</p><p> Examples:</p><p>CONNECT tolsun.oulu.fi ; Attempt to connect a server to<br> tolsun.oulu.fi</p><p>Oikarinen & Reed [Page 29]<br><br>RFC 1459 Internet Relay Chat Protocol May 1993</p><p>:WiZ CONNECT eff.org 6667 csd.bu.edu<br> ; CONNECT attempt by WiZ to get servers<br> eff.org and csd.bu.edu connected on port<br> 6667.</p><p>4.3.6 Trace message</p><p> Command: TRACE<br> Parameters: [<server>]</p><p> TRACE command is used to find the route to specific server. Each<br> server that processes this message must tell the sender about it by<br> sending a reply indicating it is a pass-through link, forming a chain<br> of replies similar to that gained from using "traceroute". After<br> sending this reply back, it must then send the TRACE message to the<br> next server until given server is reached. If the <server> parameter<br> is omitted, it is recommended that TRACE command send a message to<br> the sender telling which servers the current server has direct<br> connection to.</p><p> If the destination given by "<server>" is an actual server, then the<br> destination server is required to report all servers and users which<br> are connected to it, although only operators are permitted to see<br> users present. If the destination given by <server> is a nickname,<br> they only a reply for that nickname is given.</p><p> Numeric Replies:</p><p> ERR_NOSUCHSERVER</p><p> If the TRACE message is destined for another server, all intermediate<br> servers must return a RPL_TRACELINK reply to indicate that the TRACE<br> passed through it and where its going next.</p><p> RPL_TRACELINK<br> A TRACE reply may be composed of any number of the following numeric<br> replies.</p><p> RPL_TRACECONNECTING RPL_TRACEHANDSHAKE<br> RPL_TRACEUNKNOWN RPL_TRACEOPERATOR<br> RPL_TRACEUSER RPL_TRACESERVER<br> RPL_TRACESERVICE RPL_TRACENEWTYPE<br> RPL_TRACECLASS</p><p> Examples:</p><p>TRACE *.oulu.fi ; TRACE to a server matching *.oulu.fi</p><p>Oikarinen & Reed [Page 30]<br><br>RFC 1459 Internet Relay Chat Protocol May 1993</p><p>:WiZ TRACE AngelDust ; TRACE issued by WiZ to nick AngelDust</p><p>4.3.7 Admin command</p><p> Command: ADMIN<br> Parameters: [<server>]</p><p> The admin message is used to find the name of the administrator of<br> the given server, or current server if <server> parameter is omitted.<br> Each server must have the ability to forward ADMIN messages to other<br> servers.</p><p> Numeric Replies:</p><p> ERR_NOSUCHSERVER<br> RPL_ADMINME RPL_ADMINLOC1<br> RPL_ADMINLOC2 RPL_ADMINEMAIL</p><p> Examples:</p><p> ADMIN tolsun.oulu.fi ; request an ADMIN reply from<br> tolsun.oulu.fi</p><p> :WiZ ADMIN *.edu ; ADMIN request from WiZ for first<br> server found to match *.edu.</p><p>4.3.8 Info command</p><p> Command: INFO<br> Parameters: [<server>]</p><p> The INFO command is required to return information which describes<br> the server: its version, when it was compiled, the patchlevel, when<br> it was started, and any other miscellaneous information which may be<br> considered to be relevant.</p><p> Numeric Replies:</p><p> ERR_NOSUCHSERVER<br> RPL_INFO RPL_ENDOFINFO</p><p> Examples:</p><p> INFO csd.bu.edu ; request an INFO reply from<br> csd.bu.edu</p><p> :Avalon INFO *.fi ; INFO request from Avalon for first<br> server found to match *.fi.</p><p>Oikarinen & Reed [Page 31]<br><br>RFC 1459 Internet Relay Chat Protocol May 1993</p><p> INFO Angel ; request info from the server that<br> Angel is connected to.</p><p>4.4 Sending messages</p><p> The main purpose of the IRC protocol is to provide a base for clients<br> to communicate with each other. PRIVMSG and NOTICE are the only<br> messages available which actually perform delivery of a text message<br> from one client to another - the rest just make it possible and try<br> to ensure it happens in a reliable and structured manner.</p><p>4.4.1 Private messages</p><p> Command: PRIVMSG<br> Parameters: <receiver>{,<receiver>} <text to be sent></p><p> PRIVMSG is used to send private messages between users. <receiver><br> is the nickname of the receiver of the message. <receiver> can also<br> be a list of names or channels separated with commas.</p><p> The <receiver> parameter may also me a host mask (<a href="https://hellsite.site/tags/mask" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>mask</span></a>) or server<br> mask ($mask). In both cases the server will only send the PRIVMSG<br> to those who have a server or host matching the mask. The mask must<br> have at least 1 (one) "." in it and no wildcards following the<br> last ".". This requirement exists to prevent people sending messages<br> to "#*" or "$*", which would broadcast to all users; from<br> experience, this is abused more than used responsibly and properly.<br> Wildcards are the '*' and '?' characters. This extension to<br> the PRIVMSG command is only available to Operators.</p><p> Numeric Replies:</p><p> ERR_NORECIPIENT ERR_NOTEXTTOSEND<br> ERR_CANNOTSENDTOCHAN ERR_NOTOPLEVEL<br> ERR_WILDTOPLEVEL ERR_TOOMANYTARGETS<br> ERR_NOSUCHNICK<br> RPL_AWAY</p><p> Examples:</p><p>:Angel PRIVMSG Wiz :Hello are you receiving this message ?<br> ; Message from Angel to Wiz.</p><p>PRIVMSG Angel :yes I'm receiving it !receiving it !'u>(768u+1n) .br ;<br> Message to Angel.</p><p>PRIVMSG jto@tolsun.oulu.fi :Hello !<br> ; Message to a client on server</p><p>Oikarinen & Reed [Page 32]<br><br>RFC 1459 Internet Relay Chat Protocol May 1993</p><p> tolsun.oulu.fi with username of "jto".</p><p>PRIVMSG $*.fi :Server tolsun.oulu.fi rebooting.<br> ; Message to everyone on a server which<br> has a name matching *.fi.</p><p>PRIVMSG #*.edu :NSFNet is undergoing work, expect interruptions<br> ; Message to all users who come from a<br> host which has a name matching *.edu.</p><p>4.4.2 Notice</p><p> Command: NOTICE<br> Parameters: <nickname> <text></p><p> The NOTICE message is used similarly to PRIVMSG. The difference<br> between NOTICE and PRIVMSG is that automatic replies must never be<br> sent in response to a NOTICE message. This rule applies to servers<br> too - they must not send any error reply back to the client on<br> receipt of a notice. The object of this rule is to avoid loops<br> between a client automatically sending something in response to<br> something it received. This is typically used by automatons (clients<br> with either an AI or other interactive program controlling their<br> actions) which are always seen to be replying lest they end up in a<br> loop with another automaton.</p><p> See PRIVMSG for more details on replies and examples.</p><p>4.5 User based queries</p><p> User queries are a group of commands which are primarily concerned<br> with finding details on a particular user or group users. When using<br> wildcards with any of these commands, if they match, they will only<br> return information on users who are 'visible' to you. The visibility<br> of a user is determined as a combination of the user's mode and the<br> common set of channels you are both on.</p><p>4.5.1 Who query</p><p> Command: WHO<br> Parameters: [<name> [<o>]]</p><p> The WHO message is used by a client to generate a query which returns<br> a list of information which 'matches' the <name> parameter given by<br> the client. In the absence of the <name> parameter, all visible<br> (users who aren't invisible (user mode +i) and who don't have a<br> common channel with the requesting client) are listed. The same<br> result can be achieved by using a <name> of "0" or any wildcard which</p><p>Oikarinen & Reed [Page 33]<br><br>RFC 1459 Internet Relay Chat Protocol May 1993</p><p> will end up matching every entry possible.</p><p> The <name> passed to WHO is matched against users' host, server, real<br> name and nickname if the channel <name> cannot be found.</p><p> If the "o" parameter is passed only operators are returned according<br> to the name mask supplied.</p><p> Numeric Replies:</p><p> ERR_NOSUCHSERVER<br> RPL_WHOREPLY RPL_ENDOFWHO</p><p> Examples:</p><p> WHO *.fi ; List all users who match against<br> "*.fi".</p><p> WHO jto* o ; List all users with a match against<br> "jto*" if they are an operator.</p><p>4.5.2 Whois query</p><p> Command: WHOIS<br> Parameters: [<server>] <nickmask>[,<nickmask>[,...]]</p><p> This message is used to query information about particular user. The<br> server will answer this message with several numeric messages<br> indicating different statuses of each user which matches the nickmask<br> (if you are entitled to see them). If no wildcard is present in the<br> <nickmask>, any information about that nick which you are allowed to<br> see is presented. A comma (',') separated list of nicknames may be<br> given.</p><p> The latter version sends the query to a specific server. It is<br> useful if you want to know how long the user in question has been<br> idle as only local server (ie. the server the user is directly<br> connected to) knows that information, while everything else is<br> globally known.</p><p> Numeric Replies:</p><p> ERR_NOSUCHSERVER ERR_NONICKNAMEGIVEN<br> RPL_WHOISUSER RPL_WHOISCHANNELS<br> RPL_WHOISCHANNELS RPL_WHOISSERVER<br> RPL_AWAY RPL_WHOISOPERATOR<br> RPL_WHOISIDLE ERR_NOSUCHNICK<br> RPL_ENDOFWHOIS</p><p>Oikarinen & Reed [Page 34]<br><br>RFC 1459 Internet Relay Chat Protocol May 1993</p><p> Examples:</p><p> WHOIS wiz ; return available user information<br> about nick WiZ</p><p> WHOIS eff.org trillian ; ask server eff.org for user<br> information about trillian</p><p>4.5.3 Whowas</p><p> Command: WHOWAS<br> Parameters: <nickname> [<count> [<server>]]</p><p> Whowas asks for information about a nickname which no longer exists.<br> This may either be due to a nickname change or the user leaving IRC.<br> In response to this query, the server searches through its nickname<br> history, looking for any nicks which are lexically the same (no wild<br> card matching here). The history is searched backward, returning the<br> most recent entry first. If there are multiple entries, up to<br> <count> replies will be returned (or all of them if no <count><br> parameter is given). If a non-positive number is passed as being<br> <count>, then a full search is done.</p><p> Numeric Replies:</p><p> ERR_NONICKNAMEGIVEN ERR_WASNOSUCHNICK<br> RPL_WHOWASUSER RPL_WHOISSERVER<br> RPL_ENDOFWHOWAS</p><p> Examples:</p><p> WHOWAS Wiz ; return all information in the nick<br> history about nick "WiZ";</p><p> WHOWAS Mermaid 9 ; return at most, the 9 most recent<br> entries in the nick history for<br> "Mermaid";</p><p> WHOWAS Trillian 1 *.edu ; return the most recent history for<br> "Trillian" from the first server found<br> to match "*.edu".</p><p>4.6 Miscellaneous messages</p><p> Messages in this category do not fit into any of the above categories<br> but are nonetheless still a part of and required by the protocol.</p><p>Oikarinen & Reed [Page 35]<br><br>RFC 1459 Internet Relay Chat Protocol May 1993</p><p>4.6.1 Kill message</p><p> Command: KILL<br> Parameters: <nickname> <comment></p><p> The KILL message is used to cause a client-server connection to be<br> closed by the server which has the actual connection. KILL is used<br> by servers when they encounter a duplicate entry in the list of valid<br> nicknames and is used to remove both entries. It is also available<br> to operators.</p><p> Clients which have automatic reconnect algorithms effectively make<br> this command useless since the disconnection is only brief. It does<br> however break the flow of data and can be used to stop large amounts<br> of being abused, any user may elect to receive KILL messages<br> generated for others to keep an 'eye' on would be trouble spots.</p><p> In an arena where nicknames are required to be globally unique at all<br> times, KILL messages are sent whenever 'duplicates' are detected<br> (that is an attempt to register two users with the same nickname) in<br> the hope that both of them will disappear and only 1 reappear.</p><p> The comment given must reflect the actual reason for the KILL. For<br> server-generated KILLs it usually is made up of details concerning<br> the origins of the two conflicting nicknames. For users it is left<br> up to them to provide an adequate reason to satisfy others who see<br> it. To prevent/discourage fake KILLs from being generated to hide<br> the identify of the KILLer, the comment also shows a 'kill-path'<br> which is updated by each server it passes through, each prepending<br> its name to the path.</p><p> Numeric Replies:</p><p> ERR_NOPRIVILEGES ERR_NEEDMOREPARAMS<br> ERR_NOSUCHNICK ERR_CANTKILLSERVER</p><p> KILL David (csd.bu.edu <- tolsun.oulu.fi)<br> ; Nickname collision between csd.bu.edu<br> and tolson.oulu.fi</p><p> NOTE:<br> It is recommended that only Operators be allowed to kill other users<br> with KILL message. In an ideal world not even operators would need<br> to do this and it would be left to servers to deal with.</p><p>Oikarinen & Reed [Page 36]<br><br>RFC 1459 Internet Relay Chat Protocol May 1993</p><p>4.6.2 Ping message</p><p> Command: PING<br> Parameters: <server1> [<server2>]</p><p> The PING message is used to test the presence of an active client at<br> the other end of the connection. A PING message is sent at regular<br> intervals if no other activity detected coming from a connection. If<br> a connection fails to respond to a PING command within a set amount<br> of time, that connection is closed.</p><p> Any client which receives a PING message must respond to <server1><br> (server which sent the PING message out) as quickly as possible with<br> an appropriate PONG message to indicate it is still there and alive.<br> Servers should not respond to PING commands but rely on PINGs from<br> the other end of the connection to indicate the connection is alive.<br> If the <server2> parameter is specified, the PING message gets<br> forwarded there.</p><p> Numeric Replies:</p><p> ERR_NOORIGIN ERR_NOSUCHSERVER</p><p> Examples:</p><p> PING tolsun.oulu.fi ; server sending a PING message to<br> another server to indicate it is still<br> alive.</p><p> PING WiZ ; PING message being sent to nick WiZ</p><p>4.6.3 Pong message</p><p> Command: PONG<br> Parameters: <daemon> [<daemon2>]</p><p> PONG message is a reply to ping message. If parameter <daemon2> is<br> given this message must be forwarded to given daemon. The <daemon><br> parameter is the name of the daemon who has responded to PING message<br> and generated this message.</p><p> Numeric Replies:</p><p> ERR_NOORIGIN ERR_NOSUCHSERVER</p><p> Examples:</p><p> PONG csd.bu.edu tolsun.oulu.fi ; PONG message from csd.bu.edu to</p><p>Oikarinen & Reed [Page 37]<br><br>RFC 1459 Internet Relay Chat Protocol May 1993</p><p> tolsun.oulu.fi</p><p>4.6.4 Error</p><p> Command: ERROR<br> Parameters: <error message></p><p> The ERROR command is for use by servers when reporting a serious or<br> fatal error to its operators. It may also be sent from one server to<br> another but must not be accepted from any normal unknown clients.</p><p> An ERROR message is for use for reporting errors which occur with a<br> server-to-server link only. An ERROR message is sent to the server<br> at the other end (which sends it to all of its connected operators)<br> and to all operators currently connected. It is not to be passed<br> onto any other servers by a server if it is received from a server.</p><p> When a server sends a received ERROR message to its operators, the<br> message should be encapsulated inside a NOTICE message, indicating<br> that the client was not responsible for the error.</p><p> Numerics:</p><p> None.</p><p> Examples:</p><p> ERROR :Server *.fi already exists; ERROR message to the other server<br> which caused this error.</p><p> NOTICE WiZ :ERROR from csd.bu.edu -- Server *.fi already exists<br> ; Same ERROR message as above but sent<br> to user WiZ on the other server.</p><p>5. OPTIONALS</p><p> This section describes OPTIONAL messages. They are not required in a<br> working server implementation of the protocol described herein. In<br> the absence of the option, an error reply message must be generated<br> or an unknown command error. If the message is destined for another<br> server to answer then it must be passed on (elementary parsing<br> required) The allocated numerics for this are listed with the<br> messages below.</p><p>5.1 Away</p><p> Command: AWAY<br> Parameters: [message]</p><p>Oikarinen & Reed [Page 38]<br><br>RFC 1459 Internet Relay Chat Protocol May 1993</p><p> With the AWAY message, clients can set an automatic reply string for<br> any PRIVMSG commands directed at them (not to a channel they are on).<br> The automatic reply is sent by the server to client sending the<br> PRIVMSG command. The only replying server is the one to which the<br> sending client is connected to.</p><p> The AWAY message is used either with one parameter (to set an AWAY<br> message) or with no parameters (to remove the AWAY message).</p><p> Numeric Replies:</p><p> RPL_UNAWAY RPL_NOWAWAY</p><p> Examples:</p><p> AWAY :Gone to lunch. Back in 5 ; set away message to "Gone to lunch.<br> Back in 5".</p><p> :WiZ AWAY ; unmark WiZ as being away.</p><p>5.2 Rehash message</p><p> Command: REHASH<br> Parameters: None</p><p> The rehash message can be used by the operator to force the server to<br> re-read and process its configuration file.</p><p> Numeric Replies:</p><p> RPL_REHASHING ERR_NOPRIVILEGES</p><p>Examples:</p><p>REHASH ; message from client with operator<br> status to server asking it to reread its<br> configuration file.</p><p>5.3 Restart message</p><p> Command: RESTART<br> Parameters: None</p><p> The restart message can only be used by an operator to force a server<br> restart itself. This message is optional since it may be viewed as a<br> risk to allow arbitrary people to connect to a server as an operator<br> and execute this command, causing (at least) a disruption to service.</p><p>Oikarinen & Reed [Page 39]<br><br>RFC 1459 Internet Relay Chat Protocol May 1993</p><p> The RESTART command must always be fully processed by the server to<br> which the sending client is connected and not be passed onto other<br> connected servers.</p><p> Numeric Replies:</p><p> ERR_NOPRIVILEGES</p><p> Examples:</p><p> RESTART ; no parameters required.</p><p>5.4 Summon message</p><p> Command: SUMMON<br> Parameters: <user> [<server>]</p><p> The SUMMON command can be used to give users who are on a host<br> running an IRC server a message asking them to please join IRC. This<br> message is only sent if the target server (a) has SUMMON enabled, (b)<br> the user is logged in and (c) the server process can write to the<br> user's tty (or similar).</p><p> If no <server> parameter is given it tries to summon <user> from the<br> server the client is connected to is assumed as the target.</p><p> If summon is not enabled in a server, it must return the<br> ERR_SUMMONDISABLED numeric and pass the summon message onwards.</p><p> Numeric Replies:</p><p> ERR_NORECIPIENT ERR_FILEERROR<br> ERR_NOLOGIN ERR_NOSUCHSERVER<br> RPL_SUMMONING</p><p> Examples:</p><p> SUMMON jto ; summon user jto on the server's host</p><p> SUMMON jto tolsun.oulu.fi ; summon user jto on the host which a<br> server named "tolsun.oulu.fi" is<br> running.</p><p>5.5 Users</p><p> Command: USERS<br> Parameters: [<server>]</p><p>Oikarinen & Reed [Page 40]<br><br>RFC 1459 Internet Relay Chat Protocol May 1993</p><p> The USERS command returns a list of users logged into the server in a<br> similar format to who(1), rusers(1) and finger(1). Some people<br> may disable this command on their server for security related<br> reasons. If disabled, the correct numeric must be returned to<br> indicate this.</p><p> Numeric Replies:</p><p> ERR_NOSUCHSERVER ERR_FILEERROR<br> RPL_USERSSTART RPL_USERS<br> RPL_NOUSERS RPL_ENDOFUSERS<br> ERR_USERSDISABLED</p><p> Disabled Reply:</p><p> ERR_USERSDISABLED</p><p> Examples:</p><p>USERS eff.org ; request a list of users logged in on<br> server eff.org</p><p>:John USERS tolsun.oulu.fi ; request from John for a list of users<br> logged in on server tolsun.oulu.fi</p><p>5.6 Operwall message</p><p> Command: WALLOPS<br> Parameters: Text to be sent to all operators currently online</p><p> Sends a message to all operators currently online. After<br> implementing WALLOPS as a user command it was found that it was<br> often and commonly abused as a means of sending a message to a lot<br> of people (much similar to WALL). Due to this it is recommended<br> that the current implementation of WALLOPS be used as an<br> example by allowing and recognising only servers as the senders of<br> WALLOPS.</p><p> Numeric Replies:</p><p> ERR_NEEDMOREPARAMS</p><p> Examples:</p><p> :csd.bu.edu WALLOPS :Connect '*.uiuc.edu 6667' from Joshua; WALLOPS<br> message from csd.bu.edu announcing a<br> CONNECT message it received and acted<br> upon from Joshua.</p><p>Oikarinen & Reed [Page 41]<br><br>RFC 1459 Internet Relay Chat Protocol May 1993</p><p>5.7 Userhost message</p><p> Command: USERHOST<br> Parameters: <nickname>{<space><nickname>}</p><p> The USERHOST command takes a list of up to 5 nicknames, each<br> separated by a space character and returns a list of information<br> about each nickname that it found. The returned list has each reply<br> separated by a space.</p><p> Numeric Replies:</p><p> RPL_USERHOST ERR_NEEDMOREPARAMS</p><p> Examples:</p><p> USERHOST Wiz Michael Marty p ;USERHOST request for information on<br> nicks "Wiz", "Michael", "Marty" and "p"</p><p>5.8 Ison message</p><p> Command: ISON<br> Parameters: <nickname>{<space><nickname>}</p><p> The ISON command was implemented to provide a quick and efficient<br> means to get a response about whether a given nickname was currently<br> on IRC. ISON only takes one (1) parameter: a space-separated list of<br> nicks. For each nickname in the list that is present, the server<br> adds that to its reply string. Thus the reply string may return<br> empty (none of the given nicks are present), an exact copy of the<br> parameter string (all of them present) or as any other subset of the<br> set of nicks given in the parameter. The only limit on the number<br> of nicks that may be checked is that the combined length must not be<br> too large as to cause the server to chop it off so it fits in 512<br> characters.</p><p> ISON is only be processed by the server local to the client sending<br> the command and thus not passed onto other servers for further<br> processing.</p><p> Numeric Replies:</p><p> RPL_ISON ERR_NEEDMOREPARAMS</p><p> Examples:</p><p> ISON phone trillian WiZ jarlek Avalon Angel Monstah<br> ; Sample ISON request for 7 nicks.</p><p>Oikarinen & Reed [Page 42]<br><br>RFC 1459 Internet Relay Chat Protocol May 1993</p><p>6. REPLIES</p><p> The following is a list of numeric replies which are generated in<br> response to the commands given above. Each numeric is given with its<br> number, name and reply string.</p><p>6.1 Error Replies.</p><p> 401 ERR_NOSUCHNICK<br> "<nickname> :No such nick/channel"</p><p> - Used to indicate the nickname parameter supplied to a<br> command is currently unused.</p><p> 402 ERR_NOSUCHSERVER<br> "<server name> :No such server"</p><p> - Used to indicate the server name given currently<br> doesn't exist.</p><p> 403 ERR_NOSUCHCHANNEL<br> "<channel name> :No such channel"</p><p> - Used to indicate the given channel name is invalid.</p><p> 404 ERR_CANNOTSENDTOCHAN<br> "<channel name> :Cannot send to channel"</p><p> - Sent to a user who is either (a) not on a channel<br> which is mode +n or (b) not a chanop (or mode +v) on<br> a channel which has mode +m set and is trying to send<br> a PRIVMSG message to that channel.</p><p> 405 ERR_TOOMANYCHANNELS<br> "<channel name> :You have joined too many \<br> channels"<br> - Sent to a user when they have joined the maximum<br> number of allowed channels and they try to join<br> another channel.</p><p> 406 ERR_WASNOSUCHNICK<br> "<nickname> :There was no such nickname"</p><p> - Returned by WHOWAS to indicate there is no history<br> information for that nickname.</p><p> 407 ERR_TOOMANYTARGETS<br> "<target> :Duplicate recipients. No message \</p><p>Oikarinen & Reed [Page 43]<br><br>RFC 1459 Internet Relay Chat Protocol May 1993</p><p> delivered"</p><p> - Returned to a client which is attempting to send a<br> PRIVMSG/NOTICE using the user@host destination format<br> and for a user@host which has several occurrences.</p><p> 409 ERR_NOORIGIN<br> ":No origin specified"</p><p> - PING or PONG message missing the originator parameter<br> which is required since these commands must work<br> without valid prefixes.</p><p> 411 ERR_NORECIPIENT<br> ":No recipient given (<command>)"<br> 412 ERR_NOTEXTTOSEND<br> ":No text to send"<br> 413 ERR_NOTOPLEVEL<br> "<mask> :No toplevel domain specified"<br> 414 ERR_WILDTOPLEVEL<br> "<mask> :Wildcard in toplevel domain"</p><p> - 412 - 414 are returned by PRIVMSG to indicate that<br> the message wasn't delivered for some reason.<br> ERR_NOTOPLEVEL and ERR_WILDTOPLEVEL are errors that<br> are returned when an invalid use of<br> "PRIVMSG $<server>" or "PRIVMSG #<host>" is attempted.</p><p> 421 ERR_UNKNOWNCOMMAND<br> "<command> :Unknown command"</p><p> - Returned to a registered client to indicate that the<br> command sent is unknown by the server.</p><p> 422 ERR_NOMOTD<br> ":MOTD File is missing"</p><p> - Server's MOTD file could not be opened by the server.</p><p> 423 ERR_NOADMININFO<br> "<server> :No administrative info available"</p><p> - Returned by a server in response to an ADMIN message<br> when there is an error in finding the appropriate<br> information.</p><p> 424 ERR_FILEERROR<br> ":File error doing <file op> on <file>"</p><p>Oikarinen & Reed [Page 44]<br><br>RFC 1459 Internet Relay Chat Protocol May 1993</p><p> - Generic error message used to report a failed file<br> operation during the processing of a message.</p><p> 431 ERR_NONICKNAMEGIVEN<br> ":No nickname given"</p><p> - Returned when a nickname parameter expected for a<br> command and isn't found.</p><p> 432 ERR_ERRONEUSNICKNAME<br> "<nick> :Erroneus nickname"</p><p> - Returned after receiving a NICK message which contains<br> characters which do not fall in the defined set. See<br> section x.x.x for details on valid nicknames.</p><p> 433 ERR_NICKNAMEINUSE<br> "<nick> :Nickname is already in use"</p><p> - Returned when a NICK message is processed that results<br> in an attempt to change to a currently existing<br> nickname.</p><p> 436 ERR_NICKCOLLISION<br> "<nick> :Nickname collision KILL"</p><p> - Returned by a server to a client when it detects a<br> nickname collision (registered of a NICK that<br> already exists by another server).</p><p> 441 ERR_USERNOTINCHANNEL<br> "<nick> <channel> :They aren't on that channel"</p><p> - Returned by the server to indicate that the target<br> user of the command is not on the given channel.</p><p> 442 ERR_NOTONCHANNEL<br> "<channel> :You're not on that channel"</p><p> - Returned by the server whenever a client tries to<br> perform a channel effecting command for which the<br> client isn't a member.</p><p> 443 ERR_USERONCHANNEL<br> "<user> <channel> :is already on channel"</p><p> - Returned when a client tries to invite a user to a<br> channel they are already on.</p><p>Oikarinen & Reed [Page 45]<br><br>RFC 1459 Internet Relay Chat Protocol May 1993</p><p> 444 ERR_NOLOGIN<br> "<user> :User not logged in"</p><p> - Returned by the summon after a SUMMON command for a<br> user was unable to be performed since they were not<br> logged in.</p><p> 445 ERR_SUMMONDISABLED<br> ":SUMMON has been disabled"</p><p> - Returned as a response to the SUMMON command. Must be<br> returned by any server which does not implement it.</p><p> 446 ERR_USERSDISABLED<br> ":USERS has been disabled"</p><p> - Returned as a response to the USERS command. Must be<br> returned by any server which does not implement it.</p><p> 451 ERR_NOTREGISTERED<br> ":You have not registered"</p><p> - Returned by the server to indicate that the client<br> must be registered before the server will allow it<br> to be parsed in detail.</p><p> 461 ERR_NEEDMOREPARAMS<br> "<command> :Not enough parameters"</p><p> - Returned by the server by numerous commands to<br> indicate to the client that it didn't supply enough<br> parameters.</p><p> 462 ERR_ALREADYREGISTRED<br> ":You may not reregister"</p><p> - Returned by the server to any link which tries to<br> change part of the registered details (such as<br> password or user details from second USER message).</p><p> 463 ERR_NOPERMFORHOST<br> ":Your host isn't among the privileged"</p><p> - Returned to a client which attempts to register with<br> a server which does not been setup to allow<br> connections from the host the attempted connection<br> is tried.</p><p>Oikarinen & Reed [Page 46]<br><br>RFC 1459 Internet Relay Chat Protocol May 1993</p><p> 464 ERR_PASSWDMISMATCH<br> ":Password incorrect"</p><p> - Returned to indicate a failed attempt at registering<br> a connection for which a password was required and<br> was either not given or incorrect.</p><p> 465 ERR_YOUREBANNEDCREEP<br> ":You are banned from this server"</p><p> - Returned after an attempt to connect and register<br> yourself with a server which has been setup to<br> explicitly deny connections to you.</p><p> 467 ERR_KEYSET<br> "<channel> :Channel key already set"<br> 471 ERR_CHANNELISFULL<br> "<channel> :Cannot join channel (+l)"<br> 472 ERR_UNKNOWNMODE<br> "<char> :is unknown mode char to me"<br> 473 ERR_INVITEONLYCHAN<br> "<channel> :Cannot join channel (+i)"<br> 474 ERR_BANNEDFROMCHAN<br> "<channel> :Cannot join channel (+b)"<br> 475 ERR_BADCHANNELKEY<br> "<channel> :Cannot join channel (+k)"<br> 481 ERR_NOPRIVILEGES<br> ":Permission Denied- You're not an IRC operator"</p><p> - Any command requiring operator privileges to operate<br> must return this error to indicate the attempt was<br> unsuccessful.</p><p> 482 ERR_CHANOPRIVSNEEDED<br> "<channel> :You're not channel operator"</p><p> - Any command requiring 'chanop' privileges (such as<br> MODE messages) must return this error if the client<br> making the attempt is not a chanop on the specified<br> channel.</p><p> 483 ERR_CANTKILLSERVER<br> ":You cant kill a server!"</p><p> - Any attempts to use the KILL command on a server<br> are to be refused and this error returned directly<br> to the client.</p><p>Oikarinen & Reed [Page 47]<br><br>RFC 1459 Internet Relay Chat Protocol May 1993</p><p> 491 ERR_NOOPERHOST<br> ":No O-lines for your host"</p><p> - If a client sends an OPER message and the server has<br> not been configured to allow connections from the<br> client's host as an operator, this error must be<br> returned.</p><p> 501 ERR_UMODEUNKNOWNFLAG<br> ":Unknown MODE flag"</p><p> - Returned by the server to indicate that a MODE<br> message was sent with a nickname parameter and that<br> the a mode flag sent was not recognized.</p><p> 502 ERR_USERSDONTMATCH<br> ":Cant change mode for other users"</p><p> - Error sent to any user trying to view or change the<br> user mode for a user other than themselves.</p><p>6.2 Command responses.</p><p> 300 RPL_NONE<br> Dummy reply number. Not used.</p><p> 302 RPL_USERHOST<br> ":[<reply>{<space><reply>}]"</p><p> - Reply format used by USERHOST to list replies to<br> the query list. The reply string is composed as<br> follows:</p><p> <reply> ::= <nick>['*'] '=' <'+'|'-'><hostname></p><p> The '*' indicates whether the client has registered<br> as an Operator. The '-' or '+' characters represent<br> whether the client has set an AWAY message or not<br> respectively.</p><p> 303 RPL_ISON<br> ":[<nick> {<space><nick>}]"</p><p> - Reply format used by ISON to list replies to the<br> query list.</p><p> 301 RPL_AWAY<br> "<nick> :<away message>"</p><p>Oikarinen & Reed [Page 48]<br><br>RFC 1459 Internet Relay Chat Protocol May 1993</p><p> 305 RPL_UNAWAY<br> ":You are no longer marked as being away"<br> 306 RPL_NOWAWAY<br> ":You have been marked as being away"</p><p> - These replies are used with the AWAY command (if<br> allowed). RPL_AWAY is sent to any client sending a<br> PRIVMSG to a client which is away. RPL_AWAY is only<br> sent by the server to which the client is connected.<br> Replies RPL_UNAWAY and RPL_NOWAWAY are sent when the<br> client removes and sets an AWAY message.</p><p> 311 RPL_WHOISUSER<br> "<nick> <user> <host> * :<real name>"<br> 312 RPL_WHOISSERVER<br> "<nick> <server> :<server info>"<br> 313 RPL_WHOISOPERATOR<br> "<nick> :is an IRC operator"<br> 317 RPL_WHOISIDLE<br> "<nick> <integer> :seconds idle"<br> 318 RPL_ENDOFWHOIS<br> "<nick> :End of /WHOIS list"<br> 319 RPL_WHOISCHANNELS<br> "<nick> :{[@|+]<channel><space>}"</p><p> - Replies 311 - 313, 317 - 319 are all replies<br> generated in response to a WHOIS message. Given that<br> there are enough parameters present, the answering<br> server must either formulate a reply out of the above<br> numerics (if the query nick is found) or return an<br> error reply. The '*' in RPL_WHOISUSER is there as<br> the literal character and not as a wild card. For<br> each reply set, only RPL_WHOISCHANNELS may appear<br> more than once (for long lists of channel names).<br> The '@' and '+' characters next to the channel name<br> indicate whether a client is a channel operator or<br> has been granted permission to speak on a moderated<br> channel. The RPL_ENDOFWHOIS reply is used to mark<br> the end of processing a WHOIS message.</p><p> 314 RPL_WHOWASUSER<br> "<nick> <user> <host> * :<real name>"<br> 369 RPL_ENDOFWHOWAS<br> "<nick> :End of WHOWAS"</p><p> - When replying to a WHOWAS message, a server must use<br> the replies RPL_WHOWASUSER, RPL_WHOISSERVER or<br> ERR_WASNOSUCHNICK for each nickname in the presented</p><p>Oikarinen & Reed [Page 49]<br><br>RFC 1459 Internet Relay Chat Protocol May 1993</p><p> list. At the end of all reply batches, there must<br> be RPL_ENDOFWHOWAS (even if there was only one reply<br> and it was an error).</p><p> 321 RPL_LISTSTART<br> "Channel :Users Name"<br> 322 RPL_LIST<br> "<channel> <# visible> :<topic>"<br> 323 RPL_LISTEND<br> ":End of /LIST"</p><p> - Replies RPL_LISTSTART, RPL_LIST, RPL_LISTEND mark<br> the start, actual replies with data and end of the<br> server's response to a LIST command. If there are<br> no channels available to return, only the start<br> and end reply must be sent.</p><p> 324 RPL_CHANNELMODEIS<br> "<channel> <mode> <mode params>"</p><p> 331 RPL_NOTOPIC<br> "<channel> :No topic is set"<br> 332 RPL_TOPIC<br> "<channel> :<topic>"</p><p> - When sending a TOPIC message to determine the<br> channel topic, one of two replies is sent. If<br> the topic is set, RPL_TOPIC is sent back else<br> RPL_NOTOPIC.</p><p> 341 RPL_INVITING<br> "<channel> <nick>"</p><p> - Returned by the server to indicate that the<br> attempted INVITE message was successful and is<br> being passed onto the end client.</p><p> 342 RPL_SUMMONING<br> "<user> :Summoning user to IRC"</p><p> - Returned by a server answering a SUMMON message to<br> indicate that it is summoning that user.</p><p> 351 RPL_VERSION<br> "<version>.<debuglevel> <server> :<comments>"</p><p> - Reply by the server showing its version details.<br> The <version> is the version of the software being</p><p>Oikarinen & Reed [Page 50]<br><br>RFC 1459 Internet Relay Chat Protocol May 1993</p><p> used (including any patchlevel revisions) and the<br> <debuglevel> is used to indicate if the server is<br> running in "debug mode".</p><p> The "comments" field may contain any comments about<br> the version or further version details.</p><p> 352 RPL_WHOREPLY<br> "<channel> <user> <host> <server> <nick> \<br> <H|G>[*][@|+] :<hopcount> <real name>"<br> 315 RPL_ENDOFWHO<br> "<name> :End of /WHO list"</p><p> - The RPL_WHOREPLY and RPL_ENDOFWHO pair are used<br> to answer a WHO message. The RPL_WHOREPLY is only<br> sent if there is an appropriate match to the WHO<br> query. If there is a list of parameters supplied<br> with a WHO message, a RPL_ENDOFWHO must be sent<br> after processing each list item with <name> being<br> the item.</p><p> 353 RPL_NAMREPLY<br> "<channel> :[[@|+]<nick> [[@|+]<nick> [...]]]"<br> 366 RPL_ENDOFNAMES<br> "<channel> :End of /NAMES list"</p><p> - To reply to a NAMES message, a reply pair consisting<br> of RPL_NAMREPLY and RPL_ENDOFNAMES is sent by the<br> server back to the client. If there is no channel<br> found as in the query, then only RPL_ENDOFNAMES is<br> returned. The exception to this is when a NAMES<br> message is sent with no parameters and all visible<br> channels and contents are sent back in a series of<br> RPL_NAMEREPLY messages with a RPL_ENDOFNAMES to mark<br> the end.</p><p> 364 RPL_LINKS<br> "<mask> <server> :<hopcount> <server info>"<br> 365 RPL_ENDOFLINKS<br> "<mask> :End of /LINKS list"</p><p> - In replying to the LINKS message, a server must send<br> replies back using the RPL_LINKS numeric and mark the<br> end of the list using an RPL_ENDOFLINKS reply.</p><p> 367 RPL_BANLIST<br> "<channel> <banid>"<br> 368 RPL_ENDOFBANLIST</p><p>Oikarinen & Reed [Page 51]<br><br>RFC 1459 Internet Relay Chat Protocol May 1993</p><p> "<channel> :End of channel ban list"</p><p> - When listing the active 'bans' for a given channel,<br> a server is required to send the list back using the<br> RPL_BANLIST and RPL_ENDOFBANLIST messages. A separate<br> RPL_BANLIST is sent for each active banid. After the<br> banids have been listed (or if none present) a<br> RPL_ENDOFBANLIST must be sent.</p><p> 371 RPL_INFO<br> ":<string>"<br> 374 RPL_ENDOFINFO<br> ":End of /INFO list"</p><p> - A server responding to an INFO message is required to<br> send all its 'info' in a series of RPL_INFO messages<br> with a RPL_ENDOFINFO reply to indicate the end of the<br> replies.</p><p> 375 RPL_MOTDSTART<br> ":- <server> Message of the day - "<br> 372 RPL_MOTD<br> ":- <text>"<br> 376 RPL_ENDOFMOTD<br> ":End of /MOTD command"</p><p> - When responding to the MOTD message and the MOTD file<br> is found, the file is displayed line by line, with<br> each line no longer than 80 characters, using<br> RPL_MOTD format replies. These should be surrounded<br> by a RPL_MOTDSTART (before the RPL_MOTDs) and an<br> RPL_ENDOFMOTD (after).</p><p> 381 RPL_YOUREOPER<br> ":You are now an IRC operator"</p><p> - RPL_YOUREOPER is sent back to a client which has<br> just successfully issued an OPER message and gained<br> operator status.</p><p> 382 RPL_REHASHING<br> "<config file> :Rehashing"</p><p> - If the REHASH option is used and an operator sends<br> a REHASH message, an RPL_REHASHING is sent back to<br> the operator.</p><p> 391 RPL_TIME</p><p>Oikarinen & Reed [Page 52]<br><br>RFC 1459 Internet Relay Chat Protocol May 1993</p><p> "<server> :<string showing server's local time>"</p><p> - When replying to the TIME message, a server must send<br> the reply using the RPL_TIME format above. The string<br> showing the time need only contain the correct day and<br> time there. There is no further requirement for the<br> time string.</p><p> 392 RPL_USERSSTART<br> ":UserID Terminal Host"<br> 393 RPL_USERS<br> ":%-8s %-9s %-8s"<br> 394 RPL_ENDOFUSERS<br> ":End of users"<br> 395 RPL_NOUSERS<br> ":Nobody logged in"</p><p> - If the USERS message is handled by a server, the<br> replies RPL_USERSTART, RPL_USERS, RPL_ENDOFUSERS and<br> RPL_NOUSERS are used. RPL_USERSSTART must be sent<br> first, following by either a sequence of RPL_USERS<br> or a single RPL_NOUSER. Following this is<br> RPL_ENDOFUSERS.</p><p> 200 RPL_TRACELINK<br> "Link <version & debug level> <destination> \<br> <next server>"<br> 201 RPL_TRACECONNECTING<br> "Try. <class> <server>"<br> 202 RPL_TRACEHANDSHAKE<br> "H.S. <class> <server>"<br> 203 RPL_TRACEUNKNOWN<br> "???? <class> [<client IP address in dot form>]"<br> 204 RPL_TRACEOPERATOR<br> "Oper <class> <nick>"<br> 205 RPL_TRACEUSER<br> "User <class> <nick>"<br> 206 RPL_TRACESERVER<br> "Serv <class> <int>S <int>C <server> \<br> <nick!user|*!*>@<host|server>"<br> 208 RPL_TRACENEWTYPE<br> "<newtype> 0 <client name>"<br> 261 RPL_TRACELOG<br> "File <logfile> <debug level>"</p><p> - The RPL_TRACE* are all returned by the server in<br> response to the TRACE message. How many are<br> returned is dependent on the the TRACE message and</p><p>Oikarinen & Reed [Page 53]<br><br>RFC 1459 Internet Relay Chat Protocol May 1993</p><p> whether it was sent by an operator or not. There<br> is no predefined order for which occurs first.<br> Replies RPL_TRACEUNKNOWN, RPL_TRACECONNECTING and<br> RPL_TRACEHANDSHAKE are all used for connections<br> which have not been fully established and are either<br> unknown, still attempting to connect or in the<br> process of completing the 'server handshake'.<br> RPL_TRACELINK is sent by any server which handles<br> a TRACE message and has to pass it on to another<br> server. The list of RPL_TRACELINKs sent in<br> response to a TRACE command traversing the IRC<br> network should reflect the actual connectivity of<br> the servers themselves along that path.<br> RPL_TRACENEWTYPE is to be used for any connection<br> which does not fit in the other categories but is<br> being displayed anyway.</p><p> 211 RPL_STATSLINKINFO<br> "<linkname> <sendq> <sent messages> \<br> <sent bytes> <received messages> \<br> <received bytes> <time open>"<br> 212 RPL_STATSCOMMANDS<br> "<command> <count>"<br> 213 RPL_STATSCLINE<br> "C <host> * <name> <port> <class>"<br> 214 RPL_STATSNLINE<br> "N <host> * <name> <port> <class>"<br> 215 RPL_STATSILINE<br> "I <host> * <host> <port> <class>"<br> 216 RPL_STATSKLINE<br> "K <host> * <username> <port> <class>"<br> 218 RPL_STATSYLINE<br> "Y <class> <ping frequency> <connect \<br> frequency> <max sendq>"<br> 219 RPL_ENDOFSTATS<br> "<stats letter> :End of /STATS report"<br> 241 RPL_STATSLLINE<br> "L <hostmask> * <servername> <maxdepth>"<br> 242 RPL_STATSUPTIME<br> ":Server Up %d days %d:%02d:%02d"<br> 243 RPL_STATSOLINE<br> "O <hostmask> * <name>"<br> 244 RPL_STATSHLINE<br> "H <hostmask> * <servername>"</p><p> 221 RPL_UMODEIS<br> "<user mode string>"</p><p>Oikarinen & Reed [Page 54]<br><br>RFC 1459 Internet Relay Chat Protocol May 1993</p><p> - To answer a query about a client's own mode,<br> RPL_UMODEIS is sent back.</p><p> 251 RPL_LUSERCLIENT<br> ":There are <integer> users and <integer> \<br> invisible on <integer> servers"<br> 252 RPL_LUSEROP<br> "<integer> :operator(s) online"<br> 253 RPL_LUSERUNKNOWN<br> "<integer> :unknown connection(s)"<br> 254 RPL_LUSERCHANNELS<br> "<integer> :channels formed"<br> 255 RPL_LUSERME<br> ":I have <integer> clients and <integer> \<br> servers"</p><p> - In processing an LUSERS message, the server<br> sends a set of replies from RPL_LUSERCLIENT,<br> RPL_LUSEROP, RPL_USERUNKNOWN,<br> RPL_LUSERCHANNELS and RPL_LUSERME. When<br> replying, a server must send back<br> RPL_LUSERCLIENT and RPL_LUSERME. The other<br> replies are only sent back if a non-zero count<br> is found for them.</p><p> 256 RPL_ADMINME<br> "<server> :Administrative info"<br> 257 RPL_ADMINLOC1<br> ":<admin info>"<br> 258 RPL_ADMINLOC2<br> ":<admin info>"<br> 259 RPL_ADMINEMAIL<br> ":<admin info>"</p><p> - When replying to an ADMIN message, a server<br> is expected to use replies RLP_ADMINME<br> through to RPL_ADMINEMAIL and provide a text<br> message with each. For RPL_ADMINLOC1 a<br> description of what city, state and country<br> the server is in is expected, followed by<br> details of the university and department<br> (RPL_ADMINLOC2) and finally the administrative<br> contact for the server (an email address here<br> is required) in RPL_ADMINEMAIL.</p><p>Oikarinen & Reed [Page 55]<br><br>RFC 1459 Internet Relay Chat Protocol May 1993</p><p>6.3 Reserved numerics.</p><p> These numerics are not described above since they fall into one of<br> the following categories:</p><p> 1. no longer in use;</p><p> 2. reserved for future planned use;</p><p> 3. in current use but are part of a non-generic 'feature' of<br> the current IRC server.</p><p> 209 RPL_TRACECLASS 217 RPL_STATSQLINE<br> 231 RPL_SERVICEINFO 232 RPL_ENDOFSERVICES<br> 233 RPL_SERVICE 234 RPL_SERVLIST<br> 235 RPL_SERVLISTEND<br> 316 RPL_WHOISCHANOP 361 RPL_KILLDONE<br> 362 RPL_CLOSING 363 RPL_CLOSEEND<br> 373 RPL_INFOSTART 384 RPL_MYPORTIS<br> 466 ERR_YOUWILLBEBANNED 476 ERR_BADCHANMASK<br> 492 ERR_NOSERVICEHOST</p><p>7. Client and server authentication</p><p> Clients and servers are both subject to the same level of<br> authentication. For both, an IP number to hostname lookup (and<br> reverse check on this) is performed for all connections made to the<br> server. Both connections are then subject to a password check (if<br> there is a password set for that connection). These checks are<br> possible on all connections although the password check is only<br> commonly used with servers.</p><p> An additional check that is becoming of more and more common is that<br> of the username responsible for making the connection. Finding the<br> username of the other end of the connection typically involves<br> connecting to an authentication server such as IDENT as described in<br> RFC 1413.</p><p> Given that without passwords it is not easy to reliably determine who<br> is on the other end of a network connection, use of passwords is<br> strongly recommended on inter-server connections in addition to any<br> other measures such as using an ident server.</p><p>8. Current implementations</p><p> The only current implementation of this protocol is the IRC server,<br> version 2.8. Earlier versions may implement some or all of the<br> commands described by this document with NOTICE messages replacing</p><p>Oikarinen & Reed [Page 56]<br><br>RFC 1459 Internet Relay Chat Protocol May 1993</p><p> many of the numeric replies. Unfortunately, due to backward<br> compatibility requirements, the implementation of some parts of this<br> document varies with what is laid out. On notable difference is:</p><p> * recognition that any LF or CR anywhere in a message marks the<br> end of that message (instead of requiring CR-LF);</p><p> The rest of this section deals with issues that are mostly of<br> importance to those who wish to implement a server but some parts<br> also apply directly to clients as well.</p><p>8.1 Network protocol: TCP - why it is best used here.</p><p> IRC has been implemented on top of TCP since TCP supplies a reliable<br> network protocol which is well suited to this scale of conferencing.<br> The use of multicast IP is an alternative, but it is not widely<br> available or supported at the present time.</p><p>8.1.1 Support of Unix sockets</p><p> Given that Unix domain sockets allow listen/connect operations, the<br> current implementation can be configured to listen and accept both<br> client and server connections on a Unix domain socket. These are<br> recognized as sockets where the hostname starts with a '/'.</p><p> When providing any information about the connections on a Unix domain<br> socket, the server is required to supplant the actual hostname in<br> place of the pathname unless the actual socket name is being asked<br> for.</p><p>8.2 Command Parsing</p><p> To provide useful 'non-buffered' network IO for clients and servers,<br> each connection is given its own private 'input buffer' in which the<br> results of the most recent read and parsing are kept. A buffer size<br> of 512 bytes is used so as to hold 1 full message, although, this<br> will usually hold several commands. The private buffer is parsed<br> after every read operation for valid messages. When dealing with<br> multiple messages from one client in the buffer, care should be taken<br> in case one happens to cause the client to be 'removed'.</p><p>8.3 Message delivery</p><p> It is common to find network links saturated or hosts to which you<br> are sending data unable to send data. Although Unix typically<br> handles this through the TCP window and internal buffers, the server<br> often has large amounts of data to send (especially when a new<br> server-server link forms) and the small buffers provided in the</p><p>Oikarinen & Reed [Page 57]<br><br>RFC 1459 Internet Relay Chat Protocol May 1993</p><p> kernel are not enough for the outgoing queue. To alleviate this<br> problem, a "send queue" is used as a FIFO queue for data to be sent.<br> A typical "send queue" may grow to 200 Kbytes on a large IRC network<br> with a slow network connection when a new server connects.</p><p> When polling its connections, a server will first read and parse all<br> incoming data, queuing any data to be sent out. When all available<br> input is processed, the queued data is sent. This reduces the number<br> of write() system calls and helps TCP make bigger packets.</p><p>8.4 Connection 'Liveness'</p><p> To detect when a connection has died or become unresponsive, the<br> server must ping each of its connections that it doesn't get a<br> response from in a given amount of time.</p><p> If a connection doesn't respond in time, its connection is closed<br> using the appropriate procedures. A connection is also dropped if<br> its sendq grows beyond the maximum allowed, because it is better to<br> close a slow connection than have a server process block.</p><p>8.5 Establishing a server to client connection</p><p> Upon connecting to an IRC server, a client is sent the MOTD (if<br> present) as well as the current user/server count (as per the LUSER<br> command). The server is also required to give an unambiguous message<br> to the client which states its name and version as well as any other<br> introductory messages which may be deemed appropriate.</p><p> After dealing with this, the server must then send out the new user's<br> nickname and other information as supplied by itself (USER command)<br> and as the server could discover (from DNS/authentication servers).<br> The server must send this information out with NICK first followed by<br> USER.</p><p>8.6 Establishing a server-server connection.</p><p> The process of establishing of a server-to-server connection is<br> fraught with danger since there are many possible areas where<br> problems can occur - the least of which are race conditions.</p><p> After a server has received a connection following by a PASS/SERVER<br> pair which were recognised as being valid, the server should then<br> reply with its own PASS/SERVER information for that connection as<br> well as all of the other state information it knows about as<br> described below.</p><p> When the initiating server receives a PASS/SERVER pair, it too then</p><p>Oikarinen & Reed [Page 58]<br><br>RFC 1459 Internet Relay Chat Protocol May 1993</p><p> checks that the server responding is authenticated properly before<br> accepting the connection to be that server.</p><p>8.6.1 Server exchange of state information when connecting</p><p> The order of state information being exchanged between servers is<br> essential. The required order is as follows:</p><p> * all known other servers;</p><p> * all known user information;</p><p> * all known channel information.</p><p> Information regarding servers is sent via extra SERVER messages, user<br> information with NICK/USER/MODE/JOIN messages and channels with MODE<br> messages.</p><p> NOTE: channel topics are *NOT* exchanged here because the TOPIC<br> command overwrites any old topic information, so at best, the two<br> sides of the connection would exchange topics.</p><p> By passing the state information about servers first, any collisions<br> with servers that already exist occur before nickname collisions due<br> to a second server introducing a particular nickname. Due to the IRC<br> network only being able to exist as an acyclic graph, it may be<br> possible that the network has already reconnected in another<br> location, the place where the collision occurs indicating where the<br> net needs to split.</p><p>8.7 Terminating server-client connections</p><p> When a client connection closes, a QUIT message is generated on<br> behalf of the client by the server to which the client connected. No<br> other message is to be generated or used.</p><p>8.8 Terminating server-server connections</p><p> If a server-server connection is closed, either via a remotely<br> generated SQUIT or 'natural' causes, the rest of the connected IRC<br> network must have its information updated with by the server which<br> detected the closure. The server then sends a list of SQUITs (one<br> for each server behind that connection) and a list of QUITs (again,<br> one for each client behind that connection).</p><p>Oikarinen & Reed [Page 59]<br><br>RFC 1459 Internet Relay Chat Protocol May 1993</p><p>8.9 Tracking nickname changes</p><p> All IRC servers are required to keep a history of recent nickname<br> changes. This is required to allow the server to have a chance of<br> keeping in touch of things when nick-change race conditions occur<br> with commands which manipulate them. Commands which must trace nick<br> changes are:</p><p> * KILL (the nick being killed)</p><p> * MODE (+/- o,v)</p><p> * KICK (the nick being kicked)</p><p> No other commands are to have nick changes checked for.</p><p> In the above cases, the server is required to first check for the<br> existence of the nickname, then check its history to see who that<br> nick currently belongs to (if anyone!). This reduces the chances of<br> race conditions but they can still occur with the server ending up<br> affecting the wrong client. When performing a change trace for an<br> above command it is recommended that a time range be given and<br> entries which are too old ignored.</p><p> For a reasonable history, a server should be able to keep previous<br> nickname for every client it knows about if they all decided to<br> change. This size is limited by other factors (such as memory, etc).</p><p>8.10 Flood control of clients</p><p> With a large network of interconnected IRC servers, it is quite easy<br> for any single client attached to the network to supply a continuous<br> stream of messages that result in not only flooding the network, but<br> also degrading the level of service provided to others. Rather than<br> require every 'victim' to be provide their own protection, flood<br> protection was written into the server and is applied to all clients<br> except services. The current algorithm is as follows:</p><p> * check to see if client's `message timer' is less than<br> current time (set to be equal if it is);</p><p> * read any data present from the client;</p><p> * while the timer is less than ten seconds ahead of the current<br> time, parse any present messages and penalize the client by<br> 2 seconds for each message;</p><p> which in essence means that the client may send 1 message every 2</p><p>Oikarinen & Reed [Page 60]<br><br>RFC 1459 Internet Relay Chat Protocol May 1993</p><p> seconds without being adversely affected.</p><p>8.11 Non-blocking lookups</p><p> In a real-time environment, it is essential that a server process do<br> as little waiting as possible so that all the clients are serviced<br> fairly. Obviously this requires non-blocking IO on all network<br> read/write operations. For normal server connections, this was not<br> difficult, but there are other support operations that may cause the<br> server to block (such as disk reads). Where possible, such activity<br> should be performed with a short timeout.</p><p>8.11.1 Hostname (DNS) lookups</p><p> Using the standard resolver libraries from Berkeley and others has<br> meant large delays in some cases where replies have timed out. To<br> avoid this, a separate set of DNS routines were written which were<br> setup for non-blocking IO operations and then polled from within the<br> main server IO loop.</p><p>8.11.2 Username (Ident) lookups</p><p> Although there are numerous ident libraries for use and inclusion<br> into other programs, these caused problems since they operated in a<br> synchronous manner and resulted in frequent delays. Again the<br> solution was to write a set of routines which would cooperate with<br> the rest of the server and work using non-blocking IO.</p><p>8.12 Configuration File</p><p> To provide a flexible way of setting up and running the server, it is<br> recommended that a configuration file be used which contains<br> instructions to the server on the following:</p><p> * which hosts to accept client connections from;</p><p> * which hosts to allow to connect as servers;</p><p> * which hosts to connect to (both actively and<br> passively);</p><p> * information about where the server is (university,<br> city/state, company are examples of this);</p><p> * who is responsible for the server and an email address<br> at which they can be contacted;</p><p> * hostnames and passwords for clients which wish to be given</p><p>Oikarinen & Reed [Page 61]<br><br>RFC 1459 Internet Relay Chat Protocol May 1993</p><p> access to restricted operator commands.</p><p> In specifying hostnames, both domain names and use of the 'dot'<br> notation (127.0.0.1) should both be accepted. It must be possible to<br> specify the password to be used/accepted for all outgoing and<br> incoming connections (although the only outgoing connections are<br> those to other servers).</p><p> The above list is the minimum requirement for any server which wishes<br> to make a connection with another server. Other items which may be<br> of use are:</p><p> * specifying which servers other server may introduce;</p><p> * how deep a server branch is allowed to become;</p><p> * hours during which clients may connect.</p><p>8.12.1 Allowing clients to connect</p><p> A server should use some sort of 'access control list' (either in the<br> configuration file or elsewhere) that is read at startup and used to<br> decide what hosts clients may use to connect to it.</p><p> Both 'deny' and 'allow' should be implemented to provide the required<br> flexibility for host access control.</p><p>8.12.2 Operators</p><p> The granting of operator privileges to a disruptive person can have<br> dire consequences for the well-being of the IRC net in general due to<br> the powers given to them. Thus, the acquisition of such powers<br> should not be very easy. The current setup requires two 'passwords'<br> to be used although one of them is usually easy guessed. Storage of<br> oper passwords in configuration files is preferable to hard coding<br> them in and should be stored in a crypted format (ie using crypt(3)<br> from Unix) to prevent easy theft.</p><p>8.12.3 Allowing servers to connect</p><p> The interconnection of server is not a trivial matter: a bad<br> connection can have a large impact on the usefulness of IRC. Thus,<br> each server should have a list of servers to which it may connect and<br> which servers may connect to it. Under no circumstances should a<br> server allow an arbitrary host to connect as a server. In addition<br> to which servers may and may not connect, the configuration file<br> should also store the password and other characteristics of that<br> link.</p><p>Oikarinen & Reed [Page 62]<br><br>RFC 1459 Internet Relay Chat Protocol May 1993</p><p>8.12.4 Administrivia</p><p> To provide accurate and valid replies to the ADMIN command (see<br> section 4.3.7), the server should find the relevant details in the<br> configuration.</p><p>8.13 Channel membership</p><p> The current server allows any registered local user to join upto 10<br> different channels. There is no limit imposed on non-local users so<br> that the server remains (reasonably) consistant with all others on a<br> channel membership basis</p><p>9. Current problems</p><p> There are a number of recognized problems with this protocol, all of<br> which hope to be solved sometime in the near future during its<br> rewrite. Currently, work is underway to find working solutions to<br> these problems.</p><p>9.1 Scalability</p><p> It is widely recognized that this protocol does not scale<br> sufficiently well when used in a large arena. The main problem comes<br> from the requirement that all servers know about all other servers<br> and users and that information regarding them be updated as soon as<br> it changes. It is also desirable to keep the number of servers low<br> so that the path length between any two points is kept minimal and<br> the spanning tree as strongly branched as possible.</p><p>9.2 Labels</p><p> The current IRC protocol has 3 types of labels: the nickname, the<br> channel name and the server name. Each of the three types has its<br> own domain and no duplicates are allowed inside that domain.<br> Currently, it is possible for users to pick the label for any of the<br> three, resulting in collisions. It is widely recognized that this<br> needs reworking, with a plan for unique names for channels and nicks<br> that don't collide being desirable as well as a solution allowing a<br> cyclic tree.</p><p>9.2.1 Nicknames</p><p> The idea of the nickname on IRC is very convenient for users to use<br> when talking to each other outside of a channel, but there is only a<br> finite nickname space and being what they are, its not uncommon for<br> several people to want to use the same nick. If a nickname is chosen<br> by two people using this protocol, either one will not succeed or</p><p>Oikarinen & Reed [Page 63]<br><br>RFC 1459 Internet Relay Chat Protocol May 1993</p><p> both will removed by use of KILL (4.6.1).</p><p>9.2.2 Channels</p><p> The current channel layout requires that all servers know about all<br> channels, their inhabitants and properties. Besides not scaling<br> well, the issue of privacy is also a concern. A collision of<br> channels is treated as an inclusive event (both people who create the<br> new channel are considered to be members of it) rather than an<br> exclusive one such as used to solve nickname collisions.</p><p>9.2.3 Servers</p><p> Although the number of servers is usually small relative to the<br> number of users and channels, they two currently required to be known<br> globally, either each one separately or hidden behind a mask.</p><p>9.3 Algorithms</p><p> In some places within the server code, it has not been possible to<br> avoid N^2 algorithms such as checking the channel list of a set<br> of clients.</p><p> In current server versions, there are no database consistency checks,<br> each server assumes that a neighbouring server is correct. This<br> opens the door to large problems if a connecting server is buggy or<br> otherwise tries to introduce contradictions to the existing net.</p><p> Currently, because of the lack of unique internal and global labels,<br> there are a multitude of race conditions that exist. These race<br> conditions generally arise from the problem of it taking time for<br> messages to traverse and effect the IRC network. Even by changing to<br> unique labels, there are problems with channel-related commands being<br> disrupted.</p><p>10. Current support and availability</p><p> Mailing lists for IRC related discussion:<br> Future protocol: ircd-three-request@eff.org<br> General discussion: operlist-request@eff.org</p><p> Software implemenations<br> cs.bu.edu:/irc<br> nic.funet.fi:/pub/irc<br> coombs.anu.edu.au:/pub/irc</p><p> Newsgroup: alt.irc</p><p>Oikarinen & Reed [Page 64]<br><br>RFC 1459 Internet Relay Chat Protocol May 1993</p><p>Security Considerations</p><p> Security issues are discussed in sections 4.1, 4.1.1, 4.1.3, 5.5, and<br> 7.</p><p>12. Authors' Addresses</p><p> Jarkko Oikarinen<br> Tuirantie 17 as 9<br> 90500 OULU<br> FINLAND</p><p> Email: jto@tolsun.oulu.fi</p><p> Darren Reed<br> 4 Pateman Street<br> Watsonia, Victoria 3087<br> Australia</p><p> Email: avalon@coombs.anu.edu.au</p><p>Oikarinen & Reed [Page 65]</p>