2 ngIRCd - Next Generation IRC Server
3 http://ngircd.barton.de/
5 (c)2001-2012 Alexander Barton and Contributors.
6 ngIRCd is free software and published under the
7 terms of the GNU General Public License.
15 The ngIRCd implements the Internet Relay Chat (IRC) protocol version 2.10
16 as defined in RFC ("request for comment") 1459 and 2810-2813. These (and
17 probably further relevant RFCs) are listed in doc/RFC.txt.
19 Unfortunately, even the "original" ircd doesn't follow these specifications
20 in all details. But because the ngIRCd should be a fully compatible
21 replacement for this server ("ircd") it tries to emulate these differences.
23 If you don't like this behavior please ./configure the ngIRCd using the
24 "--enable-strict-rfc" command line option. But keep in mind: not all IRC
25 clients are compatible with a server configured that way, some can't even
26 connect at all! Therefore this option usually isn't desired for "normal
33 Starting with version 0.5.0, the ngIRCd extends the original IRC protocol
34 as defined in RFC 2810-2813. This enhanced protocol is named "IRC+". It is
35 backwards compatible to the "plain" IRC protocol and will only be used by
36 the ngIRCd if it detects that the peer supports it as well.
38 The "PASS" command is used to detect the protocol and peer versions see
39 RFC 2813 (section 4.1.1) and below.
42 II.1 Register new server link
45 Parameters: <password> <version> <flags> [<options>]
46 Used by: servers only (with these parameters)
48 <password> is the password for this new server link as defined in the server
49 configuration which is sent to the peer or received from it.
51 <version> consists of two parts and is at least 4, at most 14 characters
52 long: the first four bytes contain the IRC protocol version number, whereas
53 the first two bytes represent the major version, the last two bytes the
54 minor version (the string "0210" indicates version 2.10, e.g.).
56 The following optional(!) 10 bytes contain an implementation-dependent
57 version number. Servers supporting the IRC+ protocol as defined in this
58 document provide the string "-IRC+" here.
60 Example for <version>: "0210-IRC+".
62 <flags> consists of two parts separated with the character "|" and is at
63 most 100 bytes long. The first part contains the name of the implementation
64 (ngIRCd sets this to "ngircd", the original ircd to "IRC", e.g.). The second
65 part is implementation-dependent and should only be parsed if the peer
66 supports the IRC+ protocol as well. In this case the following syntax is
67 used: "<serverversion>[:<serverflags>]".
69 <serverversion> is an ASCII representation of the clear-text server version
70 number, <serverflags> indicates the supported IRC+ protocol extensions (and
73 The following <serverflags> are defined at the moment:
75 - C: The server supports the CHANINFO command.
77 - L: INVITE- and BAN-lists should be synchronized between servers: if the
78 peer understands this flag, it will send "MODE +I" and "MODE +b"
79 commands after the server link has been established.
81 - H: The server supports the "enhanced server handshake", see section II.2
82 for a detailed description.
84 - M: Changing client "metadata" (hostname, real name, ...) using the
85 METADATA command is supported.
87 - o: IRC operators are allowed to change channel- and channel-user-modes
88 even if they aren't channel-operator of the affected channel.
90 - S: The server supports the SERVICE command (on this link).
92 - Z: Compressed server links are supported by the server.
94 Example for a complete <flags> string: "ngircd|0.7.5:CZ".
96 The optional parameter <options> is used to propagate server options as
97 defined in RFC 2813, section 4.1.1.
100 II.2 Enhanced Server Handshake
102 The "enhanced server handshake" is used when both servers support this IRC+
103 extension, which is indicated by the 'H' flag in the <serverflags> sent with
104 the PASS command, see section II.1.
106 It basically means, that after exchanging the PASS and SERVER commands the
107 server is not registered in the network (as usual), but that IRC numerics
108 are exchanged until the numeric 376 (ENDOFMOTD) is received. Afterwards the
109 peer is registered in the network as with the regular IRC protocol.
111 A server implementing the enhanced server handshake (and indicating this
112 using 'H' in the <serverflags>) MUST ignore all unknown numerics to it
115 In addition, such a server should at least send the numeric 005 (ISUPPORT)
116 to its peer, containing the following information. Syntax: <key>=<value>,
117 one token per IRC parameter. If the server has to send more than 12 token
118 it must send separate ISUPPORT numerics (this is a limitation of the IRC
119 protocol which allows at max 15 arguments per command).
121 - NICKLEN: Maximum nickname length. Default: 9.
122 - CASEMAPPING: Case mapping used for nick- and channel name comparing.
123 Default: "ascii", the chars [a-z] are lowercase of [A-Z].
124 - PREFIX: List of channel modes a person can get and the respective prefix
125 a channel or nickname will get in case the person has it. The order of the
126 modes goes from most powerful to least powerful. Default: "(ov)@+"
127 - CHANTYPES: Supported channel prefixes. Default: "#".
128 - CHANMODES: List of channel modes for 4 types, separated by comma (","):
129 Mode that adds or removes a nick or address to a list, mode that changes
130 a setting (both have always has a parameter), mode that changes a setting
131 and only has a parameter when set, and mode that changes a setting and
132 never has a parameter. For example "bI,k,l,imnPst".
133 - CHANLIMIT: Maximum number of channels allowed to join by channel prefix,
136 Please see <http://www.irc.org/tech_docs/005.html> for details.
138 The information exchanged using ISUPPORT can be used to detect configuration
139 incompatibilities (different maximum nickname length, for example) and
140 therefore to disconnect the peer prior to registering it in the network.
143 II.3 Exchange channel-modes, topics, and persistent channels
146 Parameters: <channel> +<modes> [[<key> <limit>] <topic>]
147 Used by: servers only
149 CHANINFO is used by servers to inform each other about a channel: its
150 modes, channel key, user limits and its topic. The parameter combination
151 <key> and <limit> is optional, as well as the <topic> parameter, so that
152 there are three possible forms of this command:
154 CHANINFO <channel> +<modes>
155 CHANINFO <channel> +<modes> <topic>
156 CHANINFO <channel> +<modes> <key> <limit> <topic>
158 If the channel already exists on the server receiving the CHANINFO command,
159 it only adopts the <modes> (or the <topic>) if there are no modes (or topic)
160 already set. It there are already values set the server ignores the
161 corresponding parameter.
163 If the channel doesn't exists at all it will be created.
165 The parameter <key> must be ignored if a channel has no key (the parameter
166 <modes> doesn't list the "k" channel mode). In this case <key> should
167 contain "*" because the parameter <key> is required by the CHANINFO syntax
168 and therefore can't be omitted. The parameter <limit> must be ignored when
169 a channel has no user limit (the parameter <modes> doesn't list the "l"
170 channel mode). In this case <limit> should be "0".
173 II.4 Update webchat/proxy client information
176 Parameters: <password> <username> <hostname> <ip-address>
177 Used by: unregistered clients only
179 The WEBIRC command is used by some Web-to-IRC gateways to set the correct
180 user name and host name of users instead of their own. It must be the very
181 first command sent to the server, even before USER and NICK commands!
183 The <password> must be set in the server configuration file to prevent
184 unauthorized clients to fake their identity; it is an arbitrary string.
187 II.5 Client character encoding conversion
190 Parameters: <client-charset>
191 Used by: registered clients
192 Replies: RPL_IP_CHARCONV, ERR_IP_CHARCONV
194 A client can set its character set encoding using the CHARCONV command:
195 after receiving such a command, the server translates all message data
196 received from the client using the set <client-charset> to the server
197 encoding (UTF-8), and all message data which is to be sent to the client
198 from the server encoding (UTF-8) to <client-charset>.
200 The list of supported client character sets is implementation dependent.
202 If a client sets its <client-charset> to the server encoding (UTF-8),
203 it disables all conversions; the connection behaves as if no CHARCONV
204 command has been sent at all in this session.
207 II.6 Update client "metadata"
210 Parameters: <target> <key> <value>
211 Used by: servers only
213 The METADATA command is used on server-links to update "metadata" information
214 of clients, like the hostname, the info text ("real name"), or the user name.
216 The server updates its client database according to the received <key> and
217 <value> parameters, and passes the METADATA command on to all the other
218 servers in the network that support this command (see section II.1 "Register
219 new server link", <serverflag> "M"), even if it doesn't support the given
220 <key> itself: unknown <key> names are ignored silently!
222 The following <key> names are defined:
224 - "host": the hostname of a client (can't be empty)
225 - "info": info text ("real name") of a client
226 - "user": the user name of a client (can't be empty)
229 III. Numerics used by IRC+ Protocol
230 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
232 The IRC+ protocol uses numerics in the range 800-899 which aren't used by
233 RFC 2812 and hopefully don't clash with other implementations ...
235 Numerics 800-849 are used for status and success messages, and numerics
236 850-899 are failure and error messages.
239 III.1 IRC+ status and success numerics
241 801 - RPL_IP_CHARCONV
242 %1 :Client encoding set"
244 %1 client character set
247 III.2 IRC+ failure and error numerics
249 851 - ERR_IP_CHARCONV
250 :Can't initialize client encoding