You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

RFC1459.txt 138KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562
  1. Network Working Group J. Oikarinen
  2. Request for Comments: 1459 D. Reed
  3. May 1993
  4. Internet Relay Chat Protocol
  5. Status of This Memo
  6. This memo defines an Experimental Protocol for the Internet
  7. community. Discussion and suggestions for improvement are requested.
  8. Please refer to the current edition of the "IAB Official Protocol
  9. Standards" for the standardization state and status of this protocol.
  10. Distribution of this memo is unlimited.
  11. Abstract
  12. The IRC protocol was developed over the last 4 years since it was
  13. first implemented as a means for users on a BBS to chat amongst
  14. themselves. Now it supports a world-wide network of servers and
  15. clients, and is stringing to cope with growth. Over the past 2 years,
  16. the average number of users connected to the main IRC network has
  17. grown by a factor of 10.
  18. The IRC protocol is a text-based protocol, with the simplest client
  19. being any socket program capable of connecting to the server.
  20. Table of Contents
  21. 1. INTRODUCTION ............................................... 4
  22. 1.1 Servers ................................................ 4
  23. 1.2 Clients ................................................ 5
  24. 1.2.1 Operators .......................................... 5
  25. 1.3 Channels ................................................ 5
  26. 1.3.1 Channel Operators .................................... 6
  27. 2. THE IRC SPECIFICATION ....................................... 7
  28. 2.1 Overview ................................................ 7
  29. 2.2 Character codes ......................................... 7
  30. 2.3 Messages ................................................ 7
  31. 2.3.1 Message format in 'pseudo' BNF .................... 8
  32. 2.4 Numeric replies ......................................... 10
  33. 3. IRC Concepts ................................................ 10
  34. 3.1 One-to-one communication ................................ 10
  35. 3.2 One-to-many ............................................. 11
  36. 3.2.1 To a list .......................................... 11
  37. 3.2.2 To a group (channel) ............................... 11
  38. 3.2.3 To a host/server mask .............................. 12
  39. 3.3 One to all .............................................. 12
  40. Oikarinen & Reed [Page 1]
  41. RFC 1459 Internet Relay Chat Protocol May 1993
  42. 3.3.1 Client to Client ................................... 12
  43. 3.3.2 Clients to Server .................................. 12
  44. 3.3.3 Server to Server ................................... 12
  45. 4. MESSAGE DETAILS ............................................. 13
  46. 4.1 Connection Registration ................................. 13
  47. 4.1.1 Password message ................................... 14
  48. 4.1.2 Nickname message ................................... 14
  49. 4.1.3 User message ....................................... 15
  50. 4.1.4 Server message ..................................... 16
  51. 4.1.5 Operator message ................................... 17
  52. 4.1.6 Quit message ....................................... 17
  53. 4.1.7 Server Quit message ................................ 18
  54. 4.2 Channel operations ...................................... 19
  55. 4.2.1 Join message ....................................... 19
  56. 4.2.2 Part message ....................................... 20
  57. 4.2.3 Mode message ....................................... 21
  58. 4.2.3.1 Channel modes ................................. 21
  59. 4.2.3.2 User modes .................................... 22
  60. 4.2.4 Topic message ...................................... 23
  61. 4.2.5 Names message ...................................... 24
  62. 4.2.6 List message ....................................... 24
  63. 4.2.7 Invite message ..................................... 25
  64. 4.2.8 Kick message ....................................... 25
  65. 4.3 Server queries and commands ............................. 26
  66. 4.3.1 Version message .................................... 26
  67. 4.3.2 Stats message ...................................... 27
  68. 4.3.3 Links message ...................................... 28
  69. 4.3.4 Time message ....................................... 29
  70. 4.3.5 Connect message .................................... 29
  71. 4.3.6 Trace message ...................................... 30
  72. 4.3.7 Admin message ...................................... 31
  73. 4.3.8 Info message ....................................... 31
  74. 4.4 Sending messages ........................................ 32
  75. 4.4.1 Private messages ................................... 32
  76. 4.4.2 Notice messages .................................... 33
  77. 4.5 User-based queries ...................................... 33
  78. 4.5.1 Who query .......................................... 33
  79. 4.5.2 Whois query ........................................ 34
  80. 4.5.3 Whowas message ..................................... 35
  81. 4.6 Miscellaneous messages .................................. 35
  82. 4.6.1 Kill message ....................................... 36
  83. 4.6.2 Ping message ....................................... 37
  84. 4.6.3 Pong message ....................................... 37
  85. 4.6.4 Error message ...................................... 38
  86. 5. OPTIONAL MESSAGES ........................................... 38
  87. 5.1 Away message ............................................ 38
  88. 5.2 Rehash command .......................................... 39
  89. 5.3 Restart command ......................................... 39
  90. Oikarinen & Reed [Page 2]
  91. RFC 1459 Internet Relay Chat Protocol May 1993
  92. 5.4 Summon message .......................................... 40
  93. 5.5 Users message ........................................... 40
  94. 5.6 Operwall command ........................................ 41
  95. 5.7 Userhost message ........................................ 42
  96. 5.8 Ison message ............................................ 42
  97. 6. REPLIES ..................................................... 43
  98. 6.1 Error Replies ........................................... 43
  99. 6.2 Command responses ....................................... 48
  100. 6.3 Reserved numerics ....................................... 56
  101. 7. Client and server authentication ............................ 56
  102. 8. Current Implementations Details ............................. 56
  103. 8.1 Network protocol: TCP ................................... 57
  104. 8.1.1 Support of Unix sockets ............................ 57
  105. 8.2 Command Parsing ......................................... 57
  106. 8.3 Message delivery ........................................ 57
  107. 8.4 Connection 'Liveness' ................................... 58
  108. 8.5 Establishing a server-client connection ................. 58
  109. 8.6 Establishing a server-server connection ................. 58
  110. 8.6.1 State information exchange when connecting ......... 59
  111. 8.7 Terminating server-client connections ................... 59
  112. 8.8 Terminating server-server connections ................... 59
  113. 8.9 Tracking nickname changes ............................... 60
  114. 8.10 Flood control of clients ............................... 60
  115. 8.11 Non-blocking lookups ................................... 61
  116. 8.11.1 Hostname (DNS) lookups ............................ 61
  117. 8.11.2 Username (Ident) lookups .......................... 61
  118. 8.12 Configuration file ..................................... 61
  119. 8.12.1 Allowing clients to connect ....................... 62
  120. 8.12.2 Operators ......................................... 62
  121. 8.12.3 Allowing servers to connect ....................... 62
  122. 8.12.4 Administrivia ..................................... 63
  123. 8.13 Channel membership ..................................... 63
  124. 9. Current problems ............................................ 63
  125. 9.1 Scalability ............................................. 63
  126. 9.2 Labels .................................................. 63
  127. 9.2.1 Nicknames .......................................... 63
  128. 9.2.2 Channels ........................................... 64
  129. 9.2.3 Servers ............................................ 64
  130. 9.3 Algorithms .............................................. 64
  131. 10. Support and availability ................................... 64
  132. 11. Security Considerations .................................... 65
  133. 12. Authors' Addresses ......................................... 65
  134. Oikarinen & Reed [Page 3]
  135. RFC 1459 Internet Relay Chat Protocol May 1993
  136. 1. INTRODUCTION
  137. The IRC (Internet Relay Chat) protocol has been designed over a
  138. number of years for use with text based conferencing. This document
  139. describes the current IRC protocol.
  140. The IRC protocol has been developed on systems using the TCP/IP
  141. network protocol, although there is no requirement that this remain
  142. the only sphere in which it operates.
  143. IRC itself is a teleconferencing system, which (through the use of
  144. the client-server model) is well-suited to running on many machines
  145. in a distributed fashion. A typical setup involves a single process
  146. (the server) forming a central point for clients (or other servers)
  147. to connect to, performing the required message delivery/multiplexing
  148. and other functions.
  149. 1.1 Servers
  150. The server forms the backbone of IRC, providing a point to which
  151. clients may connect to to talk to each other, and a point for other
  152. servers to connect to, forming an IRC network. The only network
  153. configuration allowed for IRC servers is that of a spanning tree [see
  154. Fig. 1] where each server acts as a central node for the rest of the
  155. net it sees.
  156. [ Server 15 ] [ Server 13 ] [ Server 14]
  157. / \ /
  158. / \ /
  159. [ Server 11 ] ------ [ Server 1 ] [ Server 12]
  160. / \ /
  161. / \ /
  162. [ Server 2 ] [ Server 3 ]
  163. / \ \
  164. / \ \
  165. [ Server 4 ] [ Server 5 ] [ Server 6 ]
  166. / | \ /
  167. / | \ /
  168. / | \____ /
  169. / | \ /
  170. [ Server 7 ] [ Server 8 ] [ Server 9 ] [ Server 10 ]
  171. :
  172. [ etc. ]
  173. :
  174. [ Fig. 1. Format of IRC server network ]
  175. Oikarinen & Reed [Page 4]
  176. RFC 1459 Internet Relay Chat Protocol May 1993
  177. 1.2 Clients
  178. A client is anything connecting to a server that is not another
  179. server. Each client is distinguished from other clients by a unique
  180. nickname having a maximum length of nine (9) characters. See the
  181. protocol grammar rules for what may and may not be used in a
  182. nickname. In addition to the nickname, all servers must have the
  183. following information about all clients: the real name of the host
  184. that the client is running on, the username of the client on that
  185. host, and the server to which the client is connected.
  186. 1.2.1 Operators
  187. To allow a reasonable amount of order to be kept within the IRC
  188. network, a special class of clients (operators) is allowed to perform
  189. general maintenance functions on the network. Although the powers
  190. granted to an operator can be considered as 'dangerous', they are
  191. nonetheless required. Operators should be able to perform basic
  192. network tasks such as disconnecting and reconnecting servers as
  193. needed to prevent long-term use of bad network routing. In
  194. recognition of this need, the protocol discussed herein provides for
  195. operators only to be able to perform such functions. See sections
  196. 4.1.7 (SQUIT) and 4.3.5 (CONNECT).
  197. A more controversial power of operators is the ability to remove a
  198. user from the connected network by 'force', i.e. operators are able
  199. to close the connection between any client and server. The
  200. justification for this is delicate since its abuse is both
  201. destructive and annoying. For further details on this type of
  202. action, see section 4.6.1 (KILL).
  203. 1.3 Channels
  204. A channel is a named group of one or more clients which will all
  205. receive messages addressed to that channel. The channel is created
  206. implicitly when the first client joins it, and the channel ceases to
  207. exist when the last client leaves it. While channel exists, any
  208. client can reference the channel using the name of the channel.
  209. Channels names are strings (beginning with a '&' or '#' character) of
  210. length up to 200 characters. Apart from the the requirement that the
  211. first character being either '&' or '#'; the only restriction on a
  212. channel name is that it may not contain any spaces (' '), a control G
  213. (^G or ASCII 7), or a comma (',' which is used as a list item
  214. separator by the protocol).
  215. There are two types of channels allowed by this protocol. One is a
  216. distributed channel which is known to all the servers that are
  217. Oikarinen & Reed [Page 5]
  218. RFC 1459 Internet Relay Chat Protocol May 1993
  219. connected to the network. These channels are marked by the first
  220. character being a only clients on the server where it exists may join
  221. it. These are distinguished by a leading '&' character. On top of
  222. these two types, there are the various channel modes available to
  223. alter the characteristics of individual channels. See section 4.2.3
  224. (MODE command) for more details on this.
  225. To create a new channel or become part of an existing channel, a user
  226. is required to JOIN the channel. If the channel doesn't exist prior
  227. to joining, the channel is created and the creating user becomes a
  228. channel operator. If the channel already exists, whether or not your
  229. request to JOIN that channel is honoured depends on the current modes
  230. of the channel. For example, if the channel is invite-only, (+i),
  231. then you may only join if invited. As part of the protocol, a user
  232. may be a part of several channels at once, but a limit of ten (10)
  233. channels is recommended as being ample for both experienced and
  234. novice users. See section 8.13 for more information on this.
  235. If the IRC network becomes disjoint because of a split between two
  236. servers, the channel on each side is only composed of those clients
  237. which are connected to servers on the respective sides of the split,
  238. possibly ceasing to exist on one side of the split. When the split
  239. is healed, the connecting servers announce to each other who they
  240. think is in each channel and the mode of that channel. If the
  241. channel exists on both sides, the JOINs and MODEs are interpreted in
  242. an inclusive manner so that both sides of the new connection will
  243. agree about which clients are in the channel and what modes the
  244. channel has.
  245. 1.3.1 Channel Operators
  246. The channel operator (also referred to as a "chop" or "chanop") on a
  247. given channel is considered to 'own' that channel. In recognition of
  248. this status, channel operators are endowed with certain powers which
  249. enable them to keep control and some sort of sanity in their channel.
  250. As an owner of a channel, a channel operator is not required to have
  251. reasons for their actions, although if their actions are generally
  252. antisocial or otherwise abusive, it might be reasonable to ask an IRC
  253. operator to intervene, or for the usersjust leave and go elsewhere
  254. and form their own channel.
  255. The commands which may only be used by channel operators are:
  256. KICK - Eject a client from the channel
  257. MODE - Change the channel's mode
  258. INVITE - Invite a client to an invite-only channel (mode +i)
  259. TOPIC - Change the channel topic in a mode +t channel
  260. Oikarinen & Reed [Page 6]
  261. RFC 1459 Internet Relay Chat Protocol May 1993
  262. A channel operator is identified by the '@' symbol next to their
  263. nickname whenever it is associated with a channel (ie replies to the
  264. NAMES, WHO and WHOIS commands).
  265. 2. The IRC Specification
  266. 2.1 Overview
  267. The protocol as described herein is for use both with server to
  268. server and client to server connections. There are, however, more
  269. restrictions on client connections (which are considered to be
  270. untrustworthy) than on server connections.
  271. 2.2 Character codes
  272. No specific character set is specified. The protocol is based on a a
  273. set of codes which are composed of eight (8) bits, making up an
  274. octet. Each message may be composed of any number of these octets;
  275. however, some octet values are used for control codes which act as
  276. message delimiters.
  277. Regardless of being an 8-bit protocol, the delimiters and keywords
  278. are such that protocol is mostly usable from USASCII terminal and a
  279. telnet connection.
  280. Because of IRC's scandanavian origin, the characters {}| are
  281. considered to be the lower case equivalents of the characters []\,
  282. respectively. This is a critical issue when determining the
  283. equivalence of two nicknames.
  284. 2.3 Messages
  285. Servers and clients send eachother messages which may or may not
  286. generate a reply. If the message contains a valid command, as
  287. described in later sections, the client should expect a reply as
  288. specified but it is not advised to wait forever for the reply; client
  289. to server and server to server communication is essentially
  290. asynchronous in nature.
  291. Each IRC message may consist of up to three main parts: the prefix
  292. (optional), the command, and the command parameters (of which there
  293. may be up to 15). The prefix, command, and all parameters are
  294. separated by one (or more) ASCII space character(s) (0x20).
  295. The presence of a prefix is indicated with a single leading ASCII
  296. colon character (':', 0x3b), which must be the first character of the
  297. message itself. There must be no gap (whitespace) between the colon
  298. and the prefix. The prefix is used by servers to indicate the true
  299. Oikarinen & Reed [Page 7]
  300. RFC 1459 Internet Relay Chat Protocol May 1993
  301. origin of the message. If the prefix is missing from the message, it
  302. is assumed to have originated from the connection from which it was
  303. received. Clients should not use prefix when sending a message from
  304. themselves; if they use a prefix, the only valid prefix is the
  305. registered nickname associated with the client. If the source
  306. identified by the prefix cannot be found from the server's internal
  307. database, or if the source is registered from a different link than
  308. from which the message arrived, the server must ignore the message
  309. silently.
  310. The command must either be a valid IRC command or a three (3) digit
  311. number represented in ASCII text.
  312. IRC messages are always lines of characters terminated with a CR-LF
  313. (Carriage Return - Line Feed) pair, and these messages shall not
  314. exceed 512 characters in length, counting all characters including
  315. the trailing CR-LF. Thus, there are 510 characters maximum allowed
  316. for the command and its parameters. There is no provision for
  317. continuation message lines. See section 7 for more details about
  318. current implementations.
  319. 2.3.1 Message format in 'pseudo' BNF
  320. The protocol messages must be extracted from the contiguous stream of
  321. octets. The current solution is to designate two characters, CR and
  322. LF, as message separators. Empty messages are silently ignored,
  323. which permits use of the sequence CR-LF between messages
  324. without extra problems.
  325. The extracted message is parsed into the components <prefix>,
  326. <command> and list of parameters matched either by <middle> or
  327. <trailing> components.
  328. The BNF representation for this is:
  329. <message> ::= [':' <prefix> <SPACE> ] <command> <params> <crlf>
  330. <prefix> ::= <servername> | <nick> [ '!' <user> ] [ '@' <host> ]
  331. <command> ::= <letter> { <letter> } | <number> <number> <number>
  332. <SPACE> ::= ' ' { ' ' }
  333. <params> ::= <SPACE> [ ':' <trailing> | <middle> <params> ]
  334. <middle> ::= <Any *non-empty* sequence of octets not including SPACE
  335. or NUL or CR or LF, the first of which may not be ':'>
  336. <trailing> ::= <Any, possibly *empty*, sequence of octets not including
  337. NUL or CR or LF>
  338. <crlf> ::= CR LF
  339. Oikarinen & Reed [Page 8]
  340. RFC 1459 Internet Relay Chat Protocol May 1993
  341. NOTES:
  342. 1) <SPACE> is consists only of SPACE character(s) (0x20).
  343. Specially notice that TABULATION, and all other control
  344. characters are considered NON-WHITE-SPACE.
  345. 2) After extracting the parameter list, all parameters are equal,
  346. whether matched by <middle> or <trailing>. <Trailing> is just
  347. a syntactic trick to allow SPACE within parameter.
  348. 3) The fact that CR and LF cannot appear in parameter strings is
  349. just artifact of the message framing. This might change later.
  350. 4) The NUL character is not special in message framing, and
  351. basically could end up inside a parameter, but as it would
  352. cause extra complexities in normal C string handling. Therefore
  353. NUL is not allowed within messages.
  354. 5) The last parameter may be an empty string.
  355. 6) Use of the extended prefix (['!' <user> ] ['@' <host> ]) must
  356. not be used in server to server communications and is only
  357. intended for server to client messages in order to provide
  358. clients with more useful information about who a message is
  359. from without the need for additional queries.
  360. Most protocol messages specify additional semantics and syntax for
  361. the extracted parameter strings dictated by their position in the
  362. list. For example, many server commands will assume that the first
  363. parameter after the command is the list of targets, which can be
  364. described with:
  365. <target> ::= <to> [ "," <target> ]
  366. <to> ::= <channel> | <user> '@' <servername> | <nick> | <mask>
  367. <channel> ::= ('#' | '&') <chstring>
  368. <servername> ::= <host>
  369. <host> ::= see RFC 952 [DNS:4] for details on allowed hostnames
  370. <nick> ::= <letter> { <letter> | <number> | <special> }
  371. <mask> ::= ('#' | '$') <chstring>
  372. <chstring> ::= <any 8bit code except SPACE, BELL, NUL, CR, LF and
  373. comma (',')>
  374. Other parameter syntaxes are:
  375. <user> ::= <nonwhite> { <nonwhite> }
  376. <letter> ::= 'a' ... 'z' | 'A' ... 'Z'
  377. <number> ::= '0' ... '9'
  378. <special> ::= '-' | '[' | ']' | '\' | '`' | '^' | '{' | '}'
  379. Oikarinen & Reed [Page 9]
  380. RFC 1459 Internet Relay Chat Protocol May 1993
  381. <nonwhite> ::= <any 8bit code except SPACE (0x20), NUL (0x0), CR
  382. (0xd), and LF (0xa)>
  383. 2.4 Numeric replies
  384. Most of the messages sent to the server generate a reply of some
  385. sort. The most common reply is the numeric reply, used for both
  386. errors and normal replies. The numeric reply must be sent as one
  387. message consisting of the sender prefix, the three digit numeric, and
  388. the target of the reply. A numeric reply is not allowed to originate
  389. from a client; any such messages received by a server are silently
  390. dropped. In all other respects, a numeric reply is just like a normal
  391. message, except that the keyword is made up of 3 numeric digits
  392. rather than a string of letters. A list of different replies is
  393. supplied in section 6.
  394. 3. IRC Concepts.
  395. This section is devoted to describing the actual concepts behind the
  396. organization of the IRC protocol and how the current
  397. implementations deliver different classes of messages.
  398. 1--\
  399. A D---4
  400. 2--/ \ /
  401. B----C
  402. / \
  403. 3 E
  404. Servers: A, B, C, D, E Clients: 1, 2, 3, 4
  405. [ Fig. 2. Sample small IRC network ]
  406. 3.1 One-to-one communication
  407. Communication on a one-to-one basis is usually only performed by
  408. clients, since most server-server traffic is not a result of servers
  409. talking only to each other. To provide a secure means for clients to
  410. talk to each other, it is required that all servers be able to send a
  411. message in exactly one direction along the spanning tree in order to
  412. reach any client. The path of a message being delivered is the
  413. shortest path between any two points on the spanning tree.
  414. The following examples all refer to Figure 2 above.
  415. Oikarinen & Reed [Page 10]
  416. RFC 1459 Internet Relay Chat Protocol May 1993
  417. Example 1:
  418. A message between clients 1 and 2 is only seen by server A, which
  419. sends it straight to client 2.
  420. Example 2:
  421. A message between clients 1 and 3 is seen by servers A & B, and
  422. client 3. No other clients or servers are allowed see the message.
  423. Example 3:
  424. A message between clients 2 and 4 is seen by servers A, B, C & D
  425. and client 4 only.
  426. 3.2 One-to-many
  427. The main goal of IRC is to provide a forum which allows easy and
  428. efficient conferencing (one to many conversations). IRC offers
  429. several means to achieve this, each serving its own purpose.
  430. 3.2.1 To a list
  431. The least efficient style of one-to-many conversation is through
  432. clients talking to a 'list' of users. How this is done is almost
  433. self explanatory: the client gives a list of destinations to which
  434. the message is to be delivered and the server breaks it up and
  435. dispatches a separate copy of the message to each given destination.
  436. This isn't as efficient as using a group since the destination list
  437. is broken up and the dispatch sent without checking to make sure
  438. duplicates aren't sent down each path.
  439. 3.2.2 To a group (channel)
  440. In IRC the channel has a role equivalent to that of the multicast
  441. group; their existence is dynamic (coming and going as people join
  442. and leave channels) and the actual conversation carried out on a
  443. channel is only sent to servers which are supporting users on a given
  444. channel. If there are multiple users on a server in the same
  445. channel, the message text is sent only once to that server and then
  446. sent to each client on the channel. This action is then repeated for
  447. each client-server combination until the original message has fanned
  448. out and reached each member of the channel.
  449. The following examples all refer to Figure 2.
  450. Example 4:
  451. Any channel with 1 client in it. Messages to the channel go to the
  452. server and then nowhere else.
  453. Oikarinen & Reed [Page 11]
  454. RFC 1459 Internet Relay Chat Protocol May 1993
  455. Example 5:
  456. 2 clients in a channel. All messages traverse a path as if they
  457. were private messages between the two clients outside a channel.
  458. Example 6:
  459. Clients 1, 2 and 3 in a channel. All messages to the channel are
  460. sent to all clients and only those servers which must be traversed
  461. by the message if it were a private message to a single client. If
  462. client 1 sends a message, it goes back to client 2 and then via
  463. server B to client 3.
  464. 3.2.3 To a host/server mask
  465. To provide IRC operators with some mechanism to send messages to a
  466. large body of related users, host and server mask messages are
  467. provided. These messages are sent to users whose host or server
  468. information match that of the mask. The messages are only sent to
  469. locations where users are, in a fashion similar to that of channels.
  470. 3.3 One-to-all
  471. The one-to-all type of message is better described as a broadcast
  472. message, sent to all clients or servers or both. On a large network
  473. of users and servers, a single message can result in a lot of traffic
  474. being sent over the network in an effort to reach all of the desired
  475. destinations.
  476. For some messages, there is no option but to broadcast it to all
  477. servers so that the state information held by each server is
  478. reasonably consistent between servers.
  479. 3.3.1 Client-to-Client
  480. There is no class of message which, from a single message, results in
  481. a message being sent to every other client.
  482. 3.3.2 Client-to-Server
  483. Most of the commands which result in a change of state information
  484. (such as channel membership, channel mode, user status, etc) must be
  485. sent to all servers by default, and this distribution may not be
  486. changed by the client.
  487. 3.3.3 Server-to-Server.
  488. While most messages between servers are distributed to all 'other'
  489. servers, this is only required for any message that affects either a
  490. user, channel or server. Since these are the basic items found in
  491. Oikarinen & Reed [Page 12]
  492. RFC 1459 Internet Relay Chat Protocol May 1993
  493. IRC, nearly all messages originating from a server are broadcast to
  494. all other connected servers.
  495. 4. Message details
  496. On the following pages are descriptions of each message recognized by
  497. the IRC server and client. All commands described in this section
  498. must be implemented by any server for this protocol.
  499. Where the reply ERR_NOSUCHSERVER is listed, it means that the
  500. <server> parameter could not be found. The server must not send any
  501. other replies after this for that command.
  502. The server to which a client is connected is required to parse the
  503. complete message, returning any appropriate errors. If the server
  504. encounters a fatal error while parsing a message, an error must be
  505. sent back to the client and the parsing terminated. A fatal error
  506. may be considered to be incorrect command, a destination which is
  507. otherwise unknown to the server (server, nick or channel names fit
  508. this category), not enough parameters or incorrect privileges.
  509. If a full set of parameters is presented, then each must be checked
  510. for validity and appropriate responses sent back to the client. In
  511. the case of messages which use parameter lists using the comma as an
  512. item separator, a reply must be sent for each item.
  513. In the examples below, some messages appear using the full format:
  514. :Name COMMAND parameter list
  515. Such examples represent a message from "Name" in transit between
  516. servers, where it is essential to include the name of the original
  517. sender of the message so remote servers may send back a reply along
  518. the correct path.
  519. 4.1 Connection Registration
  520. The commands described here are used to register a connection with an
  521. IRC server as either a user or a server as well as correctly
  522. disconnect.
  523. A "PASS" command is not required for either client or server
  524. connection to be registered, but it must precede the server message
  525. or the latter of the NICK/USER combination. It is strongly
  526. recommended that all server connections have a password in order to
  527. give some level of security to the actual connections. The
  528. recommended order for a client to register is as follows:
  529. Oikarinen & Reed [Page 13]
  530. RFC 1459 Internet Relay Chat Protocol May 1993
  531. 1. Pass message
  532. 2. Nick message
  533. 3. User message
  534. 4.1.1 Password message
  535. Command: PASS
  536. Parameters: <password>
  537. The PASS command is used to set a 'connection password'. The
  538. password can and must be set before any attempt to register the
  539. connection is made. Currently this requires that clients send a PASS
  540. command before sending the NICK/USER combination and servers *must*
  541. send a PASS command before any SERVER command. The password supplied
  542. must match the one contained in the C/N lines (for servers) or I
  543. lines (for clients). It is possible to send multiple PASS commands
  544. before registering but only the last one sent is used for
  545. verification and it may not be changed once registered. Numeric
  546. Replies:
  547. ERR_NEEDMOREPARAMS ERR_ALREADYREGISTRED
  548. Example:
  549. PASS secretpasswordhere
  550. 4.1.2 Nick message
  551. Command: NICK
  552. Parameters: <nickname> [ <hopcount> ]
  553. NICK message is used to give user a nickname or change the previous
  554. one. The <hopcount> parameter is only used by servers to indicate
  555. how far away a nick is from its home server. A local connection has
  556. a hopcount of 0. If supplied by a client, it must be ignored.
  557. If a NICK message arrives at a server which already knows about an
  558. identical nickname for another client, a nickname collision occurs.
  559. As a result of a nickname collision, all instances of the nickname
  560. are removed from the server's database, and a KILL command is issued
  561. to remove the nickname from all other server's database. If the NICK
  562. message causing the collision was a nickname change, then the
  563. original (old) nick must be removed as well.
  564. If the server recieves an identical NICK from a client which is
  565. directly connected, it may issue an ERR_NICKCOLLISION to the local
  566. client, drop the NICK command, and not generate any kills.
  567. Oikarinen & Reed [Page 14]
  568. RFC 1459 Internet Relay Chat Protocol May 1993
  569. Numeric Replies:
  570. ERR_NONICKNAMEGIVEN ERR_ERRONEUSNICKNAME
  571. ERR_NICKNAMEINUSE ERR_NICKCOLLISION
  572. Example:
  573. NICK Wiz ; Introducing new nick "Wiz".
  574. :WiZ NICK Kilroy ; WiZ changed his nickname to Kilroy.
  575. 4.1.3 User message
  576. Command: USER
  577. Parameters: <username> <hostname> <servername> <realname>
  578. The USER message is used at the beginning of connection to specify
  579. the username, hostname, servername and realname of s new user. It is
  580. also used in communication between servers to indicate new user
  581. arriving on IRC, since only after both USER and NICK have been
  582. received from a client does a user become registered.
  583. Between servers USER must to be prefixed with client's NICKname.
  584. Note that hostname and servername are normally ignored by the IRC
  585. server when the USER command comes from a directly connected client
  586. (for security reasons), but they are used in server to server
  587. communication. This means that a NICK must always be sent to a
  588. remote server when a new user is being introduced to the rest of the
  589. network before the accompanying USER is sent.
  590. It must be noted that realname parameter must be the last parameter,
  591. because it may contain space characters and must be prefixed with a
  592. colon (':') to make sure this is recognised as such.
  593. Since it is easy for a client to lie about its username by relying
  594. solely on the USER message, the use of an "Identity Server" is
  595. recommended. If the host which a user connects from has such a
  596. server enabled the username is set to that as in the reply from the
  597. "Identity Server".
  598. Numeric Replies:
  599. ERR_NEEDMOREPARAMS ERR_ALREADYREGISTRED
  600. Examples:
  601. USER guest tolmoon tolsun :Ronnie Reagan
  602. Oikarinen & Reed [Page 15]
  603. RFC 1459 Internet Relay Chat Protocol May 1993
  604. ; User registering themselves with a
  605. username of "guest" and real name
  606. "Ronnie Reagan".
  607. :testnick USER guest tolmoon tolsun :Ronnie Reagan
  608. ; message between servers with the
  609. nickname for which the USER command
  610. belongs to
  611. 4.1.4 Server message
  612. Command: SERVER
  613. Parameters: <servername> <hopcount> <info>
  614. The server message is used to tell a server that the other end of a
  615. new connection is a server. This message is also used to pass server
  616. data over whole net. When a new server is connected to net,
  617. information about it be broadcast to the whole network. <hopcount>
  618. is used to give all servers some internal information on how far away
  619. all servers are. With a full server list, it would be possible to
  620. construct a map of the entire server tree, but hostmasks prevent this
  621. from being done.
  622. The SERVER message must only be accepted from either (a) a connection
  623. which is yet to be registered and is attempting to register as a
  624. server, or (b) an existing connection to another server, in which
  625. case the SERVER message is introducing a new server behind that
  626. server.
  627. Most errors that occur with the receipt of a SERVER command result in
  628. the connection being terminated by the destination host (target
  629. SERVER). Error replies are usually sent using the "ERROR" command
  630. rather than the numeric since the ERROR command has several useful
  631. properties which make it useful here.
  632. If a SERVER message is parsed and attempts to introduce a server
  633. which is already known to the receiving server, the connection from
  634. which that message must be closed (following the correct procedures),
  635. since a duplicate route to a server has formed and the acyclic nature
  636. of the IRC tree broken.
  637. Numeric Replies:
  638. ERR_ALREADYREGISTRED
  639. Example:
  640. Oikarinen & Reed [Page 16]
  641. RFC 1459 Internet Relay Chat Protocol May 1993
  642. SERVER test.oulu.fi 1 :[tolsun.oulu.fi] Experimental server
  643. ; New server test.oulu.fi introducing
  644. itself and attempting to register. The
  645. name in []'s is the hostname for the
  646. host running test.oulu.fi.
  647. :tolsun.oulu.fi SERVER csd.bu.edu 5 :BU Central Server
  648. ; Server tolsun.oulu.fi is our uplink
  649. for csd.bu.edu which is 5 hops away.
  650. 4.1.5 Oper
  651. Command: OPER
  652. Parameters: <user> <password>
  653. OPER message is used by a normal user to obtain operator privileges.
  654. The combination of <user> and <password> are required to gain
  655. Operator privileges.
  656. If the client sending the OPER command supplies the correct password
  657. for the given user, the server then informs the rest of the network
  658. of the new operator by issuing a "MODE +o" for the clients nickname.
  659. The OPER message is client-server only.
  660. Numeric Replies:
  661. ERR_NEEDMOREPARAMS RPL_YOUREOPER
  662. ERR_NOOPERHOST ERR_PASSWDMISMATCH
  663. Example:
  664. OPER foo bar ; Attempt to register as an operator
  665. using a username of "foo" and "bar" as
  666. the password.
  667. 4.1.6 Quit
  668. Command: QUIT
  669. Parameters: [<Quit message>]
  670. A client session is ended with a quit message. The server must close
  671. the connection to a client which sends a QUIT message. If a "Quit
  672. Message" is given, this will be sent instead of the default message,
  673. the nickname.
  674. When netsplits (disconnecting of two servers) occur, the quit message
  675. Oikarinen & Reed [Page 17]
  676. RFC 1459 Internet Relay Chat Protocol May 1993
  677. is composed of the names of two servers involved, separated by a
  678. space. The first name is that of the server which is still connected
  679. and the second name is that of the server that has become
  680. disconnected.
  681. If, for some other reason, a client connection is closed without the
  682. client issuing a QUIT command (e.g. client dies and EOF occurs
  683. on socket), the server is required to fill in the quit message with
  684. some sort of message reflecting the nature of the event which
  685. caused it to happen.
  686. Numeric Replies:
  687. None.
  688. Examples:
  689. QUIT :Gone to have lunch ; Preferred message format.
  690. 4.1.7 Server quit message
  691. Command: SQUIT
  692. Parameters: <server> <comment>
  693. The SQUIT message is needed to tell about quitting or dead servers.
  694. If a server wishes to break the connection to another server it must
  695. send a SQUIT message to the other server, using the the name of the
  696. other server as the server parameter, which then closes its
  697. connection to the quitting server.
  698. This command is also available operators to help keep a network of
  699. IRC servers connected in an orderly fashion. Operators may also
  700. issue an SQUIT message for a remote server connection. In this case,
  701. the SQUIT must be parsed by each server inbetween the operator and
  702. the remote server, updating the view of the network held by each
  703. server as explained below.
  704. The <comment> should be supplied by all operators who execute a SQUIT
  705. for a remote server (that is not connected to the server they are
  706. currently on) so that other operators are aware for the reason of
  707. this action. The <comment> is also filled in by servers which may
  708. place an error or similar message here.
  709. Both of the servers which are on either side of the connection being
  710. closed are required to to send out a SQUIT message (to all its other
  711. server connections) for all other servers which are considered to be
  712. behind that link.
  713. Oikarinen & Reed [Page 18]
  714. RFC 1459 Internet Relay Chat Protocol May 1993
  715. Similarly, a QUIT message must be sent to the other connected servers
  716. rest of the network on behalf of all clients behind that link. In
  717. addition to this, all channel members of a channel which lost a
  718. member due to the split must be sent a QUIT message.
  719. If a server connection is terminated prematurely (e.g. the server on
  720. the other end of the link died), the server which detects
  721. this disconnection is required to inform the rest of the network
  722. that the connection has closed and fill in the comment field
  723. with something appropriate.
  724. Numeric replies:
  725. ERR_NOPRIVILEGES ERR_NOSUCHSERVER
  726. Example:
  727. SQUIT tolsun.oulu.fi :Bad Link ? ; the server link tolson.oulu.fi has
  728. been terminated because of "Bad Link".
  729. :Trillian SQUIT cm22.eng.umd.edu :Server out of control
  730. ; message from Trillian to disconnect
  731. "cm22.eng.umd.edu" from the net
  732. because "Server out of control".
  733. 4.2 Channel operations
  734. This group of messages is concerned with manipulating channels, their
  735. properties (channel modes), and their contents (typically clients).
  736. In implementing these, a number of race conditions are inevitable
  737. when clients at opposing ends of a network send commands which will
  738. ultimately clash. It is also required that servers keep a nickname
  739. history to ensure that wherever a <nick> parameter is given, the
  740. server check its history in case it has recently been changed.
  741. 4.2.1 Join message
  742. Command: JOIN
  743. Parameters: <channel>{,<channel>} [<key>{,<key>}]
  744. The JOIN command is used by client to start listening a specific
  745. channel. Whether or not a client is allowed to join a channel is
  746. checked only by the server the client is connected to; all other
  747. servers automatically add the user to the channel when it is received
  748. from other servers. The conditions which affect this are as follows:
  749. 1. the user must be invited if the channel is invite-only;
  750. Oikarinen & Reed [Page 19]
  751. RFC 1459 Internet Relay Chat Protocol May 1993
  752. 2. the user's nick/username/hostname must not match any
  753. active bans;
  754. 3. the correct key (password) must be given if it is set.
  755. These are discussed in more detail under the MODE command (see
  756. section 4.2.3 for more details).
  757. Once a user has joined a channel, they receive notice about all
  758. commands their server receives which affect the channel. This
  759. includes MODE, KICK, PART, QUIT and of course PRIVMSG/NOTICE. The
  760. JOIN command needs to be broadcast to all servers so that each server
  761. knows where to find the users who are on the channel. This allows
  762. optimal delivery of PRIVMSG/NOTICE messages to the channel.
  763. If a JOIN is successful, the user is then sent the channel's topic
  764. (using RPL_TOPIC) and the list of users who are on the channel (using
  765. RPL_NAMREPLY), which must include the user joining.
  766. Numeric Replies:
  767. ERR_NEEDMOREPARAMS ERR_BANNEDFROMCHAN
  768. ERR_INVITEONLYCHAN ERR_BADCHANNELKEY
  769. ERR_CHANNELISFULL ERR_BADCHANMASK
  770. ERR_NOSUCHCHANNEL ERR_TOOMANYCHANNELS
  771. RPL_TOPIC
  772. Examples:
  773. JOIN #foobar ; join channel #foobar.
  774. JOIN &foo fubar ; join channel &foo using key "fubar".
  775. JOIN #foo,&bar fubar ; join channel #foo using key "fubar"
  776. and &bar using no key.
  777. JOIN #foo,#bar fubar,foobar ; join channel #foo using key "fubar".
  778. and channel #bar using key "foobar".
  779. JOIN #foo,#bar ; join channels #foo and #bar.
  780. :WiZ JOIN #Twilight_zone ; JOIN message from WiZ
  781. 4.2.2 Part message
  782. Command: PART
  783. Parameters: <channel>{,<channel>}
  784. Oikarinen & Reed [Page 20]
  785. RFC 1459 Internet Relay Chat Protocol May 1993
  786. The PART message causes the client sending the message to be removed
  787. from the list of active users for all given channels listed in the
  788. parameter string.
  789. Numeric Replies:
  790. ERR_NEEDMOREPARAMS ERR_NOSUCHCHANNEL
  791. ERR_NOTONCHANNEL
  792. Examples:
  793. PART #twilight_zone ; leave channel "#twilight_zone"
  794. PART #oz-ops,&group5 ; leave both channels "&group5" and
  795. "#oz-ops".
  796. 4.2.3 Mode message
  797. Command: MODE
  798. The MODE command is a dual-purpose command in IRC. It allows both
  799. usernames and channels to have their mode changed. The rationale for
  800. this choice is that one day nicknames will be obsolete and the
  801. equivalent property will be the channel.
  802. When parsing MODE messages, it is recommended that the entire message
  803. be parsed first and then the changes which resulted then passed on.
  804. 4.2.3.1 Channel modes
  805. Parameters: <channel> {[+|-]|o|p|s|i|t|n|b|v} [<limit>] [<user>]
  806. [<ban mask>]
  807. The MODE command is provided so that channel operators may change the
  808. characteristics of `their' channel. It is also required that servers
  809. be able to change channel modes so that channel operators may be
  810. created.
  811. The various modes available for channels are as follows:
  812. o - give/take channel operator privileges;
  813. p - private channel flag;
  814. s - secret channel flag;
  815. i - invite-only channel flag;
  816. t - topic settable by channel operator only flag;
  817. n - no messages to channel from clients on the outside;
  818. m - moderated channel;
  819. l - set the user limit to channel;
  820. Oikarinen & Reed [Page 21]
  821. RFC 1459 Internet Relay Chat Protocol May 1993
  822. b - set a ban mask to keep users out;
  823. v - give/take the ability to speak on a moderated channel;
  824. k - set a channel key (password).
  825. When using the 'o' and 'b' options, a restriction on a total of three
  826. per mode command has been imposed. That is, any combination of 'o'
  827. and
  828. 4.2.3.2 User modes
  829. Parameters: <nickname> {[+|-]|i|w|s|o}
  830. The user MODEs are typically changes which affect either how the
  831. client is seen by others or what 'extra' messages the client is sent.
  832. A user MODE command may only be accepted if both the sender of the
  833. message and the nickname given as a parameter are both the same.
  834. The available modes are as follows:
  835. i - marks a users as invisible;
  836. s - marks a user for receipt of server notices;
  837. w - user receives wallops;
  838. o - operator flag.
  839. Additional modes may be available later on.
  840. If a user attempts to make themselves an operator using the "+o"
  841. flag, the attempt should be ignored. There is no restriction,
  842. however, on anyone `deopping' themselves (using "-o"). Numeric
  843. Replies:
  844. ERR_NEEDMOREPARAMS RPL_CHANNELMODEIS
  845. ERR_CHANOPRIVSNEEDED ERR_NOSUCHNICK
  846. ERR_NOTONCHANNEL ERR_KEYSET
  847. RPL_BANLIST RPL_ENDOFBANLIST
  848. ERR_UNKNOWNMODE ERR_NOSUCHCHANNEL
  849. ERR_USERSDONTMATCH RPL_UMODEIS
  850. ERR_UMODEUNKNOWNFLAG
  851. Examples:
  852. Use of Channel Modes:
  853. MODE #Finnish +im ; Makes #Finnish channel moderated and
  854. 'invite-only'.
  855. MODE #Finnish +o Kilroy ; Gives 'chanop' privileges to Kilroy on
  856. Oikarinen & Reed [Page 22]
  857. RFC 1459 Internet Relay Chat Protocol May 1993
  858. channel #Finnish.
  859. MODE #Finnish +v Wiz ; Allow WiZ to speak on #Finnish.
  860. MODE #Fins -s ; Removes 'secret' flag from channel
  861. #Fins.
  862. MODE #42 +k oulu ; Set the channel key to "oulu".
  863. MODE #eu-opers +l 10 ; Set the limit for the number of users
  864. on channel to 10.
  865. MODE &oulu +b ; list ban masks set for channel.
  866. MODE &oulu +b *!*@* ; prevent all users from joining.
  867. MODE &oulu +b *!*@*.edu ; prevent any user from a hostname
  868. matching *.edu from joining.
  869. Use of user Modes:
  870. :MODE WiZ -w ; turns reception of WALLOPS messages
  871. off for WiZ.
  872. :Angel MODE Angel +i ; Message from Angel to make themselves
  873. invisible.
  874. MODE WiZ -o ; WiZ 'deopping' (removing operator
  875. status). The plain reverse of this
  876. command ("MODE WiZ +o") must not be
  877. allowed from users since would bypass
  878. the OPER command.
  879. 4.2.4 Topic message
  880. Command: TOPIC
  881. Parameters: <channel> [<topic>]
  882. The TOPIC message is used to change or view the topic of a channel.
  883. The topic for channel <channel> is returned if there is no <topic>
  884. given. If the <topic> parameter is present, the topic for that
  885. channel will be changed, if the channel modes permit this action.
  886. Numeric Replies:
  887. ERR_NEEDMOREPARAMS ERR_NOTONCHANNEL
  888. RPL_NOTOPIC RPL_TOPIC
  889. ERR_CHANOPRIVSNEEDED
  890. Oikarinen & Reed [Page 23]
  891. RFC 1459 Internet Relay Chat Protocol May 1993
  892. Examples:
  893. :Wiz TOPIC #test :New topic ;User Wiz setting the topic.
  894. TOPIC #test :another topic ;set the topic on #test to "another
  895. topic".
  896. TOPIC #test ; check the topic for #test.
  897. 4.2.5 Names message
  898. Command: NAMES
  899. Parameters: [<channel>{,<channel>}]
  900. By using the NAMES command, a user can list all nicknames that are
  901. visible to them on any channel that they can see. Channel names
  902. which they can see are those which aren't private (+p) or secret (+s)
  903. or those which they are actually on. The <channel> parameter
  904. specifies which channel(s) to return information about if valid.
  905. There is no error reply for bad channel names.
  906. If no <channel> parameter is given, a list of all channels and their
  907. occupants is returned. At the end of this list, a list of users who
  908. are visible but either not on any channel or not on a visible channel
  909. are listed as being on `channel' "*".
  910. Numerics:
  911. RPL_NAMREPLY RPL_ENDOFNAMES
  912. Examples:
  913. NAMES #twilight_zone,#42 ; list visible users on #twilight_zone
  914. and #42 if the channels are visible to
  915. you.
  916. NAMES ; list all visible channels and users
  917. 4.2.6 List message
  918. Command: LIST
  919. Parameters: [<channel>{,<channel>} [<server>]]
  920. The list message is used to list channels and their topics. If the
  921. <channel> parameter is used, only the status of that channel
  922. is displayed. Private channels are listed (without their
  923. topics) as channel "Prv" unless the client generating the query is
  924. actually on that channel. Likewise, secret channels are not listed
  925. Oikarinen & Reed [Page 24]
  926. RFC 1459 Internet Relay Chat Protocol May 1993
  927. at all unless the client is a member of the channel in question.
  928. Numeric Replies:
  929. ERR_NOSUCHSERVER RPL_LISTSTART
  930. RPL_LIST RPL_LISTEND
  931. Examples:
  932. LIST ; List all channels.
  933. LIST #twilight_zone,#42 ; List channels #twilight_zone and #42
  934. 4.2.7 Invite message
  935. Command: INVITE
  936. Parameters: <nickname> <channel>
  937. The INVITE message is used to invite users to a channel. The
  938. parameter <nickname> is the nickname of the person to be invited to
  939. the target channel <channel>. There is no requirement that the
  940. channel the target user is being invited to must exist or be a valid
  941. channel. To invite a user to a channel which is invite only (MODE
  942. +i), the client sending the invite must be recognised as being a
  943. channel operator on the given channel.
  944. Numeric Replies:
  945. ERR_NEEDMOREPARAMS ERR_NOSUCHNICK
  946. ERR_NOTONCHANNEL ERR_USERONCHANNEL
  947. ERR_CHANOPRIVSNEEDED
  948. RPL_INVITING RPL_AWAY
  949. Examples:
  950. :Angel INVITE Wiz #Dust ; User Angel inviting WiZ to channel
  951. #Dust
  952. INVITE Wiz #Twilight_Zone ; Command to invite WiZ to
  953. #Twilight_zone
  954. 4.2.8 Kick command
  955. Command: KICK
  956. Parameters: <channel> <user> [<comment>]
  957. The KICK command can be used to forcibly remove a user from a
  958. channel. It 'kicks them out' of the channel (forced PART).
  959. Oikarinen & Reed [Page 25]
  960. RFC 1459 Internet Relay Chat Protocol May 1993
  961. Only a channel operator may kick another user out of a channel.
  962. Each server that receives a KICK message checks that it is valid
  963. (ie the sender is actually a channel operator) before removing
  964. the victim from the channel.
  965. Numeric Replies:
  966. ERR_NEEDMOREPARAMS ERR_NOSUCHCHANNEL
  967. ERR_BADCHANMASK ERR_CHANOPRIVSNEEDED
  968. ERR_NOTONCHANNEL
  969. Examples:
  970. KICK &Melbourne Matthew ; Kick Matthew from &Melbourne
  971. KICK #Finnish John :Speaking English
  972. ; Kick John from #Finnish using
  973. "Speaking English" as the reason
  974. (comment).
  975. :WiZ KICK #Finnish John ; KICK message from WiZ to remove John
  976. from channel #Finnish
  977. NOTE:
  978. It is possible to extend the KICK command parameters to the
  979. following:
  980. <channel>{,<channel>} <user>{,<user>} [<comment>]
  981. 4.3 Server queries and commands
  982. The server query group of commands has been designed to return
  983. information about any server which is connected to the network. All
  984. servers connected must respond to these queries and respond
  985. correctly. Any invalid response (or lack thereof) must be considered
  986. a sign of a broken server and it must be disconnected/disabled as
  987. soon as possible until the situation is remedied.
  988. In these queries, where a parameter appears as "<server>", it will
  989. usually mean it can be a nickname or a server or a wildcard name of
  990. some sort. For each parameter, however, only one query and set of
  991. replies is to be generated.
  992. 4.3.1 Version message
  993. Command: VERSION
  994. Parameters: [<server>]
  995. Oikarinen & Reed [Page 26]
  996. RFC 1459 Internet Relay Chat Protocol May 1993
  997. The VERSION message is used to query the version of the server
  998. program. An optional parameter <server> is used to query the version
  999. of the server program which a client is not directly connected to.
  1000. Numeric Replies:
  1001. ERR_NOSUCHSERVER RPL_VERSION
  1002. Examples:
  1003. :Wiz VERSION *.se ; message from Wiz to check the version
  1004. of a server matching "*.se"
  1005. VERSION tolsun.oulu.fi ; check the version of server
  1006. "tolsun.oulu.fi".
  1007. 4.3.2 Stats message
  1008. Command: STATS
  1009. Parameters: [<query> [<server>]]
  1010. The stats message is used to query statistics of certain server. If
  1011. <server> parameter is omitted, only the end of stats reply is sent
  1012. back. The implementation of this command is highly dependent on the
  1013. server which replies, although the server must be able to supply
  1014. information as described by the queries below (or similar).
  1015. A query may be given by any single letter which is only checked by
  1016. the destination server (if given as the <server> parameter) and is
  1017. otherwise passed on by intermediate servers, ignored and unaltered.
  1018. The following queries are those found in the current IRC
  1019. implementation and provide a large portion of the setup information
  1020. for that server. Although these may not be supported in the same way
  1021. by other versions, all servers should be able to supply a valid reply
  1022. to a STATS query which is consistent with the reply formats currently
  1023. used and the purpose of the query.
  1024. The currently supported queries are:
  1025. c - returns a list of servers which the server may connect
  1026. to or allow connections from;
  1027. h - returns a list of servers which are either forced to be
  1028. treated as leaves or allowed to act as hubs;
  1029. i - returns a list of hosts which the server allows a client
  1030. to connect from;
  1031. k - returns a list of banned username/hostname combinations
  1032. for that server;
  1033. l - returns a list of the server's connections, showing how
  1034. Oikarinen & Reed [Page 27]
  1035. RFC 1459 Internet Relay Chat Protocol May 1993
  1036. long each connection has been established and the traffic
  1037. over that connection in bytes and messages for each
  1038. direction;
  1039. m - returns a list of commands supported by the server and
  1040. the usage count for each if the usage count is non zero;
  1041. o - returns a list of hosts from which normal clients may
  1042. become operators;
  1043. y - show Y (Class) lines from server's configuration file;
  1044. u - returns a string showing how long the server has been up.
  1045. Numeric Replies:
  1046. ERR_NOSUCHSERVER
  1047. RPL_STATSCLINE RPL_STATSNLINE
  1048. RPL_STATSILINE RPL_STATSKLINE
  1049. RPL_STATSQLINE RPL_STATSLLINE
  1050. RPL_STATSLINKINFO RPL_STATSUPTIME
  1051. RPL_STATSCOMMANDS RPL_STATSOLINE
  1052. RPL_STATSHLINE RPL_ENDOFSTATS
  1053. Examples:
  1054. STATS m ; check the command usage for the server
  1055. you are connected to
  1056. :Wiz STATS c eff.org ; request by WiZ for C/N line
  1057. information from server eff.org
  1058. 4.3.3 Links message
  1059. Command: LINKS
  1060. Parameters: [[<remote server>] <server mask>]
  1061. With LINKS, a user can list all servers which are known by the server
  1062. answering the query. The returned list of servers must match the
  1063. mask, or if no mask is given, the full list is returned.
  1064. If <remote server> is given in addition to <server mask>, the LINKS
  1065. command is forwarded to the first server found that matches that name
  1066. (if any), and that server is then required to answer the query.
  1067. Numeric Replies:
  1068. ERR_NOSUCHSERVER
  1069. RPL_LINKS RPL_ENDOFLINKS
  1070. Examples:
  1071. Oikarinen & Reed [Page 28]
  1072. RFC 1459 Internet Relay Chat Protocol May 1993
  1073. LINKS *.au ; list all servers which have a name
  1074. that matches *.au;
  1075. :WiZ LINKS *.bu.edu *.edu ; LINKS message from WiZ to the first
  1076. server matching *.edu for a list of
  1077. servers matching *.bu.edu.
  1078. 4.3.4 Time message
  1079. Command: TIME
  1080. Parameters: [<server>]
  1081. The time message is used to query local time from the specified
  1082. server. If the server parameter is not given, the server handling the
  1083. command must reply to the query.
  1084. Numeric Replies:
  1085. ERR_NOSUCHSERVER RPL_TIME
  1086. Examples:
  1087. TIME tolsun.oulu.fi ; check the time on the server
  1088. "tolson.oulu.fi"
  1089. Angel TIME *.au ; user angel checking the time on a
  1090. server matching "*.au"
  1091. 4.3.5 Connect message
  1092. Command: CONNECT
  1093. Parameters: <target server> [<port> [<remote server>]]
  1094. The CONNECT command can be used to force a server to try to establish
  1095. a new connection to another server immediately. CONNECT is a
  1096. privileged command and is to be available only to IRC Operators. If
  1097. a remote server is given then the CONNECT attempt is made by that
  1098. server to <target server> and <port>.
  1099. Numeric Replies:
  1100. ERR_NOSUCHSERVER ERR_NOPRIVILEGES
  1101. ERR_NEEDMOREPARAMS
  1102. Examples:
  1103. CONNECT tolsun.oulu.fi ; Attempt to connect a server to
  1104. tolsun.oulu.fi
  1105. Oikarinen & Reed [Page 29]
  1106. RFC 1459 Internet Relay Chat Protocol May 1993
  1107. :WiZ CONNECT eff.org 6667 csd.bu.edu
  1108. ; CONNECT attempt by WiZ to get servers
  1109. eff.org and csd.bu.edu connected on port
  1110. 6667.
  1111. 4.3.6 Trace message
  1112. Command: TRACE
  1113. Parameters: [<server>]
  1114. TRACE command is used to find the route to specific server. Each
  1115. server that processes this message must tell the sender about it by
  1116. sending a reply indicating it is a pass-through link, forming a chain
  1117. of replies similar to that gained from using "traceroute". After
  1118. sending this reply back, it must then send the TRACE message to the
  1119. next server until given server is reached. If the <server> parameter
  1120. is omitted, it is recommended that TRACE command send a message to
  1121. the sender telling which servers the current server has direct
  1122. connection to.
  1123. If the destination given by "<server>" is an actual server, then the
  1124. destination server is required to report all servers and users which
  1125. are connected to it, although only operators are permitted to see
  1126. users present. If the destination given by <server> is a nickname,
  1127. they only a reply for that nickname is given.
  1128. Numeric Replies:
  1129. ERR_NOSUCHSERVER
  1130. If the TRACE message is destined for another server, all intermediate
  1131. servers must return a RPL_TRACELINK reply to indicate that the TRACE
  1132. passed through it and where its going next.
  1133. RPL_TRACELINK
  1134. A TRACE reply may be composed of any number of the following numeric
  1135. replies.
  1136. RPL_TRACECONNECTING RPL_TRACEHANDSHAKE
  1137. RPL_TRACEUNKNOWN RPL_TRACEOPERATOR
  1138. RPL_TRACEUSER RPL_TRACESERVER
  1139. RPL_TRACESERVICE RPL_TRACENEWTYPE
  1140. RPL_TRACECLASS
  1141. Examples:
  1142. TRACE *.oulu.fi ; TRACE to a server matching *.oulu.fi
  1143. Oikarinen & Reed [Page 30]
  1144. RFC 1459 Internet Relay Chat Protocol May 1993
  1145. :WiZ TRACE AngelDust ; TRACE issued by WiZ to nick AngelDust
  1146. 4.3.7 Admin command
  1147. Command: ADMIN
  1148. Parameters: [<server>]
  1149. The admin message is used to find the name of the administrator of
  1150. the given server, or current server if <server> parameter is omitted.
  1151. Each server must have the ability to forward ADMIN messages to other
  1152. servers.
  1153. Numeric Replies:
  1154. ERR_NOSUCHSERVER
  1155. RPL_ADMINME RPL_ADMINLOC1
  1156. RPL_ADMINLOC2 RPL_ADMINEMAIL
  1157. Examples:
  1158. ADMIN tolsun.oulu.fi ; request an ADMIN reply from
  1159. tolsun.oulu.fi
  1160. :WiZ ADMIN *.edu ; ADMIN request from WiZ for first
  1161. server found to match *.edu.
  1162. 4.3.8 Info command
  1163. Command: INFO
  1164. Parameters: [<server>]
  1165. The INFO command is required to return information which describes
  1166. the server: its version, when it was compiled, the patchlevel, when
  1167. it was started, and any other miscellaneous information which may be
  1168. considered to be relevant.
  1169. Numeric Replies:
  1170. ERR_NOSUCHSERVER
  1171. RPL_INFO RPL_ENDOFINFO
  1172. Examples:
  1173. INFO csd.bu.edu ; request an INFO reply from
  1174. csd.bu.edu
  1175. :Avalon INFO *.fi ; INFO request from Avalon for first
  1176. server found to match *.fi.
  1177. Oikarinen & Reed [Page 31]
  1178. RFC 1459 Internet Relay Chat Protocol May 1993
  1179. INFO Angel ; request info from the server that
  1180. Angel is connected to.
  1181. 4.4 Sending messages
  1182. The main purpose of the IRC protocol is to provide a base for clients
  1183. to communicate with each other. PRIVMSG and NOTICE are the only
  1184. messages available which actually perform delivery of a text message
  1185. from one client to another - the rest just make it possible and try
  1186. to ensure it happens in a reliable and structured manner.
  1187. 4.4.1 Private messages
  1188. Command: PRIVMSG
  1189. Parameters: <receiver>{,<receiver>} <text to be sent>
  1190. PRIVMSG is used to send private messages between users. <receiver>
  1191. is the nickname of the receiver of the message. <receiver> can also
  1192. be a list of names or channels separated with commas.
  1193. The <receiver> parameter may also me a host mask (#mask) or server
  1194. mask ($mask). In both cases the server will only send the PRIVMSG
  1195. to those who have a server or host matching the mask. The mask must
  1196. have at least 1 (one) "." in it and no wildcards following the
  1197. last ".". This requirement exists to prevent people sending messages
  1198. to "#*" or "$*", which would broadcast to all users; from
  1199. experience, this is abused more than used responsibly and properly.
  1200. Wildcards are the '*' and '?' characters. This extension to
  1201. the PRIVMSG command is only available to Operators.
  1202. Numeric Replies:
  1203. ERR_NORECIPIENT ERR_NOTEXTTOSEND
  1204. ERR_CANNOTSENDTOCHAN ERR_NOTOPLEVEL
  1205. ERR_WILDTOPLEVEL ERR_TOOMANYTARGETS
  1206. ERR_NOSUCHNICK
  1207. RPL_AWAY
  1208. Examples:
  1209. :Angel PRIVMSG Wiz :Hello are you receiving this message ?
  1210. ; Message from Angel to Wiz.
  1211. PRIVMSG Angel :yes I'm receiving it !receiving it !'u>(768u+1n) .br ;
  1212. Message to Angel.
  1213. PRIVMSG jto@tolsun.oulu.fi :Hello !
  1214. ; Message to a client on server
  1215. Oikarinen & Reed [Page 32]
  1216. RFC 1459 Internet Relay Chat Protocol May 1993
  1217. tolsun.oulu.fi with username of "jto".
  1218. PRIVMSG $*.fi :Server tolsun.oulu.fi rebooting.
  1219. ; Message to everyone on a server which
  1220. has a name matching *.fi.
  1221. PRIVMSG #*.edu :NSFNet is undergoing work, expect interruptions
  1222. ; Message to all users who come from a
  1223. host which has a name matching *.edu.
  1224. 4.4.2 Notice
  1225. Command: NOTICE
  1226. Parameters: <nickname> <text>
  1227. The NOTICE message is used similarly to PRIVMSG. The difference
  1228. between NOTICE and PRIVMSG is that automatic replies must never be
  1229. sent in response to a NOTICE message. This rule applies to servers
  1230. too - they must not send any error reply back to the client on
  1231. receipt of a notice. The object of this rule is to avoid loops
  1232. between a client automatically sending something in response to
  1233. something it received. This is typically used by automatons (clients
  1234. with either an AI or other interactive program controlling their
  1235. actions) which are always seen to be replying lest they end up in a
  1236. loop with another automaton.
  1237. See PRIVMSG for more details on replies and examples.
  1238. 4.5 User based queries
  1239. User queries are a group of commands which are primarily concerned
  1240. with finding details on a particular user or group users. When using
  1241. wildcards with any of these commands, if they match, they will only
  1242. return information on users who are 'visible' to you. The visibility
  1243. of a user is determined as a combination of the user's mode and the
  1244. common set of channels you are both on.
  1245. 4.5.1 Who query
  1246. Command: WHO
  1247. Parameters: [<name> [<o>]]
  1248. The WHO message is used by a client to generate a query which returns
  1249. a list of information which 'matches' the <name> parameter given by
  1250. the client. In the absence of the <name> parameter, all visible
  1251. (users who aren't invisible (user mode +i) and who don't have a
  1252. common channel with the requesting client) are listed. The same
  1253. result can be achieved by using a <name> of "0" or any wildcard which
  1254. Oikarinen & Reed [Page 33]
  1255. RFC 1459 Internet Relay Chat Protocol May 1993
  1256. will end up matching every entry possible.
  1257. The <name> passed to WHO is matched against users' host, server, real
  1258. name and nickname if the channel <name> cannot be found.
  1259. If the "o" parameter is passed only operators are returned according
  1260. to the name mask supplied.
  1261. Numeric Replies:
  1262. ERR_NOSUCHSERVER
  1263. RPL_WHOREPLY RPL_ENDOFWHO
  1264. Examples:
  1265. WHO *.fi ; List all users who match against
  1266. "*.fi".
  1267. WHO jto* o ; List all users with a match against
  1268. "jto*" if they are an operator.
  1269. 4.5.2 Whois query
  1270. Command: WHOIS
  1271. Parameters: [<server>] <nickmask>[,<nickmask>[,...]]
  1272. This message is used to query information about particular user. The
  1273. server will answer this message with several numeric messages
  1274. indicating different statuses of each user which matches the nickmask
  1275. (if you are entitled to see them). If no wildcard is present in the
  1276. <nickmask>, any information about that nick which you are allowed to
  1277. see is presented. A comma (',') separated list of nicknames may be
  1278. given.
  1279. The latter version sends the query to a specific server. It is
  1280. useful if you want to know how long the user in question has been
  1281. idle as only local server (ie. the server the user is directly
  1282. connected to) knows that information, while everything else is
  1283. globally known.
  1284. Numeric Replies:
  1285. ERR_NOSUCHSERVER ERR_NONICKNAMEGIVEN
  1286. RPL_WHOISUSER RPL_WHOISCHANNELS
  1287. RPL_WHOISCHANNELS RPL_WHOISSERVER
  1288. RPL_AWAY RPL_WHOISOPERATOR
  1289. RPL_WHOISIDLE ERR_NOSUCHNICK
  1290. RPL_ENDOFWHOIS
  1291. Oikarinen & Reed [Page 34]
  1292. RFC 1459 Internet Relay Chat Protocol May 1993
  1293. Examples:
  1294. WHOIS wiz ; return available user information
  1295. about nick WiZ
  1296. WHOIS eff.org trillian ; ask server eff.org for user
  1297. information about trillian
  1298. 4.5.3 Whowas
  1299. Command: WHOWAS
  1300. Parameters: <nickname> [<count> [<server>]]
  1301. Whowas asks for information about a nickname which no longer exists.
  1302. This may either be due to a nickname change or the user leaving IRC.
  1303. In response to this query, the server searches through its nickname
  1304. history, looking for any nicks which are lexically the same (no wild
  1305. card matching here). The history is searched backward, returning the
  1306. most recent entry first. If there are multiple entries, up to
  1307. <count> replies will be returned (or all of them if no <count>
  1308. parameter is given). If a non-positive number is passed as being
  1309. <count>, then a full search is done.
  1310. Numeric Replies:
  1311. ERR_NONICKNAMEGIVEN ERR_WASNOSUCHNICK
  1312. RPL_WHOWASUSER RPL_WHOISSERVER
  1313. RPL_ENDOFWHOWAS
  1314. Examples:
  1315. WHOWAS Wiz ; return all information in the nick
  1316. history about nick "WiZ";
  1317. WHOWAS Mermaid 9 ; return at most, the 9 most recent
  1318. entries in the nick history for
  1319. "Mermaid";
  1320. WHOWAS Trillian 1 *.edu ; return the most recent history for
  1321. "Trillian" from the first server found
  1322. to match "*.edu".
  1323. 4.6 Miscellaneous messages
  1324. Messages in this category do not fit into any of the above categories
  1325. but are nonetheless still a part of and required by the protocol.
  1326. Oikarinen & Reed [Page 35]
  1327. RFC 1459 Internet Relay Chat Protocol May 1993
  1328. 4.6.1 Kill message
  1329. Command: KILL
  1330. Parameters: <nickname> <comment>
  1331. The KILL message is used to cause a client-server connection to be
  1332. closed by the server which has the actual connection. KILL is used
  1333. by servers when they encounter a duplicate entry in the list of valid
  1334. nicknames and is used to remove both entries. It is also available
  1335. to operators.
  1336. Clients which have automatic reconnect algorithms effectively make
  1337. this command useless since the disconnection is only brief. It does
  1338. however break the flow of data and can be used to stop large amounts
  1339. of being abused, any user may elect to receive KILL messages
  1340. generated for others to keep an 'eye' on would be trouble spots.
  1341. In an arena where nicknames are required to be globally unique at all
  1342. times, KILL messages are sent whenever 'duplicates' are detected
  1343. (that is an attempt to register two users with the same nickname) in
  1344. the hope that both of them will disappear and only 1 reappear.
  1345. The comment given must reflect the actual reason for the KILL. For
  1346. server-generated KILLs it usually is made up of details concerning
  1347. the origins of the two conflicting nicknames. For users it is left
  1348. up to them to provide an adequate reason to satisfy others who see
  1349. it. To prevent/discourage fake KILLs from being generated to hide
  1350. the identify of the KILLer, the comment also shows a 'kill-path'
  1351. which is updated by each server it passes through, each prepending
  1352. its name to the path.
  1353. Numeric Replies:
  1354. ERR_NOPRIVILEGES ERR_NEEDMOREPARAMS
  1355. ERR_NOSUCHNICK ERR_CANTKILLSERVER
  1356. KILL David (csd.bu.edu <- tolsun.oulu.fi)
  1357. ; Nickname collision between csd.bu.edu
  1358. and tolson.oulu.fi
  1359. NOTE:
  1360. It is recommended that only Operators be allowed to kill other users
  1361. with KILL message. In an ideal world not even operators would need
  1362. to do this and it would be left to servers to deal with.
  1363. Oikarinen & Reed [Page 36]
  1364. RFC 1459 Internet Relay Chat Protocol May 1993
  1365. 4.6.2 Ping message
  1366. Command: PING
  1367. Parameters: <server1> [<server2>]
  1368. The PING message is used to test the presence of an active client at
  1369. the other end of the connection. A PING message is sent at regular
  1370. intervals if no other activity detected coming from a connection. If
  1371. a connection fails to respond to a PING command within a set amount
  1372. of time, that connection is closed.
  1373. Any client which receives a PING message must respond to <server1>
  1374. (server which sent the PING message out) as quickly as possible with
  1375. an appropriate PONG message to indicate it is still there and alive.
  1376. Servers should not respond to PING commands but rely on PINGs from
  1377. the other end of the connection to indicate the connection is alive.
  1378. If the <server2> parameter is specified, the PING message gets
  1379. forwarded there.
  1380. Numeric Replies:
  1381. ERR_NOORIGIN ERR_NOSUCHSERVER
  1382. Examples:
  1383. PING tolsun.oulu.fi ; server sending a PING message to
  1384. another server to indicate it is still
  1385. alive.
  1386. PING WiZ ; PING message being sent to nick WiZ
  1387. 4.6.3 Pong message
  1388. Command: PONG
  1389. Parameters: <daemon> [<daemon2>]
  1390. PONG message is a reply to ping message. If parameter <daemon2> is
  1391. given this message must be forwarded to given daemon. The <daemon>
  1392. parameter is the name of the daemon who has responded to PING message
  1393. and generated this message.
  1394. Numeric Replies:
  1395. ERR_NOORIGIN ERR_NOSUCHSERVER
  1396. Examples:
  1397. PONG csd.bu.edu tolsun.oulu.fi ; PONG message from csd.bu.edu to
  1398. Oikarinen & Reed [Page 37]
  1399. RFC 1459 Internet Relay Chat Protocol May 1993
  1400. tolsun.oulu.fi
  1401. 4.6.4 Error
  1402. Command: ERROR
  1403. Parameters: <error message>
  1404. The ERROR command is for use by servers when reporting a serious or
  1405. fatal error to its operators. It may also be sent from one server to
  1406. another but must not be accepted from any normal unknown clients.
  1407. An ERROR message is for use for reporting errors which occur with a
  1408. server-to-server link only. An ERROR message is sent to the server
  1409. at the other end (which sends it to all of its connected operators)
  1410. and to all operators currently connected. It is not to be passed
  1411. onto any other servers by a server if it is received from a server.
  1412. When a server sends a received ERROR message to its operators, the
  1413. message should be encapsulated inside a NOTICE message, indicating
  1414. that the client was not responsible for the error.
  1415. Numerics:
  1416. None.
  1417. Examples:
  1418. ERROR :Server *.fi already exists; ERROR message to the other server
  1419. which caused this error.
  1420. NOTICE WiZ :ERROR from csd.bu.edu -- Server *.fi already exists
  1421. ; Same ERROR message as above but sent
  1422. to user WiZ on the other server.
  1423. 5. OPTIONALS
  1424. This section describes OPTIONAL messages. They are not required in a
  1425. working server implementation of the protocol described herein. In
  1426. the absence of the option, an error reply message must be generated
  1427. or an unknown command error. If the message is destined for another
  1428. server to answer then it must be passed on (elementary parsing
  1429. required) The allocated numerics for this are listed with the
  1430. messages below.
  1431. 5.1 Away
  1432. Command: AWAY
  1433. Parameters: [message]
  1434. Oikarinen & Reed [Page 38]
  1435. RFC 1459 Internet Relay Chat Protocol May 1993
  1436. With the AWAY message, clients can set an automatic reply string for
  1437. any PRIVMSG commands directed at them (not to a channel they are on).
  1438. The automatic reply is sent by the server to client sending the
  1439. PRIVMSG command. The only replying server is the one to which the
  1440. sending client is connected to.
  1441. The AWAY message is used either with one parameter (to set an AWAY
  1442. message) or with no parameters (to remove the AWAY message).
  1443. Numeric Replies:
  1444. RPL_UNAWAY RPL_NOWAWAY
  1445. Examples:
  1446. AWAY :Gone to lunch. Back in 5 ; set away message to "Gone to lunch.
  1447. Back in 5".
  1448. :WiZ AWAY ; unmark WiZ as being away.
  1449. 5.2 Rehash message
  1450. Command: REHASH
  1451. Parameters: None
  1452. The rehash message can be used by the operator to force the server to
  1453. re-read and process its configuration file.
  1454. Numeric Replies:
  1455. RPL_REHASHING ERR_NOPRIVILEGES
  1456. Examples:
  1457. REHASH ; message from client with operator
  1458. status to server asking it to reread its
  1459. configuration file.
  1460. 5.3 Restart message
  1461. Command: RESTART
  1462. Parameters: None
  1463. The restart message can only be used by an operator to force a server
  1464. restart itself. This message is optional since it may be viewed as a
  1465. risk to allow arbitrary people to connect to a server as an operator
  1466. and execute this command, causing (at least) a disruption to service.
  1467. Oikarinen & Reed [Page 39]
  1468. RFC 1459 Internet Relay Chat Protocol May 1993
  1469. The RESTART command must always be fully processed by the server to
  1470. which the sending client is connected and not be passed onto other
  1471. connected servers.
  1472. Numeric Replies:
  1473. ERR_NOPRIVILEGES
  1474. Examples:
  1475. RESTART ; no parameters required.
  1476. 5.4 Summon message
  1477. Command: SUMMON
  1478. Parameters: <user> [<server>]
  1479. The SUMMON command can be used to give users who are on a host
  1480. running an IRC server a message asking them to please join IRC. This
  1481. message is only sent if the target server (a) has SUMMON enabled, (b)
  1482. the user is logged in and (c) the server process can write to the
  1483. user's tty (or similar).
  1484. If no <server> parameter is given it tries to summon <user> from the
  1485. server the client is connected to is assumed as the target.
  1486. If summon is not enabled in a server, it must return the
  1487. ERR_SUMMONDISABLED numeric and pass the summon message onwards.
  1488. Numeric Replies:
  1489. ERR_NORECIPIENT ERR_FILEERROR
  1490. ERR_NOLOGIN ERR_NOSUCHSERVER
  1491. RPL_SUMMONING
  1492. Examples:
  1493. SUMMON jto ; summon user jto on the server's host
  1494. SUMMON jto tolsun.oulu.fi ; summon user jto on the host which a
  1495. server named "tolsun.oulu.fi" is
  1496. running.
  1497. 5.5 Users
  1498. Command: USERS
  1499. Parameters: [<server>]
  1500. Oikarinen & Reed [Page 40]
  1501. RFC 1459 Internet Relay Chat Protocol May 1993
  1502. The USERS command returns a list of users logged into the server in a
  1503. similar format to who(1), rusers(1) and finger(1). Some people
  1504. may disable this command on their server for security related
  1505. reasons. If disabled, the correct numeric must be returned to
  1506. indicate this.
  1507. Numeric Replies:
  1508. ERR_NOSUCHSERVER ERR_FILEERROR
  1509. RPL_USERSSTART RPL_USERS
  1510. RPL_NOUSERS RPL_ENDOFUSERS
  1511. ERR_USERSDISABLED
  1512. Disabled Reply:
  1513. ERR_USERSDISABLED
  1514. Examples:
  1515. USERS eff.org ; request a list of users logged in on
  1516. server eff.org
  1517. :John USERS tolsun.oulu.fi ; request from John for a list of users
  1518. logged in on server tolsun.oulu.fi
  1519. 5.6 Operwall message
  1520. Command: WALLOPS
  1521. Parameters: Text to be sent to all operators currently online
  1522. Sends a message to all operators currently online. After
  1523. implementing WALLOPS as a user command it was found that it was
  1524. often and commonly abused as a means of sending a message to a lot
  1525. of people (much similar to WALL). Due to this it is recommended
  1526. that the current implementation of WALLOPS be used as an
  1527. example by allowing and recognising only servers as the senders of
  1528. WALLOPS.
  1529. Numeric Replies:
  1530. ERR_NEEDMOREPARAMS
  1531. Examples:
  1532. :csd.bu.edu WALLOPS :Connect '*.uiuc.edu 6667' from Joshua; WALLOPS
  1533. message from csd.bu.edu announcing a
  1534. CONNECT message it received and acted
  1535. upon from Joshua.
  1536. Oikarinen & Reed [Page 41]
  1537. RFC 1459 Internet Relay Chat Protocol May 1993
  1538. 5.7 Userhost message
  1539. Command: USERHOST
  1540. Parameters: <nickname>{<space><nickname>}
  1541. The USERHOST command takes a list of up to 5 nicknames, each
  1542. separated by a space character and returns a list of information
  1543. about each nickname that it found. The returned list has each reply
  1544. separated by a space.
  1545. Numeric Replies:
  1546. RPL_USERHOST ERR_NEEDMOREPARAMS
  1547. Examples:
  1548. USERHOST Wiz Michael Marty p ;USERHOST request for information on
  1549. nicks "Wiz", "Michael", "Marty" and "p"
  1550. 5.8 Ison message
  1551. Command: ISON
  1552. Parameters: <nickname>{<space><nickname>}
  1553. The ISON command was implemented to provide a quick and efficient
  1554. means to get a response about whether a given nickname was currently
  1555. on IRC. ISON only takes one (1) parameter: a space-separated list of
  1556. nicks. For each nickname in the list that is present, the server
  1557. adds that to its reply string. Thus the reply string may return
  1558. empty (none of the given nicks are present), an exact copy of the
  1559. parameter string (all of them present) or as any other subset of the
  1560. set of nicks given in the parameter. The only limit on the number
  1561. of nicks that may be checked is that the combined length must not be
  1562. too large as to cause the server to chop it off so it fits in 512
  1563. characters.
  1564. ISON is only be processed by the server local to the client sending
  1565. the command and thus not passed onto other servers for further
  1566. processing.
  1567. Numeric Replies:
  1568. RPL_ISON ERR_NEEDMOREPARAMS
  1569. Examples:
  1570. ISON phone trillian WiZ jarlek Avalon Angel Monstah
  1571. ; Sample ISON request for 7 nicks.
  1572. Oikarinen & Reed [Page 42]
  1573. RFC 1459 Internet Relay Chat Protocol May 1993
  1574. 6. REPLIES
  1575. The following is a list of numeric replies which are generated in
  1576. response to the commands given above. Each numeric is given with its
  1577. number, name and reply string.
  1578. 6.1 Error Replies.
  1579. 401 ERR_NOSUCHNICK
  1580. "<nickname> :No such nick/channel"
  1581. - Used to indicate the nickname parameter supplied to a
  1582. command is currently unused.
  1583. 402 ERR_NOSUCHSERVER
  1584. "<server name> :No such server"
  1585. - Used to indicate the server name given currently
  1586. doesn't exist.
  1587. 403 ERR_NOSUCHCHANNEL
  1588. "<channel name> :No such channel"
  1589. - Used to indicate the given channel name is invalid.
  1590. 404 ERR_CANNOTSENDTOCHAN
  1591. "<channel name> :Cannot send to channel"
  1592. - Sent to a user who is either (a) not on a channel
  1593. which is mode +n or (b) not a chanop (or mode +v) on
  1594. a channel which has mode +m set and is trying to send
  1595. a PRIVMSG message to that channel.
  1596. 405 ERR_TOOMANYCHANNELS
  1597. "<channel name> :You have joined too many \
  1598. channels"
  1599. - Sent to a user when they have joined the maximum
  1600. number of allowed channels and they try to join
  1601. another channel.
  1602. 406 ERR_WASNOSUCHNICK
  1603. "<nickname> :There was no such nickname"
  1604. - Returned by WHOWAS to indicate there is no history
  1605. information for that nickname.
  1606. 407 ERR_TOOMANYTARGETS
  1607. "<target> :Duplicate recipients. No message \
  1608. Oikarinen & Reed [Page 43]
  1609. RFC 1459 Internet Relay Chat Protocol May 1993
  1610. delivered"
  1611. - Returned to a client which is attempting to send a
  1612. PRIVMSG/NOTICE using the user@host destination format
  1613. and for a user@host which has several occurrences.
  1614. 409 ERR_NOORIGIN
  1615. ":No origin specified"
  1616. - PING or PONG message missing the originator parameter
  1617. which is required since these commands must work
  1618. without valid prefixes.
  1619. 411 ERR_NORECIPIENT
  1620. ":No recipient given (<command>)"
  1621. 412 ERR_NOTEXTTOSEND
  1622. ":No text to send"
  1623. 413 ERR_NOTOPLEVEL
  1624. "<mask> :No toplevel domain specified"
  1625. 414 ERR_WILDTOPLEVEL
  1626. "<mask> :Wildcard in toplevel domain"
  1627. - 412 - 414 are returned by PRIVMSG to indicate that
  1628. the message wasn't delivered for some reason.
  1629. ERR_NOTOPLEVEL and ERR_WILDTOPLEVEL are errors that
  1630. are returned when an invalid use of
  1631. "PRIVMSG $<server>" or "PRIVMSG #<host>" is attempted.
  1632. 421 ERR_UNKNOWNCOMMAND
  1633. "<command> :Unknown command"
  1634. - Returned to a registered client to indicate that the
  1635. command sent is unknown by the server.
  1636. 422 ERR_NOMOTD
  1637. ":MOTD File is missing"
  1638. - Server's MOTD file could not be opened by the server.
  1639. 423 ERR_NOADMININFO
  1640. "<server> :No administrative info available"
  1641. - Returned by a server in response to an ADMIN message
  1642. when there is an error in finding the appropriate
  1643. information.
  1644. 424 ERR_FILEERROR
  1645. ":File error doing <file op> on <file>"
  1646. Oikarinen & Reed [Page 44]
  1647. RFC 1459 Internet Relay Chat Protocol May 1993
  1648. - Generic error message used to report a failed file
  1649. operation during the processing of a message.
  1650. 431 ERR_NONICKNAMEGIVEN
  1651. ":No nickname given"
  1652. - Returned when a nickname parameter expected for a
  1653. command and isn't found.
  1654. 432 ERR_ERRONEUSNICKNAME
  1655. "<nick> :Erroneus nickname"
  1656. - Returned after receiving a NICK message which contains
  1657. characters which do not fall in the defined set. See
  1658. section x.x.x for details on valid nicknames.
  1659. 433 ERR_NICKNAMEINUSE
  1660. "<nick> :Nickname is already in use"
  1661. - Returned when a NICK message is processed that results
  1662. in an attempt to change to a currently existing
  1663. nickname.
  1664. 436 ERR_NICKCOLLISION
  1665. "<nick> :Nickname collision KILL"
  1666. - Returned by a server to a client when it detects a
  1667. nickname collision (registered of a NICK that
  1668. already exists by another server).
  1669. 441 ERR_USERNOTINCHANNEL
  1670. "<nick> <channel> :They aren't on that channel"
  1671. - Returned by the server to indicate that the target
  1672. user of the command is not on the given channel.
  1673. 442 ERR_NOTONCHANNEL
  1674. "<channel> :You're not on that channel"
  1675. - Returned by the server whenever a client tries to
  1676. perform a channel effecting command for which the
  1677. client isn't a member.
  1678. 443 ERR_USERONCHANNEL
  1679. "<user> <channel> :is already on channel"
  1680. - Returned when a client tries to invite a user to a
  1681. channel they are already on.
  1682. Oikarinen & Reed [Page 45]
  1683. RFC 1459 Internet Relay Chat Protocol May 1993
  1684. 444 ERR_NOLOGIN
  1685. "<user> :User not logged in"
  1686. - Returned by the summon after a SUMMON command for a
  1687. user was unable to be performed since they were not
  1688. logged in.
  1689. 445 ERR_SUMMONDISABLED
  1690. ":SUMMON has been disabled"
  1691. - Returned as a response to the SUMMON command. Must be
  1692. returned by any server which does not implement it.
  1693. 446 ERR_USERSDISABLED
  1694. ":USERS has been disabled"
  1695. - Returned as a response to the USERS command. Must be
  1696. returned by any server which does not implement it.
  1697. 451 ERR_NOTREGISTERED
  1698. ":You have not registered"
  1699. - Returned by the server to indicate that the client
  1700. must be registered before the server will allow it
  1701. to be parsed in detail.
  1702. 461 ERR_NEEDMOREPARAMS
  1703. "<command> :Not enough parameters"
  1704. - Returned by the server by numerous commands to
  1705. indicate to the client that it didn't supply enough
  1706. parameters.
  1707. 462 ERR_ALREADYREGISTRED
  1708. ":You may not reregister"
  1709. - Returned by the server to any link which tries to
  1710. change part of the registered details (such as
  1711. password or user details from second USER message).
  1712. 463 ERR_NOPERMFORHOST
  1713. ":Your host isn't among the privileged"
  1714. - Returned to a client which attempts to register with
  1715. a server which does not been setup to allow
  1716. connections from the host the attempted connection
  1717. is tried.
  1718. Oikarinen & Reed [Page 46]
  1719. RFC 1459 Internet Relay Chat Protocol May 1993
  1720. 464 ERR_PASSWDMISMATCH
  1721. ":Password incorrect"
  1722. - Returned to indicate a failed attempt at registering
  1723. a connection for which a password was required and
  1724. was either not given or incorrect.
  1725. 465 ERR_YOUREBANNEDCREEP
  1726. ":You are banned from this server"
  1727. - Returned after an attempt to connect and register
  1728. yourself with a server which has been setup to
  1729. explicitly deny connections to you.
  1730. 467 ERR_KEYSET
  1731. "<channel> :Channel key already set"
  1732. 471 ERR_CHANNELISFULL
  1733. "<channel> :Cannot join channel (+l)"
  1734. 472 ERR_UNKNOWNMODE
  1735. "<char> :is unknown mode char to me"
  1736. 473 ERR_INVITEONLYCHAN
  1737. "<channel> :Cannot join channel (+i)"
  1738. 474 ERR_BANNEDFROMCHAN
  1739. "<channel> :Cannot join channel (+b)"
  1740. 475 ERR_BADCHANNELKEY
  1741. "<channel> :Cannot join channel (+k)"
  1742. 481 ERR_NOPRIVILEGES
  1743. ":Permission Denied- You're not an IRC operator"
  1744. - Any command requiring operator privileges to operate
  1745. must return this error to indicate the attempt was
  1746. unsuccessful.
  1747. 482 ERR_CHANOPRIVSNEEDED
  1748. "<channel> :You're not channel operator"
  1749. - Any command requiring 'chanop' privileges (such as
  1750. MODE messages) must return this error if the client
  1751. making the attempt is not a chanop on the specified
  1752. channel.
  1753. 483 ERR_CANTKILLSERVER
  1754. ":You cant kill a server!"
  1755. - Any attempts to use the KILL command on a server
  1756. are to be refused and this error returned directly
  1757. to the client.
  1758. Oikarinen & Reed [Page 47]
  1759. RFC 1459 Internet Relay Chat Protocol May 1993
  1760. 491 ERR_NOOPERHOST
  1761. ":No O-lines for your host"
  1762. - If a client sends an OPER message and the server has
  1763. not been configured to allow connections from the
  1764. client's host as an operator, this error must be
  1765. returned.
  1766. 501 ERR_UMODEUNKNOWNFLAG
  1767. ":Unknown MODE flag"
  1768. - Returned by the server to indicate that a MODE
  1769. message was sent with a nickname parameter and that
  1770. the a mode flag sent was not recognized.
  1771. 502 ERR_USERSDONTMATCH
  1772. ":Cant change mode for other users"
  1773. - Error sent to any user trying to view or change the
  1774. user mode for a user other than themselves.
  1775. 6.2 Command responses.
  1776. 300 RPL_NONE
  1777. Dummy reply number. Not used.
  1778. 302 RPL_USERHOST
  1779. ":[<reply>{<space><reply>}]"
  1780. - Reply format used by USERHOST to list replies to
  1781. the query list. The reply string is composed as
  1782. follows:
  1783. <reply> ::= <nick>['*'] '=' <'+'|'-'><hostname>
  1784. The '*' indicates whether the client has registered
  1785. as an Operator. The '-' or '+' characters represent
  1786. whether the client has set an AWAY message or not
  1787. respectively.
  1788. 303 RPL_ISON
  1789. ":[<nick> {<space><nick>}]"
  1790. - Reply format used by ISON to list replies to the
  1791. query list.
  1792. 301 RPL_AWAY
  1793. "<nick> :<away message>"
  1794. Oikarinen & Reed [Page 48]
  1795. RFC 1459 Internet Relay Chat Protocol May 1993
  1796. 305 RPL_UNAWAY
  1797. ":You are no longer marked as being away"
  1798. 306 RPL_NOWAWAY
  1799. ":You have been marked as being away"
  1800. - These replies are used with the AWAY command (if
  1801. allowed). RPL_AWAY is sent to any client sending a
  1802. PRIVMSG to a client which is away. RPL_AWAY is only
  1803. sent by the server to which the client is connected.
  1804. Replies RPL_UNAWAY and RPL_NOWAWAY are sent when the
  1805. client removes and sets an AWAY message.
  1806. 311 RPL_WHOISUSER
  1807. "<nick> <user> <host> * :<real name>"
  1808. 312 RPL_WHOISSERVER
  1809. "<nick> <server> :<server info>"
  1810. 313 RPL_WHOISOPERATOR
  1811. "<nick> :is an IRC operator"
  1812. 317 RPL_WHOISIDLE
  1813. "<nick> <integer> :seconds idle"
  1814. 318 RPL_ENDOFWHOIS
  1815. "<nick> :End of /WHOIS list"
  1816. 319 RPL_WHOISCHANNELS
  1817. "<nick> :{[@|+]<channel><space>}"
  1818. - Replies 311 - 313, 317 - 319 are all replies
  1819. generated in response to a WHOIS message. Given that
  1820. there are enough parameters present, the answering
  1821. server must either formulate a reply out of the above
  1822. numerics (if the query nick is found) or return an
  1823. error reply. The '*' in RPL_WHOISUSER is there as
  1824. the literal character and not as a wild card. For
  1825. each reply set, only RPL_WHOISCHANNELS may appear
  1826. more than once (for long lists of channel names).
  1827. The '@' and '+' characters next to the channel name
  1828. indicate whether a client is a channel operator or
  1829. has been granted permission to speak on a moderated
  1830. channel. The RPL_ENDOFWHOIS reply is used to mark
  1831. the end of processing a WHOIS message.
  1832. 314 RPL_WHOWASUSER
  1833. "<nick> <user> <host> * :<real name>"
  1834. 369 RPL_ENDOFWHOWAS
  1835. "<nick> :End of WHOWAS"
  1836. - When replying to a WHOWAS message, a server must use
  1837. the replies RPL_WHOWASUSER, RPL_WHOISSERVER or
  1838. ERR_WASNOSUCHNICK for each nickname in the presented
  1839. Oikarinen & Reed [Page 49]
  1840. RFC 1459 Internet Relay Chat Protocol May 1993
  1841. list. At the end of all reply batches, there must
  1842. be RPL_ENDOFWHOWAS (even if there was only one reply
  1843. and it was an error).
  1844. 321 RPL_LISTSTART
  1845. "Channel :Users Name"
  1846. 322 RPL_LIST
  1847. "<channel> <# visible> :<topic>"
  1848. 323 RPL_LISTEND
  1849. ":End of /LIST"
  1850. - Replies RPL_LISTSTART, RPL_LIST, RPL_LISTEND mark
  1851. the start, actual replies with data and end of the
  1852. server's response to a LIST command. If there are
  1853. no channels available to return, only the start
  1854. and end reply must be sent.
  1855. 324 RPL_CHANNELMODEIS
  1856. "<channel> <mode> <mode params>"
  1857. 331 RPL_NOTOPIC
  1858. "<channel> :No topic is set"
  1859. 332 RPL_TOPIC
  1860. "<channel> :<topic>"
  1861. - When sending a TOPIC message to determine the
  1862. channel topic, one of two replies is sent. If
  1863. the topic is set, RPL_TOPIC is sent back else
  1864. RPL_NOTOPIC.
  1865. 341 RPL_INVITING
  1866. "<channel> <nick>"
  1867. - Returned by the server to indicate that the
  1868. attempted INVITE message was successful and is
  1869. being passed onto the end client.
  1870. 342 RPL_SUMMONING
  1871. "<user> :Summoning user to IRC"
  1872. - Returned by a server answering a SUMMON message to
  1873. indicate that it is summoning that user.
  1874. 351 RPL_VERSION
  1875. "<version>.<debuglevel> <server> :<comments>"
  1876. - Reply by the server showing its version details.
  1877. The <version> is the version of the software being
  1878. Oikarinen & Reed [Page 50]
  1879. RFC 1459 Internet Relay Chat Protocol May 1993
  1880. used (including any patchlevel revisions) and the
  1881. <debuglevel> is used to indicate if the server is
  1882. running in "debug mode".
  1883. The "comments" field may contain any comments about
  1884. the version or further version details.
  1885. 352 RPL_WHOREPLY
  1886. "<channel> <user> <host> <server> <nick> \
  1887. <H|G>[*][@|+] :<hopcount> <real name>"
  1888. 315 RPL_ENDOFWHO
  1889. "<name> :End of /WHO list"
  1890. - The RPL_WHOREPLY and RPL_ENDOFWHO pair are used
  1891. to answer a WHO message. The RPL_WHOREPLY is only
  1892. sent if there is an appropriate match to the WHO
  1893. query. If there is a list of parameters supplied
  1894. with a WHO message, a RPL_ENDOFWHO must be sent
  1895. after processing each list item with <name> being
  1896. the item.
  1897. 353 RPL_NAMREPLY
  1898. "<channel> :[[@|+]<nick> [[@|+]<nick> [...]]]"
  1899. 366 RPL_ENDOFNAMES
  1900. "<channel> :End of /NAMES list"
  1901. - To reply to a NAMES message, a reply pair consisting
  1902. of RPL_NAMREPLY and RPL_ENDOFNAMES is sent by the
  1903. server back to the client. If there is no channel
  1904. found as in the query, then only RPL_ENDOFNAMES is
  1905. returned. The exception to this is when a NAMES
  1906. message is sent with no parameters and all visible
  1907. channels and contents are sent back in a series of
  1908. RPL_NAMEREPLY messages with a RPL_ENDOFNAMES to mark
  1909. the end.
  1910. 364 RPL_LINKS
  1911. "<mask> <server> :<hopcount> <server info>"
  1912. 365 RPL_ENDOFLINKS
  1913. "<mask> :End of /LINKS list"
  1914. - In replying to the LINKS message, a server must send
  1915. replies back using the RPL_LINKS numeric and mark the
  1916. end of the list using an RPL_ENDOFLINKS reply.
  1917. 367 RPL_BANLIST
  1918. "<channel> <banid>"
  1919. 368 RPL_ENDOFBANLIST
  1920. Oikarinen & Reed [Page 51]
  1921. RFC 1459 Internet Relay Chat Protocol May 1993
  1922. "<channel> :End of channel ban list"
  1923. - When listing the active 'bans' for a given channel,
  1924. a server is required to send the list back using the
  1925. RPL_BANLIST and RPL_ENDOFBANLIST messages. A separate
  1926. RPL_BANLIST is sent for each active banid. After the
  1927. banids have been listed (or if none present) a
  1928. RPL_ENDOFBANLIST must be sent.
  1929. 371 RPL_INFO
  1930. ":<string>"
  1931. 374 RPL_ENDOFINFO
  1932. ":End of /INFO list"
  1933. - A server responding to an INFO message is required to
  1934. send all its 'info' in a series of RPL_INFO messages
  1935. with a RPL_ENDOFINFO reply to indicate the end of the
  1936. replies.
  1937. 375 RPL_MOTDSTART
  1938. ":- <server> Message of the day - "
  1939. 372 RPL_MOTD
  1940. ":- <text>"
  1941. 376 RPL_ENDOFMOTD
  1942. ":End of /MOTD command"
  1943. - When responding to the MOTD message and the MOTD file
  1944. is found, the file is displayed line by line, with
  1945. each line no longer than 80 characters, using
  1946. RPL_MOTD format replies. These should be surrounded
  1947. by a RPL_MOTDSTART (before the RPL_MOTDs) and an
  1948. RPL_ENDOFMOTD (after).
  1949. 381 RPL_YOUREOPER
  1950. ":You are now an IRC operator"
  1951. - RPL_YOUREOPER is sent back to a client which has
  1952. just successfully issued an OPER message and gained
  1953. operator status.
  1954. 382 RPL_REHASHING
  1955. "<config file> :Rehashing"
  1956. - If the REHASH option is used and an operator sends
  1957. a REHASH message, an RPL_REHASHING is sent back to
  1958. the operator.
  1959. 391 RPL_TIME
  1960. Oikarinen & Reed [Page 52]
  1961. RFC 1459 Internet Relay Chat Protocol May 1993
  1962. "<server> :<string showing server's local time>"
  1963. - When replying to the TIME message, a server must send
  1964. the reply using the RPL_TIME format above. The string
  1965. showing the time need only contain the correct day and
  1966. time there. There is no further requirement for the
  1967. time string.
  1968. 392 RPL_USERSSTART
  1969. ":UserID Terminal Host"
  1970. 393 RPL_USERS
  1971. ":%-8s %-9s %-8s"
  1972. 394 RPL_ENDOFUSERS
  1973. ":End of users"
  1974. 395 RPL_NOUSERS
  1975. ":Nobody logged in"
  1976. - If the USERS message is handled by a server, the
  1977. replies RPL_USERSTART, RPL_USERS, RPL_ENDOFUSERS and
  1978. RPL_NOUSERS are used. RPL_USERSSTART must be sent
  1979. first, following by either a sequence of RPL_USERS
  1980. or a single RPL_NOUSER. Following this is
  1981. RPL_ENDOFUSERS.
  1982. 200 RPL_TRACELINK
  1983. "Link <version & debug level> <destination> \
  1984. <next server>"
  1985. 201 RPL_TRACECONNECTING
  1986. "Try. <class> <server>"
  1987. 202 RPL_TRACEHANDSHAKE
  1988. "H.S. <class> <server>"
  1989. 203 RPL_TRACEUNKNOWN
  1990. "???? <class> [<client IP address in dot form>]"
  1991. 204 RPL_TRACEOPERATOR
  1992. "Oper <class> <nick>"
  1993. 205 RPL_TRACEUSER
  1994. "User <class> <nick>"
  1995. 206 RPL_TRACESERVER
  1996. "Serv <class> <int>S <int>C <server> \
  1997. <nick!user|*!*>@<host|server>"
  1998. 208 RPL_TRACENEWTYPE
  1999. "<newtype> 0 <client name>"
  2000. 261 RPL_TRACELOG
  2001. "File <logfile> <debug level>"
  2002. - The RPL_TRACE* are all returned by the server in
  2003. response to the TRACE message. How many are
  2004. returned is dependent on the the TRACE message and
  2005. Oikarinen & Reed [Page 53]
  2006. RFC 1459 Internet Relay Chat Protocol May 1993
  2007. whether it was sent by an operator or not. There
  2008. is no predefined order for which occurs first.
  2009. Replies RPL_TRACEUNKNOWN, RPL_TRACECONNECTING and
  2010. RPL_TRACEHANDSHAKE are all used for connections
  2011. which have not been fully established and are either
  2012. unknown, still attempting to connect or in the
  2013. process of completing the 'server handshake'.
  2014. RPL_TRACELINK is sent by any server which handles
  2015. a TRACE message and has to pass it on to another
  2016. server. The list of RPL_TRACELINKs sent in
  2017. response to a TRACE command traversing the IRC
  2018. network should reflect the actual connectivity of
  2019. the servers themselves along that path.
  2020. RPL_TRACENEWTYPE is to be used for any connection
  2021. which does not fit in the other categories but is
  2022. being displayed anyway.
  2023. 211 RPL_STATSLINKINFO
  2024. "<linkname> <sendq> <sent messages> \
  2025. <sent bytes> <received messages> \
  2026. <received bytes> <time open>"
  2027. 212 RPL_STATSCOMMANDS
  2028. "<command> <count>"
  2029. 213 RPL_STATSCLINE
  2030. "C <host> * <name> <port> <class>"
  2031. 214 RPL_STATSNLINE
  2032. "N <host> * <name> <port> <class>"
  2033. 215 RPL_STATSILINE
  2034. "I <host> * <host> <port> <class>"
  2035. 216 RPL_STATSKLINE
  2036. "K <host> * <username> <port> <class>"
  2037. 218 RPL_STATSYLINE
  2038. "Y <class> <ping frequency> <connect \
  2039. frequency> <max sendq>"
  2040. 219 RPL_ENDOFSTATS
  2041. "<stats letter> :End of /STATS report"
  2042. 241 RPL_STATSLLINE
  2043. "L <hostmask> * <servername> <maxdepth>"
  2044. 242 RPL_STATSUPTIME
  2045. ":Server Up %d days %d:%02d:%02d"
  2046. 243 RPL_STATSOLINE
  2047. "O <hostmask> * <name>"
  2048. 244 RPL_STATSHLINE
  2049. "H <hostmask> * <servername>"
  2050. 221 RPL_UMODEIS
  2051. "<user mode string>"
  2052. Oikarinen & Reed [Page 54]
  2053. RFC 1459 Internet Relay Chat Protocol May 1993
  2054. - To answer a query about a client's own mode,
  2055. RPL_UMODEIS is sent back.
  2056. 251 RPL_LUSERCLIENT
  2057. ":There are <integer> users and <integer> \
  2058. invisible on <integer> servers"
  2059. 252 RPL_LUSEROP
  2060. "<integer> :operator(s) online"
  2061. 253 RPL_LUSERUNKNOWN
  2062. "<integer> :unknown connection(s)"
  2063. 254 RPL_LUSERCHANNELS
  2064. "<integer> :channels formed"
  2065. 255 RPL_LUSERME
  2066. ":I have <integer> clients and <integer> \
  2067. servers"
  2068. - In processing an LUSERS message, the server
  2069. sends a set of replies from RPL_LUSERCLIENT,
  2070. RPL_LUSEROP, RPL_USERUNKNOWN,
  2071. RPL_LUSERCHANNELS and RPL_LUSERME. When
  2072. replying, a server must send back
  2073. RPL_LUSERCLIENT and RPL_LUSERME. The other
  2074. replies are only sent back if a non-zero count
  2075. is found for them.
  2076. 256 RPL_ADMINME
  2077. "<server> :Administrative info"
  2078. 257 RPL_ADMINLOC1
  2079. ":<admin info>"
  2080. 258 RPL_ADMINLOC2
  2081. ":<admin info>"
  2082. 259 RPL_ADMINEMAIL
  2083. ":<admin info>"
  2084. - When replying to an ADMIN message, a server
  2085. is expected to use replies RLP_ADMINME
  2086. through to RPL_ADMINEMAIL and provide a text
  2087. message with each. For RPL_ADMINLOC1 a
  2088. description of what city, state and country
  2089. the server is in is expected, followed by
  2090. details of the university and department
  2091. (RPL_ADMINLOC2) and finally the administrative
  2092. contact for the server (an email address here
  2093. is required) in RPL_ADMINEMAIL.
  2094. Oikarinen & Reed [Page 55]
  2095. RFC 1459 Internet Relay Chat Protocol May 1993
  2096. 6.3 Reserved numerics.
  2097. These numerics are not described above since they fall into one of
  2098. the following categories:
  2099. 1. no longer in use;
  2100. 2. reserved for future planned use;
  2101. 3. in current use but are part of a non-generic 'feature' of
  2102. the current IRC server.
  2103. 209 RPL_TRACECLASS 217 RPL_STATSQLINE
  2104. 231 RPL_SERVICEINFO 232 RPL_ENDOFSERVICES
  2105. 233 RPL_SERVICE 234 RPL_SERVLIST
  2106. 235 RPL_SERVLISTEND
  2107. 316 RPL_WHOISCHANOP 361 RPL_KILLDONE
  2108. 362 RPL_CLOSING 363 RPL_CLOSEEND
  2109. 373 RPL_INFOSTART 384 RPL_MYPORTIS
  2110. 466 ERR_YOUWILLBEBANNED 476 ERR_BADCHANMASK
  2111. 492 ERR_NOSERVICEHOST
  2112. 7. Client and server authentication
  2113. Clients and servers are both subject to the same level of
  2114. authentication. For both, an IP number to hostname lookup (and
  2115. reverse check on this) is performed for all connections made to the
  2116. server. Both connections are then subject to a password check (if
  2117. there is a password set for that connection). These checks are
  2118. possible on all connections although the password check is only
  2119. commonly used with servers.
  2120. An additional check that is becoming of more and more common is that
  2121. of the username responsible for making the connection. Finding the
  2122. username of the other end of the connection typically involves
  2123. connecting to an authentication server such as IDENT as described in
  2124. RFC 1413.
  2125. Given that without passwords it is not easy to reliably determine who
  2126. is on the other end of a network connection, use of passwords is
  2127. strongly recommended on inter-server connections in addition to any
  2128. other measures such as using an ident server.
  2129. 8. Current implementations
  2130. The only current implementation of this protocol is the IRC server,
  2131. version 2.8. Earlier versions may implement some or all of the
  2132. commands described by this document with NOTICE messages replacing
  2133. Oikarinen & Reed [Page 56]
  2134. RFC 1459 Internet Relay Chat Protocol May 1993
  2135. many of the numeric replies. Unfortunately, due to backward
  2136. compatibility requirements, the implementation of some parts of this
  2137. document varies with what is laid out. On notable difference is:
  2138. * recognition that any LF or CR anywhere in a message marks the
  2139. end of that message (instead of requiring CR-LF);
  2140. The rest of this section deals with issues that are mostly of
  2141. importance to those who wish to implement a server but some parts
  2142. also apply directly to clients as well.
  2143. 8.1 Network protocol: TCP - why it is best used here.
  2144. IRC has been implemented on top of TCP since TCP supplies a reliable
  2145. network protocol which is well suited to this scale of conferencing.
  2146. The use of multicast IP is an alternative, but it is not widely
  2147. available or supported at the present time.
  2148. 8.1.1 Support of Unix sockets
  2149. Given that Unix domain sockets allow listen/connect operations, the
  2150. current implementation can be configured to listen and accept both
  2151. client and server connections on a Unix domain socket. These are
  2152. recognized as sockets where the hostname starts with a '/'.
  2153. When providing any information about the connections on a Unix domain
  2154. socket, the server is required to supplant the actual hostname in
  2155. place of the pathname unless the actual socket name is being asked
  2156. for.
  2157. 8.2 Command Parsing
  2158. To provide useful 'non-buffered' network IO for clients and servers,
  2159. each connection is given its own private 'input buffer' in which the
  2160. results of the most recent read and parsing are kept. A buffer size
  2161. of 512 bytes is used so as to hold 1 full message, although, this
  2162. will usually hold several commands. The private buffer is parsed
  2163. after every read operation for valid messages. When dealing with
  2164. multiple messages from one client in the buffer, care should be taken
  2165. in case one happens to cause the client to be 'removed'.
  2166. 8.3 Message delivery
  2167. It is common to find network links saturated or hosts to which you
  2168. are sending data unable to send data. Although Unix typically
  2169. handles this through the TCP window and internal buffers, the server
  2170. often has large amounts of data to send (especially when a new
  2171. server-server link forms) and the small buffers provided in the
  2172. Oikarinen & Reed [Page 57]
  2173. RFC 1459 Internet Relay Chat Protocol May 1993
  2174. kernel are not enough for the outgoing queue. To alleviate this
  2175. problem, a "send queue" is used as a FIFO queue for data to be sent.
  2176. A typical "send queue" may grow to 200 Kbytes on a large IRC network
  2177. with a slow network connection when a new server connects.
  2178. When polling its connections, a server will first read and parse all
  2179. incoming data, queuing any data to be sent out. When all available
  2180. input is processed, the queued data is sent. This reduces the number
  2181. of write() system calls and helps TCP make bigger packets.
  2182. 8.4 Connection 'Liveness'
  2183. To detect when a connection has died or become unresponsive, the
  2184. server must ping each of its connections that it doesn't get a
  2185. response from in a given amount of time.
  2186. If a connection doesn't respond in time, its connection is closed
  2187. using the appropriate procedures. A connection is also dropped if
  2188. its sendq grows beyond the maximum allowed, because it is better to
  2189. close a slow connection than have a server process block.
  2190. 8.5 Establishing a server to client connection
  2191. Upon connecting to an IRC server, a client is sent the MOTD (if
  2192. present) as well as the current user/server count (as per the LUSER
  2193. command). The server is also required to give an unambiguous message
  2194. to the client which states its name and version as well as any other
  2195. introductory messages which may be deemed appropriate.
  2196. After dealing with this, the server must then send out the new user's
  2197. nickname and other information as supplied by itself (USER command)
  2198. and as the server could discover (from DNS/authentication servers).
  2199. The server must send this information out with NICK first followed by
  2200. USER.
  2201. 8.6 Establishing a server-server connection.
  2202. The process of establishing of a server-to-server connection is
  2203. fraught with danger since there are many possible areas where
  2204. problems can occur - the least of which are race conditions.
  2205. After a server has received a connection following by a PASS/SERVER
  2206. pair which were recognised as being valid, the server should then
  2207. reply with its own PASS/SERVER information for that connection as
  2208. well as all of the other state information it knows about as
  2209. described below.
  2210. When the initiating server receives a PASS/SERVER pair, it too then
  2211. Oikarinen & Reed [Page 58]
  2212. RFC 1459 Internet Relay Chat Protocol May 1993
  2213. checks that the server responding is authenticated properly before
  2214. accepting the connection to be that server.
  2215. 8.6.1 Server exchange of state information when connecting
  2216. The order of state information being exchanged between servers is
  2217. essential. The required order is as follows:
  2218. * all known other servers;
  2219. * all known user information;
  2220. * all known channel information.
  2221. Information regarding servers is sent via extra SERVER messages, user
  2222. information with NICK/USER/MODE/JOIN messages and channels with MODE
  2223. messages.
  2224. NOTE: channel topics are *NOT* exchanged here because the TOPIC
  2225. command overwrites any old topic information, so at best, the two
  2226. sides of the connection would exchange topics.
  2227. By passing the state information about servers first, any collisions
  2228. with servers that already exist occur before nickname collisions due
  2229. to a second server introducing a particular nickname. Due to the IRC
  2230. network only being able to exist as an acyclic graph, it may be
  2231. possible that the network has already reconnected in another
  2232. location, the place where the collision occurs indicating where the
  2233. net needs to split.
  2234. 8.7 Terminating server-client connections
  2235. When a client connection closes, a QUIT message is generated on
  2236. behalf of the client by the server to which the client connected. No
  2237. other message is to be generated or used.
  2238. 8.8 Terminating server-server connections
  2239. If a server-server connection is closed, either via a remotely
  2240. generated SQUIT or 'natural' causes, the rest of the connected IRC
  2241. network must have its information updated with by the server which
  2242. detected the closure. The server then sends a list of SQUITs (one
  2243. for each server behind that connection) and a list of QUITs (again,
  2244. one for each client behind that connection).
  2245. Oikarinen & Reed [Page 59]
  2246. RFC 1459 Internet Relay Chat Protocol May 1993
  2247. 8.9 Tracking nickname changes
  2248. All IRC servers are required to keep a history of recent nickname
  2249. changes. This is required to allow the server to have a chance of
  2250. keeping in touch of things when nick-change race conditions occur
  2251. with commands which manipulate them. Commands which must trace nick
  2252. changes are:
  2253. * KILL (the nick being killed)
  2254. * MODE (+/- o,v)
  2255. * KICK (the nick being kicked)
  2256. No other commands are to have nick changes checked for.
  2257. In the above cases, the server is required to first check for the
  2258. existence of the nickname, then check its history to see who that
  2259. nick currently belongs to (if anyone!). This reduces the chances of
  2260. race conditions but they can still occur with the server ending up
  2261. affecting the wrong client. When performing a change trace for an
  2262. above command it is recommended that a time range be given and
  2263. entries which are too old ignored.
  2264. For a reasonable history, a server should be able to keep previous
  2265. nickname for every client it knows about if they all decided to
  2266. change. This size is limited by other factors (such as memory, etc).
  2267. 8.10 Flood control of clients
  2268. With a large network of interconnected IRC servers, it is quite easy
  2269. for any single client attached to the network to supply a continuous
  2270. stream of messages that result in not only flooding the network, but
  2271. also degrading the level of service provided to others. Rather than
  2272. require every 'victim' to be provide their own protection, flood
  2273. protection was written into the server and is applied to all clients
  2274. except services. The current algorithm is as follows:
  2275. * check to see if client's `message timer' is less than
  2276. current time (set to be equal if it is);
  2277. * read any data present from the client;
  2278. * while the timer is less than ten seconds ahead of the current
  2279. time, parse any present messages and penalize the client by
  2280. 2 seconds for each message;
  2281. which in essence means that the client may send 1 message every 2
  2282. Oikarinen & Reed [Page 60]
  2283. RFC 1459 Internet Relay Chat Protocol May 1993
  2284. seconds without being adversely affected.
  2285. 8.11 Non-blocking lookups
  2286. In a real-time environment, it is essential that a server process do
  2287. as little waiting as possible so that all the clients are serviced
  2288. fairly. Obviously this requires non-blocking IO on all network
  2289. read/write operations. For normal server connections, this was not
  2290. difficult, but there are other support operations that may cause the
  2291. server to block (such as disk reads). Where possible, such activity
  2292. should be performed with a short timeout.
  2293. 8.11.1 Hostname (DNS) lookups
  2294. Using the standard resolver libraries from Berkeley and others has
  2295. meant large delays in some cases where replies have timed out. To
  2296. avoid this, a separate set of DNS routines were written which were
  2297. setup for non-blocking IO operations and then polled from within the
  2298. main server IO loop.
  2299. 8.11.2 Username (Ident) lookups
  2300. Although there are numerous ident libraries for use and inclusion
  2301. into other programs, these caused problems since they operated in a
  2302. synchronous manner and resulted in frequent delays. Again the
  2303. solution was to write a set of routines which would cooperate with
  2304. the rest of the server and work using non-blocking IO.
  2305. 8.12 Configuration File
  2306. To provide a flexible way of setting up and running the server, it is
  2307. recommended that a configuration file be used which contains
  2308. instructions to the server on the following:
  2309. * which hosts to accept client connections from;
  2310. * which hosts to allow to connect as servers;
  2311. * which hosts to connect to (both actively and
  2312. passively);
  2313. * information about where the server is (university,
  2314. city/state, company are examples of this);
  2315. * who is responsible for the server and an email address
  2316. at which they can be contacted;
  2317. * hostnames and passwords for clients which wish to be given
  2318. Oikarinen & Reed [Page 61]
  2319. RFC 1459 Internet Relay Chat Protocol May 1993
  2320. access to restricted operator commands.
  2321. In specifying hostnames, both domain names and use of the 'dot'
  2322. notation (127.0.0.1) should both be accepted. It must be possible to
  2323. specify the password to be used/accepted for all outgoing and
  2324. incoming connections (although the only outgoing connections are
  2325. those to other servers).
  2326. The above list is the minimum requirement for any server which wishes
  2327. to make a connection with another server. Other items which may be
  2328. of use are:
  2329. * specifying which servers other server may introduce;
  2330. * how deep a server branch is allowed to become;
  2331. * hours during which clients may connect.
  2332. 8.12.1 Allowing clients to connect
  2333. A server should use some sort of 'access control list' (either in the
  2334. configuration file or elsewhere) that is read at startup and used to
  2335. decide what hosts clients may use to connect to it.
  2336. Both 'deny' and 'allow' should be implemented to provide the required
  2337. flexibility for host access control.
  2338. 8.12.2 Operators
  2339. The granting of operator privileges to a disruptive person can have
  2340. dire consequences for the well-being of the IRC net in general due to
  2341. the powers given to them. Thus, the acquisition of such powers
  2342. should not be very easy. The current setup requires two 'passwords'
  2343. to be used although one of them is usually easy guessed. Storage of
  2344. oper passwords in configuration files is preferable to hard coding
  2345. them in and should be stored in a crypted format (ie using crypt(3)
  2346. from Unix) to prevent easy theft.
  2347. 8.12.3 Allowing servers to connect
  2348. The interconnection of server is not a trivial matter: a bad
  2349. connection can have a large impact on the usefulness of IRC. Thus,
  2350. each server should have a list of servers to which it may connect and
  2351. which servers may connect to it. Under no circumstances should a
  2352. server allow an arbitrary host to connect as a server. In addition
  2353. to which servers may and may not connect, the configuration file
  2354. should also store the password and other characteristics of that
  2355. link.
  2356. Oikarinen & Reed [Page 62]
  2357. RFC 1459 Internet Relay Chat Protocol May 1993
  2358. 8.12.4 Administrivia
  2359. To provide accurate and valid replies to the ADMIN command (see
  2360. section 4.3.7), the server should find the relevant details in the
  2361. configuration.
  2362. 8.13 Channel membership
  2363. The current server allows any registered local user to join upto 10
  2364. different channels. There is no limit imposed on non-local users so
  2365. that the server remains (reasonably) consistant with all others on a
  2366. channel membership basis
  2367. 9. Current problems
  2368. There are a number of recognized problems with this protocol, all of
  2369. which hope to be solved sometime in the near future during its
  2370. rewrite. Currently, work is underway to find working solutions to
  2371. these problems.
  2372. 9.1 Scalability
  2373. It is widely recognized that this protocol does not scale
  2374. sufficiently well when used in a large arena. The main problem comes
  2375. from the requirement that all servers know about all other servers
  2376. and users and that information regarding them be updated as soon as
  2377. it changes. It is also desirable to keep the number of servers low
  2378. so that the path length between any two points is kept minimal and
  2379. the spanning tree as strongly branched as possible.
  2380. 9.2 Labels
  2381. The current IRC protocol has 3 types of labels: the nickname, the
  2382. channel name and the server name. Each of the three types has its
  2383. own domain and no duplicates are allowed inside that domain.
  2384. Currently, it is possible for users to pick the label for any of the
  2385. three, resulting in collisions. It is widely recognized that this
  2386. needs reworking, with a plan for unique names for channels and nicks
  2387. that don't collide being desirable as well as a solution allowing a
  2388. cyclic tree.
  2389. 9.2.1 Nicknames
  2390. The idea of the nickname on IRC is very convenient for users to use
  2391. when talking to each other outside of a channel, but there is only a
  2392. finite nickname space and being what they are, its not uncommon for
  2393. several people to want to use the same nick. If a nickname is chosen
  2394. by two people using this protocol, either one will not succeed or
  2395. Oikarinen & Reed [Page 63]
  2396. RFC 1459 Internet Relay Chat Protocol May 1993
  2397. both will removed by use of KILL (4.6.1).
  2398. 9.2.2 Channels
  2399. The current channel layout requires that all servers know about all
  2400. channels, their inhabitants and properties. Besides not scaling
  2401. well, the issue of privacy is also a concern. A collision of
  2402. channels is treated as an inclusive event (both people who create the
  2403. new channel are considered to be members of it) rather than an
  2404. exclusive one such as used to solve nickname collisions.
  2405. 9.2.3 Servers
  2406. Although the number of servers is usually small relative to the
  2407. number of users and channels, they two currently required to be known
  2408. globally, either each one separately or hidden behind a mask.
  2409. 9.3 Algorithms
  2410. In some places within the server code, it has not been possible to
  2411. avoid N^2 algorithms such as checking the channel list of a set
  2412. of clients.
  2413. In current server versions, there are no database consistency checks,
  2414. each server assumes that a neighbouring server is correct. This
  2415. opens the door to large problems if a connecting server is buggy or
  2416. otherwise tries to introduce contradictions to the existing net.
  2417. Currently, because of the lack of unique internal and global labels,
  2418. there are