Protocol.txt 6.9 KB

  1. ngIRCd - Next Generation IRC Server
  2. (c)2001-2007 Alexander Barton,
  4. ngIRCd is free software and published under the
  5. terms of the GNU General Public License.
  6. -- Protocol.txt --
  7. I. Compatibility
  8. ~~~~~~~~~~~~~~~~
  9. The ngIRCd implements the Internet Relay Chat (IRC) protocol version 2.10
  10. as defined in RFC ("request for comment") 1459 and 2810-2813. These (and
  11. probably further relevant RFCs) are listed in doc/RFC.txt.
  12. Unfortunately, even the "original" ircd doesn't follow these specifications
  13. in all details. But because the ngIRCd should be a fully compatible
  14. replacement for this server ("ircd") it tries to emulate these differences.
  15. If you don't like this behavior please ./configure the ngIRCd using the
  16. "--enable-strict-rfc" command line option. But keep in mind: not all IRC
  17. clients are compatible with a server configured that way, some can't even
  18. connect at all! Therefore this option usually isn't desired for "normal
  19. server operation".
  20. II. The IRC+ Protocol
  21. ~~~~~~~~~~~~~~~~~~~~~
  22. Starting with version 0.5.0, the ngIRCd extends the original IRC protocol
  23. as defined in RFC 2810-2813. This enhanced protocol is named "IRC+". It is
  24. backwards compatible to the "plain" IRC protocol and will only be used by
  25. the ngIRCd if it detects that the peer supports it as well.
  26. The "PASS" command is used to detect the protocol and peer versions see
  27. RFC 2813 (section 4.1.1) and below.
  28. II.1 Register new server link
  29. Command: PASS
  30. Parameters: <password> <version> <flags> [<options>]
  31. Used by: servers only (with these parameters)
  32. <password> is the password for this new server link as defined in the server
  33. configuration which is sent to the peer or received from it.
  34. <version> consists of two parts and is at least 4, at most 14 characters
  35. long: the first four bytes contain the IRC protocol version number, whereas
  36. the first two bytes represent the major version, the last two bytes the
  37. minor version (the string "0210" indicates version 2.10, e.g.).
  38. The following optional(!) 10 bytes contain an implementation-dependent
  39. version number. Servers supporting the IRC+ protocol as defined in this
  40. document provide the string "-IRC+" here.
  41. Example for <version>: "0210-IRC+".
  42. <flags> consists of two parts separated with the character "|" and is at
  43. most 100 bytes long. The first part contains the name of the implementation
  44. (ngIRCd sets this to "ngircd", the original ircd to "IRC", e.g.). The second
  45. part is implementation-dependent and should only be parsed if the peer
  46. supports the IRC+ protocol as well. In this case the following syntax is
  47. used: "<serverversion>[:<serverflags>]".
  48. <serverversion> is an ASCII representation of the clear-text server version
  49. number, <serverflags> indicates the supported IRC+ protocol extensions (and
  50. may be empty!).
  51. The following <serverflags> are defined at the moment:
  52. - C: The server supports the CHANINFO command.
  53. - L: INVITE- and BAN-lists should be synchronized between servers: if the
  54. peer understands this flag, it will send "MODE +I" and "MODE +b"
  55. commands after the server link has been established.
  56. - H: The server supports the "enhanced server handshake", see section II.2
  57. for a detailed description.
  58. - o: IRC operators are allowed to change channel- and channel-user-modes
  59. even if they aren't channel-operator of the affected channel.
  60. - Z: Compressed server links are supported by the server.
  61. Example for a complete <flags> string: "ngircd|0.7.5:CZ".
  62. The optional parameter <options> is used to propagate server options as
  63. defined in RFC 2813, section 4.1.1.
  64. II.2 Enhanced Server Handshake
  65. The "enhanced server handshake" is used when both servers support this IRC+
  66. extension, which is indicated by the 'H' flag in the <serverflags> sent with
  67. the PASS command, see section II.1.
  68. It basically means, that after exchanging the PASS and SERVER commands the
  69. server is not registered in the network (as usual), but that IRC numerics
  70. are exchanged until the numeric 376 (ENDOFMOTD) is received. Afterwards the
  71. peer is registered in the network as with the regular IRC protocol.
  72. A server implementing the enhanced server handshake (and indicating this
  73. using 'H' in the <serverflags>) MUST ignore all unknown numerics to it
  74. silently.
  75. In addition, such a server should at least send the numeric 005 (ISUPPORT)
  76. to its peer, containing the following information. Syntax: <key>=<value>,
  77. one token per IRC parameter. If the server has to send more than 12 token
  78. it must send separate ISUPPORT numerics (this is a limitation of the IRC
  79. protocol which allows at max 15 arguments per command).
  80. - NICKLEN: Maximum nickname length. Default: 9.
  81. - CASEMAPPING: Case mapping used for nick- and channel name comparing.
  82. Default: "ascii", the chars [a-z] are lowercase of [A-Z].
  83. - PREFIX: List of channel modes a person can get and the respective prefix
  84. a channel or nickname will get in case the person has it. The order of the
  85. modes goes from most powerful to least powerful. Default: "(ov)@+"
  86. - CHANTYPES: Supported channel prefixes. Default: "#".
  87. - CHANMODES: List of channel modes for 4 types, separated by comma (","):
  88. Mode that adds or removes a nick or address to a list, mode that changes
  89. a setting (both have always has a parameter), mode that changes a setting
  90. and only has a parameter when set, and mode that changes a setting and
  91. never has a parameter. For example "bI,k,l,imnPst".
  92. - CHANLIMIT: Maximum number of channels allowed to join by channel prefix,
  93. for example "#:10".
  94. Please see <> for details.
  95. The information exchanged using ISUPPORT can be used to detect configuration
  96. incompatibilities (different maximum nick name length, for example) and
  97. therefore to disconnect the peer prior to registering it in the network.
  98. II.3 Exchange channel-modes, topics, and persistent channels
  99. Command: CHANINFO
  100. Parameters: <channel> +<modes> <key> <limit> [<topic>]
  101. Used by: servers only
  102. CHANINFO is used by servers to inform each other about a channel: its
  103. modes, channel key, user limits and its topic. <topic> is optional.
  104. If the channel already exists on the server receiving the CHANINFO command,
  105. it only adopts the <modes> (or the <topic>) if there are no modes (or topic)
  106. already set. It there are already values set the server ignores the
  107. corresponding parameter.
  108. If the channel doesn't exists at all it will be created.
  109. The parameter <key> must be ignored if a channel has no key (the parameter
  110. <modes> doesn't list the "k" channel mode). In this case <key> should
  111. contain "*" because the parameter <key> is required by the CHANINFO syntax
  112. and therefore can't be omitted. The parameter <limit> must be ignored when
  113. a channel has no user limit (the parameter <modes> doesn't list the "l"
  114. channel mode). In this case <limit> should be "0".
  115. --
  116. $Id: Protocol.txt,v 1.14 2007/11/21 12:16:35 alex Exp $