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