]> jfr.im git - irc/rqf/shadowircd.git/blame - doc/technical/ts6-protocol.txt
Add description for LOCOPS message.
[irc/rqf/shadowircd.git] / doc / technical / ts6-protocol.txt
CommitLineData
03a905bd
JT
1TS6 protocol description
2Written by Jilles Tjoelker
3
4General format: much like rfc1459
5Maximum parameters for a command: 15 (this does not include the prefix
6and command name)
7
8SID: a server's unique ID. It is configured in each server and consists of
9a digit and two alphanumerics. Sending SIDs with lowercase letters is
10questionable.
11
12UID: a client's unique ID. It consists of the server's SID and six
13alphanumerics (so it is nine characters long). The first of the alphanumerics
14should be a letter, numbers are legal but reserved for future use.
15
16hunted: a parameter type used for various remote requests. From local users,
17nicknames and server names are accepted, possibly with wildcards; from servers,
18UIDs/SIDs (sending names or even wildcards is deprecated). This is done with
19the function hunt_server(). Any rate limiting should be done locally.
20
21duration: a parameter type used for ban durations. It is a duration in seconds.
22A value of 0 means a permanent ban.
23
24propagation: to which other servers the command is sent. For all commands
25with a hunted parameter, the propagation is determined by that, and not
26otherwise specified. Propagation broadcast means the command is sent to all
27servers. Propagation one-to-one means the command is only sent to the target
28or the server the target is on. Propagation none means the command is never
29sent to another server if it is received. For some other commands, the
30propagation depends on the parameters and is described in text.
31
32services server: server mentioned in a service{} block. There are no services
33servers on EFnet.
34
35service: client with umode +S. This implies that it is on a services server.
36
dc83edfa
JT
37connection setup:
38The initiator sends the PASS, CAPAB and SERVER messages. Upon receiving the
39SERVER, the listener will check the information, and if it is valid, it will
40send its own PASS, CAPAB and SERVER messages, followed by SVINFO and the burst.
41Upon receiving the SERVER, the initiator will send SVINFO and the burst. If
42ziplinks are used, SVINFO is the first compressed message.
43
44The burst consists of SID and SERVER messages for all known servers, UID or
45EUID messages for all known users (possibly followed by ENCAP REALHOST, ENCAP
46LOGIN and/or AWAY) and SJOIN messages for all known channels (possibly followed
47by BMASK and/or TB).
48
03a905bd
JT
49user modes:
50(all)
51+D (deaf: does not receive channel messages)
52+S (network service) (only settable on burst from a services server)
53+a (appears as server administrator)
54+i (invisible, see rfc1459)
55+o (IRC operator, see rfc1459)
56+w (wallops, see rfc1459) (always propagated for historical reasons)
57(charybdis TS6)
58+Q/+R/+g/+l/+s/+z (only locally effective)
59+Z (ssl user) (only settable on burst)
60possibly more added by modules
61
62channel modes:
63(all)
64statuses
65+o (prefix @) (ops)
66+v (prefix +) (voice)
67type A
68+b (ban)
69+e (ban exception)
70+I (invite exception)
71type B
72+k (key: password required to join, <= 23 ascii chars, no : or , or whitespace)
73type C
74+l (limit: maximum number of members before further joins are disallowed)
75type D
76+m (moderated)
77+n (no external messages)
78+p (private: does not appear in /whois to non-members, no /knock allowed)
79+r (only registered users may join) (only if a services server exists)
80+s (secret)
81+t (only chanops may change topic)
82(charybdis TS6)
83type A
84+q (quiet)
85type C
86+f (forward: channel name <= 30 chars)
87+j (join throttle: N:T with integer N and T)
88type D
89+F (free target for +f)
90+L (large ban list)
91+P (permanent: does not disappear when empty)
92+Q (ignore forwards to this)
93+c (strip colours)
94+g (allow any member to /invite)
95+z (send messages blocked by +m to chanops)
96
97ADMIN
98source: user
99parameters: hunted
100
101Remote ADMIN request.
102
103AWAY
104source: user
105propagation: broadcast
106parameters: opt. away reason
107
108If the away reason is empty or not present, mark the user as not away.
109Otherwise, mark the user as away.
110
111Changing away reason from one non-empty string to another non-empty string
112may not be propagated.
113
114BMASK
115source: server
116propagation: broadcast
117parameters: channelTS, channel, type, space separated masks
118
119If the channelTS in the message is greater (newer) than the current TS of
120the channel, drop the message and do not propagate it.
121
122Type is the mode letter of a ban-like mode. In efnet TS6 this is 'b', 'e' or
123'I'. In charybdis TS6 additionally 'q' is possible.
124
125Add all the masks to the given list of the channel.
126
127All ban-like modes must be bursted using this command, not using MODE or TMODE.
128
129CAPAB
130source: unregistered server
131propagation: none
132parameters: space separated capability list
133
dc83edfa
JT
134Sends capabilities of the server. This must include QS and ENCAP. It is also
135strongly recommended to include EX, CHW, IE and KNOCK, and for charybdis TS6
136also SAVE and EUID. For use with services, SERVICES and RSFNC are strongly
137recommended.
138
139The capabilities may depend on the configuration for the server they are sent
140to.
03a905bd
JT
141
142CHGHOST
143charybdis TS6
144source: any
145propagation: broadcast
146parameters: client, new hostname
147
148Changes the visible hostname of a client.
149
150Opers are notified unless the source is a server or a service.
151
152CONNECT
153source: any
154parameters: server to connect to, port, hunted
155
156Remote connect request. A server WALLOPS should be sent by the receiving
157server.
158
159The port can be 0 for the default port.
160
161DLINE
162charybdis TS6
163encap only
164source: user
165parameters: duration, mask, reason
166
167Sets a D:line (IP ban checked directly after accepting connection).
168
169The mask must be an IP address or CIDR mask.
170
171ENCAP
172source: any
173parameters: target server mask, subcommand, opt. parameters...
174
175Sends a command to all servers with names matching the given mask (for example
176'*', '*.example.com', 'irc.example.com'). Those servers do not have to be
177directly connected. Targets cannot be SIDs.
178
179Propagation is independent of understanding the subcommand.
180
181ERROR
182source: server or unregistered server
183propagation: none
184parameters: error message
185
186Reports a (usually fatal) error with the connection.
187
188Error messages may contain IP addresses and have a negative effect on server
189IP hiding.
190
191ETRACE
192encap only
193encap target: single server
194source: oper
195parameters: client
196
197Remote ETRACE information request.
198
199EUID
200charybdis TS6
201capab: EUID
202source: server
203parameters: nickname, hopcount, nickTS, umodes, username, visible hostname, IP address, UID, real hostname, account name, gecos
204propagation: broadcast
205
206Introduces a client. The client is on the source server of this command.
207
208The account name is '0' if the user is not logged in with services.
209
210Nick TS rules apply.
211
212EUID is similar to UID but includes the ENCAP REALHOST and ENCAP LOGIN
213information.
214
215GCAP
216encap only
217encap target: *
218source: server
219parameters: space separated capability list
220
221Capability list of remote server.
222
223INFO
224source: user
225parameters: hunted
226
227Remote INFO request.
228
229INVITE
230source: user
231parameters: target user, channel, opt. channelTS
232propagation: one-to-one
233
234Invites a user to a channel.
235
236If the channelTS is greater (newer) than the current TS of the channel, drop
237the message.
238
239Not sending the channelTS parameter is deprecated.
240
241JOIN
2421.
243source: user
244parameters: '0' (one ASCII zero)
245propagation: broadcast
246
247Parts the source user from all channels.
248
2492.
250source: user
251parameters: channelTS, channel, '+' (a plus sign)
252propagation: broadcast
253
254Joins the source user to the given channel. If the channel does not exist yet,
255it is created with the given channelTS and no modes. If the channel already
256exists and has a greater (newer) TS, wipe all simple modes and statuses and
257change the TS, notifying local users of this but not servers (note that
258ban-like modes remain intact; invites may or may not be cleared).
259
260KICK
261source: any
262parameters: channel, target user, opt. reason
263propagation: broadcast
264
265Kicks the target user from the given channel.
266
267Unless the channel's TS is 0, no check is done whether the source user has ops.
268
269Not sending the reason parameter is questionable.
270
271KILL
272source: any
273parameters: target user, path
274propagation: broadcast
275
276Removes the user from the network.
277
278The format of the path parameter is some sort of description of the source of
279the kill followed by a space and a parenthesized reason. To avoid overflow,
280it is recommended not to add anything to the path.
281
282KLINE
2831.
284encap only
285source: user
286parameters: duration, user mask, host mask, reason
287
288Sets a K:line (ban on user@host).
289
2902.
291capab: KLN
292source: user
293parameters: target server mask, duration, user mask, host mask, reason
294
295As form 1, deprecated.
296
297KNOCK
298source: user
299parameters: channel
300propagation: broadcast
301
302Requests an invite to a channel that is locked somehow (+ikl). Notifies all
303operators of the channel. (In charybdis, on +g channels all members are
304notified.)
305
306This is broadcast so that each server can store when KNOCK was used last on
307a channel.
308
309LINKS
310source: user
311parameters: hunted, server mask
312
313Remote LINKS request. The server mask limits which servers are listed.
314
640b57ec
JT
315LOCOPS
3161.
317encap only
318source: user
319parameters: text
320
321Sends a message to operators (with umode +l set). This is intended to be
322used for strict subsets of the network.
323
3242.
325capab: CLUSTER
326source: user
327parameters: target server mask, text
328
329As form 1, deprecated.
330
03a905bd
JT
331LOGIN
332encap only
333source: user
334parameters: account name
335
336In a burst, states that the source user is logged in as the account.
337
338LUSERS
339source: user
340parameters: server mask, hunted
341
342Remote LUSERS request. Most servers ignore the server mask, treating it as '*'.
343
344MODE
3451.
346source: user
347parameters: client, umode changes
348propagation: broadcast
349
350Propagates a user mode change. The client parameter must refer to the same user
351as the source.
352
353Not all umodes are propagated to other servers.
354
3552.
356source: any
357parameters: channel, cmode changes, opt. cmode parameters...
358
359Propagates a channel mode change.
360
361This is deprecated because the channelTS is not included. If it is received,
362it should be propagated as TMODE.
363
364MOTD
365source: user
366parameters: hunted
367
368Remote MOTD request.
369
370NICK
3711.
372source: user
373parameters: new nickname, new nickTS
374propagation: broadcast
375
376Propagates a nick change.
377
3782.
379source: server
380parameters: nickname, hopcount, nickTS, umodes, username, hostname, server, gecos
381
382Historic TS5 user introduction. The user is on the server indicated by the
383server parameter; the source server is meaningless (local link).
384
385NICKDELAY
386charybdis TS6
387encap only
388encap target: *
389source: services server
390parameters: duration, nickname
391
392If duration is greater than 0, makes the given nickname unavailable for that
393time.
394
395If duration is 0, removes a nick delay entry for the given nickname.
396
397There may or may not be a client with the given nickname; this does not affect
398the operation.
399
400NOTICE
401source: any
402parameters: msgtarget, message
403
404As PRIVMSG, except NOTICE messages are sent out, server sources are permitted
405and most error messages are suppressed.
406
407OPERSPY
408encap only
409encap target: *
410source: user
411parameters: command name, parameters
412
413Reports operspy usage.
414
415OPERWALL
416source: user
417parameters: message
418propagation: broadcast
419
420Sends a message to operators (with umode +z set).
421
422PART
423source: user
424parameters: comma separated channel list, message
425
426Parts the source user from the given channels.
427
428PASS
429source: unregistered server
430parameters: password, 'TS', TS version, SID
431
432Sends the server link password, TS version and SID.
433
434PING
435source: any
dc83edfa 436parameters: origin, opt. destination server
03a905bd 437
dc83edfa
JT
438Sends a PING to the destination server, which will reply with a PONG. If the
439destination server parameter is not present, the server receiving the message
440must reply.
03a905bd 441
dc83edfa
JT
442The origin field is not used in the server protocol. It is sent as the name
443(not UID/SID) of the source.
03a905bd
JT
444
445Remote PINGs are used for end-of-burst detection, therefore all servers must
446implement them.
447
448PONG
449source: server
450parameters: origin, destination
451
452Routes a PONG back to the destination that originally sent the PING.
453
454PRIVMSG
455source: user
456parameters: msgtarget, message
457
458Sends a normal message (PRIVMSG) to the given target.
459
460The target can be:
461- a client
462 propagation: one-to-one
463- a channel name
464 propagation: all servers with -D users on the channel
465 (cmode +m/+n should be checked everywhere, bans should not be checked
466 remotely)
467- a status character ('@'/'+') followed by a channel name, to send to users
468 with that status or higher only.
469 propagation: all servers with -D users with appropriate status
470- a user@server message, to send to users on a specific server. The exact
471 meaning of the part before the '@' is not prescribed, except that "opers"
472 allows IRC operators to send to all IRC operators on the server in an
473 unspecified format.
474 propagation: one-to-one
475- a message to all users on server names matching a mask ('$$' followed by mask)
476 propagation: broadcast
477- a message to all users with hostnames matching a mask ('$#' followed by mask).
478 Note that this is often implemented poorly.
479 propagation: broadcast
480
481PRIVS
482charybdis TS6
483encap only
484encap target: single server
485source: oper
486parameters: client
487
488Remote PRIVS information request.
489
490QUIT
491source: user
492parameters: comment
493
494Propagates quitting of a client. No QUIT should be sent for a client that
495has been removed as result of a KILL message.
496
497REALHOST
498charybdis TS6
499encap only
500encap target: *
501source: user
502parameters: real hostname
503
504In a burst, propagates the real host of a dynamically-spoofed user.
505
506REHASH
507charybdis TS6
508encap only
509source: user
510parameters: opt. rehash type
511
512Remote REHASH request. If the rehash type is omitted, it is equivalent to
513a regular /rehash, otherwise it is equivalent to /rehash <rehash type>.
514
515RESV
5161.
517encap only
518source: user
519parameters: duration, mask, reason
520
521Sets a RESV, making a nickname mask or exact channel unavailable.
522
5232.
524capab: CLUSTER
525source: user
526parameters: target server mask, duration, mask, reason
527
528As form 1, deprecated.
529
530RSFNC
531encap only
532capab: RSFNC
533encap target: single server
534source: services server
535parameters: target user, new nickname, old nickTS, new nickTS
536
537Forces a nickname change and propagates it.
538
539The command is ignored if the nick TS of the user is not equal to the old
540nickTS parameter. If the new nickname already exists (and is not the target
541user), it is killed first.
542
543SASL
544charybdis TS6
545encap only
5461.
547encap target: *
548source: server
549parameters: source uid, '*', 'S', sasl mechanism name
550
551Requests that a SASL agent (a service) initiate the authentication process.
552The source uid is that of an unregistered client. This is why it is not sent
553as the prefix.
554
5552.
556encap target: single server
557source: server
558parameters: source uid, target uid, mode, data
559
560Part of a SASL authentication exchange. The mode is 'C' to send some data
561(base64 encoded), or 'S' to end the exchange (data indicates type of
562termination: 'A' for abort, 'F' for authentication failure, 'S' for
563authentication success).
564
565SAVE
566capab: SAVE
567source: server
568propagation: broadcast
569parameters: target uid, TS
570
571Resolve a nick collision by changing a nickname to the UID.
572
573The server should verify that the UID belongs to a registered user, the user
574does not already have their UID as their nick and the TS matches the user's
575nickTS. If not, drop the message.
576
577SAVE should be propagated as a regular NICK change to links without SAVE capab.
578present.
579
580SERVER
5811.
582source: unregistered server
583parameters: server name, hopcount, server description
584
585Registers the connection as a server. PASS and CAPAB must have been sent
586before, SVINFO should be sent afterwards.
587
588If there is no such server configured or authentication failed, the connection
589should be dropped.
590
591This is propagated as a SID message.
592
5932.
594source: server
595propagation: broadcast
596parameters: server name, hopcount, server description
597
598Introduces a new TS5 server, directly connected to the source of this command.
599This is only used for jupes as TS5 servers may do little else than existing.
600
601SID
602source: server
603propagation: broadcast
604parameters: server name, hopcount, sid, server description
605
606Introduces a new server, directly connected to the source of this command.
607
608SIGNON
609source: user
610propagation: broadcast
611parameters: new nickname, new username, new visible hostname, new nickTS, new login name
612
613Broadcasts a change of several user parameters at once.
614
615Currently only sent after an SVSLOGIN.
616
617SJOIN
618source: server
619propagation: broadcast
620parameters: channelTS, simple modes, opt. mode parameters..., nicklist
621
622Broadcasts a channel creation or bursts a channel.
623
624The nicklist consists of users joining the channel, with status prefixes for
625their status ('@+', '@', '+' or ''), for example:
626'@+1JJAAAAAB +2JJAAAA4C 1JJAAAADS'. All users must be behind the source server
627so it is not possible to use this message to force users to join a channel.
628
629The interpretation depends on the channelTS and the current TS of the channel.
630If either is 0, set the channel's TS to 0 and accept all modes. Otherwise, if
631the incoming channelTS is greater (newer), ignore the incoming simple modes
632and statuses and join and propagate just the users. If the incoming channelTS
633is lower (older), wipe all modes and change the TS, notifying local users of
634this but not servers (invites may be cleared). In the latter case, kick on
635split riding may happen: if the key (+k) differs or the incoming simple modes
636include +i, kick all local users, sending KICK messages to servers.
637
638SJOIN must be used to propagate channel creation and in netbursts. For regular
639users joining channels, JOIN must be used. Pseudoservers may use SJOIN to join
640a user with ops.
641
642SNOTE
643charybdis TS6
644encap only
645source: server
646parameters: snomask letter, text
647
648Sends the text as a server notice from the source server to opers with the
649given snomask set.
650
651SQUIT
652parameters: target server, comment
653
654Removes the target server and all servers and users behind it from the network.
655
656If the target server is the receiving server or the local link this came from,
657this is an announcement that the link is being closed.
658
659Otherwise, if the target server is locally connected, the server should send
660a WALLOPS announcing the SQUIT.
661
662STATS
663source: user
664parameters: stats letter, hunted
665
666Remote STATS request. Privileges are checked on the server executing the
667actual request.
668
669SU
670encap only
671encap target: *
672source: services server
673parameters: target user, new login name (optional)
674
675If the new login name is not present or empty, mark the target user as not
676logged in, otherwise mark the target user as logged in as the given account.
677
678SVINFO
679source: server
680propagation: none
681parameters: current TS version, minimum TS version, '0', current time
682
683Verifies TS protocol compatibility and clock. If anything is not in order,
684the link is dropped.
685
686The current TS version is the highest version supported by the source server
687and the minimum TS version is the lowest version supported.
688
689The current time is sent as a TS in the usual way.
690
691SVSLOGIN
692charybdis TS6
693encap only
694encap target: single server
695source: services server
696parameters: target, new nick, new username, new visible hostname, new login name
697
698Sent after successful SASL authentication.
699
700The target is a UID, typically an unregistered one.
701
702Any of the "new" parameters can be '*' to leave the corresponding field
703unchanged. The new login name can be '0' to log the user out.
704
705If the UID is registered on the network, a SIGNON with the changes will be
706broadcast, otherwise the changes will be stored, to be used when registration
707completes.
708
709TB
710source: server
711propagation: broadcast
712parameters:
713
714TIME
715source: user
716parameters: hunted
717
718Remote TIME request.
719
720TMODE
721source: any
722parameters: channelTS, channel, cmode changes, opt. cmode parameters...
723
724Propagates a channel mode change.
725
726If the channelTS is greater (newer) than the current TS of the channel, drop
727the message.
728
729On input, only the limit on parameters per line restricts how many cmode
730parameters can be present. Apart from this, arbitrary modes shall be
731processed. Redundant modes may be dropped. For example, +n-n may be applied and
732propagated as +n-n, -n or (if the channel was already -n) nothing, but not as
733+n.
734
735The parameter for mode -k (removing a key) shall be ignored.
736
737On output, at most ten cmode parameters should be sent; if there are more,
738multiple TMODE messages should be sent.
739
740TOPIC
741source: user
742propagation: broadcast
743
744Propagates a channel topic change. The server may verify that the source has
745ops in the channel.
746
747TRACE
748source: user
7491.
750parameters: hunted
751
752Performs a trace to the target, sending 200 numerics from each server passing
753the message on. The target server sends a description of the target followed
754by a 262 numeric.
755
756TRACE, STATS l and STATS L are the only commands using hunt_server that use the
757hunted parameter for more than just determining which server the command
758should be executed on.
759
7602.
761parameters: target name, hunted
762
763Executes a trace command on the target server. No 200 numerics are sent.
764The target name is a name, not a UID, and should be on the target server.
765
766UID
767source: server
768propagation: broadcast
769parameters: nickname, hopcount, nickTS, umodes, username, visible hostname, IP address, UID, gecos
770propagation: broadcast
771
772Introduces a client. The client is on the source server of this command.
773
774Nick TS rules apply.
775
776UNDLINE
777charybdis TS6
778encap only
779source: user
780parameters: mask
781
782Removes a D:line (IP ban checked directly after accepting connection).
783
784The mask must be an IP address or CIDR mask.
785
786UNKLINE
7871.
788encap only
789source: user
790parameters: user mask, host mask
791
792Removes a K:line (ban on user@host).
793
7942.
795capab: UNKLN
796source: user
797parameters: target server mask, user mask, host mask
798
799As form 1, deprecated.
800
801UNRESV
8021.
803encap only
804source: user
805parameters: mask
806
807Removes a RESV.
808
8092.
810capab: CLUSTER
811source: user
812parameters: target server mask, mask
813
814As form 1, deprecated.
815
816UNXLINE
8171.
818encap only
819source: user
820parameters: mask
821
822Removes an X:line (ban on realname).
823
8242.
825capab: CLUSTER
826source: user
827parameters: target server mask, mask
828
829As form 1, deprecated.
830
831USERS
832source: user
833parameters: hunted
834
835Remote USERS request.
836
837VERSION
838source: any
839parameters: hunted
840
841Remote VERSION request.
842
843WALLOPS
8441.
845source: user
846parameters: message
847propagation: broadcast
848
849In efnet TS6, sends a message to operators (with umode +z set). This is a
850deprecated equivalent to OPERWALL.
851
852In charybdis TS6, sends a message to local users with umode +w set (or possibly
853another indication that WALLOPS messages should be sent), including non-opers.
854
8552.
856source: server
857parameters: message
858propagation: broadcast
859
860Sends a message to local users with umode +w set (or possibly another
861indication that WALLOPS messages should be sent).
862
863In efnet TS6 this may include non-opers, in charybdis TS6 this may only be
864sent to opers.
865
866WHOIS
867source: user
868parameters: hunted, target nick
869
870Remote WHOIS request.
871
872XLINE
8731.
874encap only
875source: user
876parameters: duration, mask, reason
877
878Sets an X:line (ban on realname).
879
8802.
881capab: CLUSTER
882source: user
883parameters: target server mask, duration, mask, reason
884
885As form 1, deprecated.
886
887Local only commands (charybdis 3.1):
888
889ACCEPT
890AUTHENTICATE
891CAP
892CHALLENGE
893CHANTRACE
894CLOSE
895CNOTICE
896CPRIVMSG
897DIE
898GET
899HELP
900ISON
901LIST
03a905bd
JT
902MAP
903MASKTRACE
904MODLIST
905MODLOAD
906MODRELOAD
907MODRESTART
908MODUNLOAD
909MONITOR
910NAMES
911OPER
912POST
913PUT
914RESTART
915SCAN
916SET
917TESTGECOS
918TESTLINE
919TESTMASK
920UHELP
921UNREJECT
922USER
923USERHOST
924WEBIRC
925WHO
926WHOWAS