Protocol version 1.2 integrations
[silc.git] / doc / draft-riikonen-silc-commands-04.nroff
1 .pl 10.0i
2 .po 0
3 .ll 7.2i
4 .lt 7.2i
5 .nr LL 7.2i
6 .nr LT 7.2i
7 .ds LF Riikonen
8 .ds RF FORMFEED[Page %]
9 .ds CF
10 .ds LH Internet Draft
11 .ds RH XXX
12 .ds CH
13 .na
14 .hy 0
15 .in 0
16 .nf
17 Network Working Group                                        P. Riikonen
18 Internet-Draft
19 draft-riikonen-silc-commands-04.txt                          XXX
20 Expires: XXX
21
22 .in 3
23
24 .ce 2
25 SILC Commands
26 <draft-riikonen-silc-commands-04.txt>
27
28 .ti 0
29 Status of this Memo
30
31 This document is an Internet-Draft and is in full conformance with   
32 all provisions of Section 10 of RFC 2026.  Internet-Drafts are   
33 working documents of the Internet Engineering Task Force (IETF), its   
34 areas, and its working groups.  Note that other groups may also   
35 distribute working documents as Internet-Drafts.   
36
37 Internet-Drafts are draft documents valid for a maximum of six months   
38 and may be updated, replaced, or obsoleted by other documents at any   
39 time.  It is inappropriate to use Internet-Drafts as reference   
40 material or to cite them other than as "work in progress."   
41
42 The list of current Internet-Drafts can be accessed at   
43 http://www.ietf.org/ietf/1id-abstracts.txt   
44
45 The list of Internet-Draft Shadow Directories can be accessed at   
46 http://www.ietf.org/shadow.html   
47
48 The distribution of this memo is unlimited.  
49
50
51 .ti 0
52 Abstract
53
54 This memo describes the commands used in the Secure Internet Live
55 Conferencing (SILC) protocol, specified in the Secure Internet Live
56 Conferencing, Protocol Specification Internet Draft [SILC1].  The
57 SILC Commands are very important part of the SILC protocol.  Usually
58 the commands are used by SILC clients to manage the SILC session, but
59 also SILC servers may use the commands.  This memo specifies detailed
60 command messages and command reply messages.
61
62
63
64
65
66
67
68
69 .ti 0
70 Table of Contents
71
72 .nf
73 1 Introduction ..................................................  2
74   1.1 Requirements Terminology ..................................  2
75 2 SILC Commands .................................................  2
76   2.1 SILC Commands Syntax ......................................  2
77   2.2 SILC Command Argument Idioms ..............................  2
78   2.3 SILC Commands List ........................................  4
79   2.4 SILC Command Status Payload ............................... 40
80 3 SILC Status Types ............................................. 41
81 4 Security Considerations ....................................... 47
82 5 References .................................................... 47
83 6 Author's Address .............................................. 49
84 Appendix A ...................................................... 49
85
86
87 .ti 0
88 1. Introduction
89
90 This document describes the commands used in the Secure Internet Live
91 Conferencing (SILC) protocol, specified in the Secure Internet Live
92 Conferencing, Protocol Specification Internet Draft [SILC1].  This
93 document specifies detailed command messages and command reply messages.
94
95 Commands are very important part on SILC network especially for client
96 which uses commands to operate on the SILC network.  Commands are used
97 to set nickname, join to channel, change modes and many other things.
98
99 See the [SILC1] for the requirements and the restrictions for the usage
100 of the SILC commands.  The [SILC2] defines the command packet type and
101 the Command Payload which is actually used to deliver the commands and
102 command reply messages.
103
104
105 .ti 0
106 1.1 Requirements Terminology
107
108 The keywords MUST, MUST NOT, REQUIRED, SHOULD, SHOULD NOT, RECOMMENDED, 
109 MAY, and OPTIONAL, when they appear in this document, are to be
110 interpreted as described in [RFC2119].
111
112
113 .ti 0
114 2 SILC Commands
115
116 .ti 0
117 2.1 SILC Commands Syntax
118
119 This section briefly describes the syntax of the command notions
120 in this document.  Every field in command is separated from each
121 other by whitespaces (` ') indicating that each field is independent
122 argument and each argument MUST have own Command Argument Payload.
123 The number of maximum arguments are defined with each command
124 separately.  The Command Argument Payload is described in [SILC2].
125
126 Every command defines specific number for each argument.  Currently,
127 they are defined in ascending order; first argument has number one 
128 (1), second has number two (2) and so on.  This number is set into the
129 Argument Type field in the Command Argument Payload.  This makes it
130 possible to send the arguments in free order as the number MUST be
131 used to identify the type of the argument.  This makes is it also
132 possible to have multiple optional arguments in commands and in
133 command replies.  The number of argument is marked in parentheses
134 before the actual argument.
135
136
137
138 .in 6
139 Example:  Arguments:  (1) <nickname> (2) <username@host>
140 .in 3
141    
142
143 Every command replies with Status Payload.  This payload tells the
144 sender of the command whether the command was completed successfully or
145 whether there was an error.  If error occurred the payload includes the
146 error type.  In the next section the Status Payload is not described 
147 as it is common to all commands and has been described here.  Commands 
148 MAY reply with other arguments as well.  These arguments are command 
149 specific and are described in the next section.
150
151 Example command:
152 .in 6
153
154 EXAMPLE_COMMAND
155
156 .in 8
157 Max Arguments:  3
158     Arguments:  (1) <nickname>[@<server>]  (2) <message>
159                 (3) [<count>]
160
161 The command has maximum of 3 arguments.  However, only first
162 and second arguments are mandatory.
163
164 First argument <nickname> is mandatory but may have optional
165 <nickname@server> format as well.  Second argument is mandatory
166 <message> argument.  Third argument is optional <count> argument.
167
168 The numbers in parentheses are the argument specific numbers
169 that specify the type of the argument in Command Argument Payload.
170 The receiver always knows that, say, argument number two (2) is
171 <message> argument, regardless of the ordering of the arguments in
172 the Command Payload.
173
174 Reply messages to the command:
175
176 Max Arguments:  4
177     Arguments:  (1) <Status Payload>  (2) [<channel list>]
178                 (3) <idle time>       (4) [<away message>]
179
180 This command may reply with maximum of 4 arguments.  However,
181 only the first and third arguments are mandatory.  The numbers
182 in the parentheses have the same meaning as in the upper
183 command sending specification.
184
185 Every command reply with <Status Payload>, it is mandatory 
186 argument for all command replies and for this reason it is not
187 described in the command reply descriptions.
188
189
190
191 Status messages:
192
193     SILC_STATUS_OK
194     SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
195     SILC_STATUS_ERR_NO_SUCH_NICK
196
197 Every command reply also defines set of status message that it
198 may return inside the <Status Payload>.  All status messages
199 are defined in the section 2.3 SILC Command Status Payload
200 The status messages defined with the command are recommendations.
201 It is possible to return other status messages not listes with
202 the command reply definition.
203 .in 3
204
205
206 .ti 0
207 2.2 SILC Command Argument Idioms
208
209 All commands that has an ID as argument (for example <Client ID>) are
210 actually ID Payloads, defined in [SILC2] that includes the type of the
211 ID, length of the ID and the actual ID data.  This way variable length
212 ID's can be sent as arguments.
213
214 All passphrases that may be sent in commands as arguments MUST be
215 UTF-8 [RFC2279] encoded.
216
217 All public keys and certificates that are sent as arguments are actually
218 Public Key Payloads [SILC2].  This way it is possible to send different
219 kind of public keys and certificate types as arguments.
220
221
222 .ti 0
223 2.3 SILC Commands List
224
225 This section lists all SILC commands, however, it is expected that a
226 implementation and especially client implementation has many more
227 commands that has only local affect.  These commands are official
228 SILC commands that has both client and server sides and cannot be
229 characterized as local commands.
230
231 List of all defined commands in SILC follows.
232
233 .in 0
234    0    SILC_COMMAND_NONE
235
236         None.  This is reserved command and MUST NOT be sent.
237
238
239    1    SILC_COMMAND_WHOIS
240
241         Max Arguments:  256
242             Arguments:  (1) [<nickname>[@<server>]]   (2) [<count>]
243                         (3) [<Requested Attributes>]  (4) [<Client ID>]
244                         (n) [...]
245
246         Whois command is used to query various information about specific
247         user.  The user may be requested by their nickname and server name.
248         The query may find multiple matching users as there are no unique
249         nicknames in the SILC.  The <count> option may be given to narrow
250         down the number of accepted results.  If this is not defined there
251         are no limit of accepted results.  The query may also be narrowed
252         down by defining the server name of the nickname.  The <count> is
253         32 bit MSB first order integer.
254
255         It is also possible to search the user by Client ID.  If the 
256         <Client ID> is provided server MUST use it as the search value
257         instead of the <nickname>.  One of the arguments MUST be given.
258         It is also possible to define multiple Client ID's to search
259         multiple users sending only one WHOIS command.  In this case the
260         Client ID's are appended as normal arguments.
261
262         To prevent miss-use of this command wildcards in the nickname
263         or in the server name are not permitted.  It is not allowed
264         to request all users on some server.  The WHOIS requests MUST 
265         be based on explicit nickname request.
266
267         The WHOIS request MUST be always sent to the router by server
268         so that all users are searched.  However, the server still MUST
269         search its locally connected clients.  The router MUST send
270         this command to the server which owns the requested client, if
271         the router is unable to provide all mandatory information about
272         the client.  That server MUST reply to the command.  Server MUST
273         NOT send whois replies to the client until it has received the
274         reply from its router.
275
276         The <Requested Attributes> is defined in [ATTRS] and can be used
277         to request various information about the client.  See Appendix A
278         for definition of using these attributes in SILC.
279
280         Reply messages to the command:
281
282         Max Arguments:  11
283             Arguments:  (1) <Status Payload>       (2) <Client ID> 
284                         (3) <nickname>[@<server>]  (4) <username@host> 
285                         (5) <real name>            (6) [<Channel Payload 
286                                                          list>] 
287                         (7) [<user mode>]          (8) [<idle time>]
288                         (9) [<fingerprint>]        (10) <channel user
289                                                          mode list>
290                         (11) [<Attributes>]
291
292
293         This command may reply with several command reply messages to
294         form a list of results.  In this case the status payload will
295         include STATUS_LIST_START status in the first reply and
296         STATUS_LIST_END in the last reply to indicate the end of the
297         list.  If there are only one reply the status is set to normal
298         STATUS_OK.  If multiple Client IDs was requested then each found
299         and unfound client must cause successful or error reply,
300         respectively.
301
302         The command replies include the Client ID of the nickname,
303         nickname and server name, user name and host name and user's real
304         name.  Client SHOULD process these replies only after the last
305         reply has been received with the STATUS_LIST_END status.  If the
306         <count> option were defined in the query there will be only
307         <count> many replies from the server.
308
309         The server returns the list of channels if the client has
310         joined channels.  In this case the list is list of Channel
311         Payloads.  The Mode Mask in the Channel Payload is the channel's
312         mode.  The list is encoded by adding the Channel Payloads one
313         after the other.  Private and secret channels MUST NOT be sent,
314         except if the sender of this command is on those channels, or
315         the sender is server.  The <channel user mode list> MUST also
316         be sent if client is joined channels.  This list includes 32 bit
317         MSB first order values one after the other and each indicate
318         the user's mode on a channel.  The order of these values MUST
319         be same as the channel order in the <Channel Payload list>.
320
321         The server also returns client's user mode, idle time, and the
322         fingerprint of the client's public key.  The <fingerprint> is the
323         binary hash digest of the public key.  The fingerprint MUST NOT
324         be sent if the server has not verified the proof of possession of
325         the corresponding private key.  Server can do this during the
326         SILC Key Exchange protocol.  The <fingerprint> is SHA1 digest.
327
328         The <Attributes> is the reply to the <Requested Attributes>.
329         See the Appendix A for more information.
330
331         Status messages:
332
333             SILC_STATUS_OK
334             SILC_STATUS_LIST_START
335             SILC_STATUS_LIST_END
336             SILC_STATUS_ERR_NO_SUCH_NICK
337             SILC_STATUS_ERR_NO_SUCH_CLIENT_ID
338             SILC_STATUS_ERR_WILDCARDS
339             SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
340             SILC_STATUS_ERR_TOO_MANY_PARAMS
341
342
343    2    SILC_COMMAND_WHOWAS
344
345         Max Arguments:  2
346             Arguments:  (1) <nickname>[@<server>]  (2) [<count>]
347
348         Whowas.  This command is used to query history information about
349         specific user.  The user may be requested by their nickname and 
350         server name.  The query may find multiple matching users as there
351         are no unique nicknames in the SILC.  The <count> option may be
352         given to narrow down the number of accepted results.  If this
353         is not defined there are no limit of accepted results.  The query
354         may also be narrowed down by defining the server name of the 
355         nickname.  The <count> is 32 bit MSB first order integer.
356
357         To prevent miss-use of this command wildcards in the nickname
358         or in the server name are not permitted.  The WHOWAS requests MUST 
359         be based on specific nickname request.
360
361         The WHOWAS request MUST be always sent to the router by server
362         so that all users are searched.  However, the server still must
363         search its locally connected clients.
364
365         Reply messages to the command:
366
367         Max Arguments:  5
368             Arguments:  (1) <Status Payload>        (2) <Client ID>
369                         (3) <nickname>[@<server>]   (4) <username@host>
370                         (5) [<real name>]
371
372         This command may reply with several command reply messages to form
373         a list of results.  In this case the status payload will include
374         STATUS_LIST_START status in the first reply and STATUS_LIST_END in 
375         the last reply to indicate the end of the list.  If there are only 
376         one reply the status is set to normal STATUS_OK.
377
378         The command replies with nickname and user name and host name.
379         Every server MUST keep history for some period of time of its
380         locally connected clients.
381
382         Status messages:
383
384             SILC_STATUS_OK
385             SILC_STATUS_LIST_START
386             SILC_STATUS_LIST_END
387             SILC_STATUS_ERR_NO_SUCH_NICK
388             SILC_STATUS_ERR_WILDCARDS
389             SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
390             SILC_STATUS_ERR_TOO_MANY_PARAMS
391
392
393    3    SILC_COMMAND_IDENTIFY
394
395         Max Arguments:  256
396             Arguments:  (1) [<nickname>[@<server>]]  (2) [<server name>]
397                         (3) [<channel name>]         (4) [<count>]
398                         (5) [<ID Payload>]           (n) [...]
399
400         Identify command is used to query information about an entity by
401         the entity's name or ID.  This command can be used to query
402         information about clients, server and channels.
403
404         The query may find multiple matching entities.  The <count> option
405         may be given to narrow down the number of accepted results.  If
406         this is not defined there are no limit of accepted results.  The
407         <count> is 32 bit MSB first order integer.
408
409         It is also possible to search the entity by its ID.  If the
410         <ID Payload> is provided server must use it as the search value
411         instead of the entity's name.  One of the arguments must be given.
412         It is also possible to define multiple ID Payloads to search
413         multiple entities sending only one IDENTIFY command.  In this case
414         the ID Payloads are appended as normal arguments.  The type of the
415         entity is defined by the type of the ID Payload.
416
417         To prevent miss-use of this command wildcards in the names are
418         not permitted.  It is not allowed to request for example all users
419         on server.
420
421         Implementations may not want to give interface access to this
422         command as it is hardly a command that would be used by an end
423         user.  However, it must be implemented as it is used with private
424         message sending.
425
426         The IDENTIFY command MUST be always sent to the router by server
427         so that all users are searched.  However, server MUST still search
428         its locally connected clients.
429
430         Reply messages to the command:
431
432         Max Arguments:  4
433             Arguments:  (1) <Status Payload>   (2) <ID Payload>
434                         (3) [<entity's name>]  (4) [<info>]
435
436         This command may reply with several command reply messages to form
437         a list of results.  In this case the status payload will include
438         STATUS_LIST_START status in the first reply and STATUS_LIST_END in 
439         the last reply to indicate the end of the list.  If there are only 
440         one reply the status is set to normal STATUS_OK.  If multiple Client
441         IDs was requested then each found and unfound client must cause
442         successful or error reply, respectively.
443
444         When querying clients the <entity's name> must include the client's
445         nickname in the following format: nickname[@server].  The
446         <info> must include the client's username and host in the following
447         format: username@host.
448
449         When querying servers the <entity's name> must include the server's
450         full name.  The <info> may be omitted.
451
452         When querying channels the <entity's name> must include the
453         channel's name.  The <info> may be omitted.
454
455         If the <count> option were defined in the query there will be only
456         <count> many replies from the server.
457
458         Status messages:
459
460             SILC_STATUS_OK
461             SILC_STATUS_LIST_START
462             SILC_STATUS_LIST_END
463             SILC_STATUS_ERR_NO_SUCH_NICK
464             SILC_STATUS_ERR_NO_SUCH_SERVER
465             SILC_STATUS_ERR_NO_SUCH_CHANNEL
466             SILC_STATUS_ERR_NO_SUCH_CLIENT_ID
467             SILC_STATUS_ERR_NO_SUCH_SERVER_ID
468             SILC_STATUS_ERR_NO_SUCH_CHANNEL_ID
469             SILC_STATUS_ERR_WILDCARDS
470             SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
471             SILC_STATUS_ERR_TOO_MANY_PARAMS
472
473
474    4    SILC_COMMAND_NICK
475
476         Max Arguments:  1
477             Arguments:  (1) <nickname>
478
479         Set/change nickname.  This command is used to set nickname for
480         user.  Nickname MUST NOT include any spaces (` '), non-printable
481         characters, commas (`,') and any wildcard characters.
482
483         When nickname is changed new Client ID is generated.  Server MUST
484         distribute SILC_NOTIFY_TYPE_NICK_CHANGE to local clients on the
485         channels (if any) the client is joined on.  Then it MUST send
486         SILC_PACKET_REPLACE_ID to its primary route to replace the old
487         Client ID with the new one.
488
489         Reply messages to the command:
490
491         Max Arguments:  3
492             Arguments:  (1) <Status Payload>  (2) <New ID Payload>
493                         (3) <nickname>
494
495         This command is replied always with New ID Payload that is
496         generated by the server every time user changes their nickname.
497         Client receiving this payload MUST start using the received
498         Client ID as its current valid Client ID.  The New ID Payload
499         is described in [SILC2].  The <nickname> is the user's new
500         nickname.
501
502         Status messages:
503
504             SILC_STATUS_OK
505             SILC_STATUS_ERR_WILDCARDS
506             SILC_STATUS_ERR_NICKNAME_IN_USE
507             SILC_STATUS_ERR_BAD_NICKNAME
508             SILC_STATUS_ERR_NOT_REGISTERED
509             SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
510             SILC_STATUS_ERR_TOO_MANY_PARAMS
511
512
513    5    SILC_COMMAND_LIST
514
515         Max Arguments:  1
516             Arguments:  (1) [<Channel ID>]
517
518         The list command is used to list channels and their topics on the
519         current server.  If the <Channel ID> parameter is used, only the
520         status of that channel is displayed.  Secret channels are not
521         listed at all.  Private channels are listed with status indicating
522         that the channel is private.  Router MAY reply with all channels
523         it knows about.
524
525         Reply messages to the command:
526
527         Max Arguments:  5
528             Arguments:  (1) <Status Payload>  (2) <Channel ID>
529                         (3) <channel>         (4) [<topic>]
530                         (5) [<user count>]
531
532         This command may reply with several command reply messages to form
533         a list of results.  In this case the status payload will include
534         STATUS_LIST_START status in the first reply and STATUS_LIST_END in 
535         the last reply to indicate the end of the list.  If there are only 
536         one reply the status is set to normal STATUS_OK.
537
538         This command replies with Channel ID, name and the topic of the
539         channel.  If the channel is private channel the <topic> SHOULD
540         include the "*private*" string.
541
542         Status messages:
543
544             SILC_STATUS_OK
545             SILC_STATUS_LIST_START
546             SILC_STATUS_LIST_END
547             SILC_STATUS_ERR_WILDCARDS
548             SILC_STATUS_ERR_NOT_REGISTERED
549             SILC_STATUS_ERR_TOO_MANY_PARAMS
550             SILC_STATUS_ERR_NO_SUCH_CHANNEL_ID
551             SILC_STATUS_ERR_NO_CHANNEL_ID
552             SILC_STATUS_ERR_NO_SUCH_SERVER
553
554
555    6    SILC_COMMAND_TOPIC
556
557         Max Arguments:  2
558             Arguments:  (1) <Channel ID>  (2) [<topic>]
559
560         This command is used to change or view the topic of a channel.
561         The topic for channel <Channel ID> is returned if there is no
562         <topic> given.  If the <topic> parameter is present, the topic
563         for that channel will be changed, if the channel modes permit
564         this action.
565
566         After setting the topic the server MUST send the notify type
567         SILC_NOTIFY_TYPE_TOPIC_SET to its primary router and then to
568         the channel which topic was changed.
569
570         Reply messages to the command:
571
572         Max Arguments:  2
573             Arguments:  (1) <Status Payload>  (2) <Channel ID> 
574                         (3) [<topic>]
575
576         The command may reply with the topic of the channel if it is
577         set.
578
579         Status messages:
580
581             SILC_STATUS_OK
582             SILC_STATUS_ERR_NOT_ON_CHANNEL
583             SILC_STATUS_ERR_WILDCARDS
584             SILC_STATUS_ERR_NOT_REGISTERED
585             SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
586             SILC_STATUS_ERR_NO_SUCH_CHANNEL
587             SILC_STATUS_ERR_NO_SUCH_CHANNEL_ID
588             SILC_STATUS_ERR_NO_CHANNEL_ID
589             SILC_STATUS_ERR_BAD_CHANNEL_ID
590             SILC_STATUS_ERR_TOO_MANY_PARAMS
591             SILC_STATUS_ERR_NO_CHANNEL_PRIV
592
593
594    7    SILC_COMMAND_INVITE
595
596         Max Arguments:  4
597             Arguments:  (1) <Channel ID>       (2) [<Client ID>]
598                         (3) [<adding client>]  (4) [<removing client>]
599
600         This command is used to invite other clients to join to the
601         channel.  The <Client ID> argument is the target client's ID that
602         is being invited.  The <Channel ID> is the Channel ID of the
603         requested channel.  The sender of this command MUST be on the
604         channel.  The server MUST also send the notify type
605         SILC_NOTIFY_TYPE_INVITE to its primary router and then to the
606         client indicated by the <Client ID>.
607
608         The <adding client> and <removing client> can be used to add to
609         and remove from the invite list.  The format of the <adding client>
610         and <removing client> is as follows:
611
612             [<nickname>[@<server>]!][<username>]@[<hostname>]
613
614         When adding to or removing from the invite list the server MUST
615         send the notify type SILC_NOTIFY_TYPE_INVITE to its primary router
616         and MUST NOT send it to the client which was added to the list.
617         The client which executes this command MUST have at least channel
618         operator privileges to be able to add to or remove from the invite
619         list.  The wildcards MAY be used with this command.  If adding or
620         removing more than one client then the lists are an comma (`,')
621         separated.
622
623         Note that the <Client ID> provided MUST be resolved into correct
624         nickname and host name and add to the invite list before sending
625         the notify packet.
626         
627         When this command is given with only <Channel ID> argument then
628         the command merely returns the invite list of the channel.   This
629         command MUST fail if the requested channel does not exist, the
630         requested <Client ID> is already on the channel or if the channel
631         is invite only channel and the caller of this command does not
632         have at least channel operator privileges.
633
634         Reply messages to the command:
635
636         Max Arguments:  3
637             Arguments:  (1) <Status Payload>  (2) <Channel ID>
638                         (3) [<invite list>]
639
640         This command replies with the invite list of the channel if it
641         exists.
642
643         Status messages:
644
645             SILC_STATUS_OK
646             SILC_STATUS_ERR_NOT_REGISTERED
647             SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
648             SILC_STATUS_ERR_TOO_MANY_PARAMS
649             SILC_STATUS_ERR_NO_SUCH_CLIENT_ID
650             SILC_STATUS_ERR_NO_CLIENT_ID
651             SILC_STATUS_ERR_NO_SUCH_CHANNEL_ID
652             SILC_STATUS_ERR_NO_CHANNEL_ID
653             SILC_STATUS_ERR_NOT_ON_CHANNEL
654             SILC_STATUS_ERR_USER_ON_CHANNEL
655             SILC_STATUS_ERR_NO_CHANNEL_PRIV
656             SILC_STATUS_ERR_RESOURCE_LIMIT
657
658
659    8    SILC_COMMAND_QUIT
660
661         Max Arguments:  1
662             Arguments:  (1) [<quit message>]
663
664         This command is used by client to end SILC session.  The server
665         must close the connection to a client which sends this command.
666         if <quit message> is given it will be sent to other clients on
667         channel if the client is on channel when quitting.
668
669         Reply messages to the command:
670
671         This command does not reply anything.
672
673
674     9   SILC_COMMAND_KILL
675
676         Max Arguments:  3
677             Arguments:  (1) <Client ID>         (2) [<comment>]
678                         (3) [<auth payload>]
679
680         This command can be used by SILC operators to remove a client from
681         SILC network.  It also can be used by a normal client to remove
682         its own client from network by providing correct authentication
683         data.
684
685         Router operator killing a client:
686
687         The removing has temporary effects and client may reconnect to
688         SILC network.  The <Client ID> is the client to be removed from SILC.
689         The <comment> argument may be provided to give to the removed client
690         some information why it was removed from the network.  The killer
691         MUST have SILC operator privileges.
692
693         When killing a client the router MUST first send notify type
694         SILC_NOTIFY_TYPE_KILLED to all channels the client has joined.
695         The packet MUST NOT be sent to the killed client on the channels.
696         Then, the router MUST send the same notify type to its primary
697         router.  Finally, the router MUST send the same notify type 
698         directly to the client which was killed.
699
700         Normal client killing by authentication:
701
702         When normal client executes this command the <Client ID> is the
703         destination client to be removed from the network.  The client
704         MUST provide the <auth payload> which includes a digital signature
705         that MUST be verified with the public key of the client indicated
706         by <Client ID>.  The <Client ID> MUST be local client to the server.
707         If the signature verification is successful the server sends
708         SILC_NOTIFY_TYPE_SIGNOFF to network and to the destination client.
709         The SILC_NOTIFY_TYPE_KILLED MUST NOT be used in this case.  If the
710         verification fails the destination client remains in network.
711         The hash function used in <auth payload> computing is SHA1.
712
713         Reply messages to the command:
714
715         Max Arguments:  1
716             Arguments:  (1) <Status Payload>
717
718         This command replies only with Status Payload.
719
720         Status messages:
721
722             SILC_STATUS_OK
723             SILC_STATUS_ERR_WILDCARDS
724             SILC_STATUS_ERR_NOT_REGISTERED
725             SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
726             SILC_STATUS_ERR_TOO_MANY_PARAMS
727             SILC_STATUS_ERR_NO_SUCH_CLIENT_ID
728             SILC_STATUS_ERR_NO_CLIENT_ID
729             SILC_STATUS_ERR_NO_ROUTER_PRIV
730
731
732    10   SILC_COMMAND_INFO
733
734         Max Arguments:  2
735             Arguments:  (1) [<server>]  (2) [<Server ID>]
736
737         This command is used to fetch various information about a server.
738         If <server> argument is specified the command MUST be sent to
739         the requested server.
740
741         If the <Server ID> is specified the server information if fetched
742         by the provided Server ID.  One of the arguments must always be
743         present.
744
745         Reply messages to the command:
746
747         Max Arguments:  4
748             Arguments:  (1) <Status Payload>  (2) <Server ID>
749                         (3) <server name>     (4) <string>
750
751         This command replies with the Server ID of the server and a
752         string which tells the information about the server.
753
754         Status messages:
755
756             SILC_STATUS_OK
757             SILC_STATUS_ERR_WILDCARDS
758             SILC_STATUS_ERR_NOT_REGISTERED
759             SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
760             SILC_STATUS_ERR_TOO_MANY_PARAMS
761             SILC_STATUS_ERR_NO_SUCH_SERVER
762             SILC_STATUS_ERR_NO_SUCH_SERVER_ID
763             SILC_STATUS_ERR_NO_SERVER_ID
764
765
766    11   SILC_COMMAND_STATS
767
768         Max Arguments:  1
769             Arguments:  (1) <Server ID>
770
771         This command is used to fetch various statistical information
772         from the server indicated by <Server ID>, which is the ID of
773         server where sender is connected to.  Server receiving this
774         command MAY also send this further to its router for fetching
775         other cell and network wide statistics to accompany the reply.
776
777         Reply messages to the command:
778
779         Max Arguments:  3
780             Arguments:  (1) <Status Payload>          (2) <Server ID>
781                         (3) [<statistics structure>]
782
783         This command replies with the Server ID of the server and 
784         optional statistics structure which includes 32 bit MSB first
785         ordered integer values to represent various statistical
786         information.  The structure is as follows:
787
788           starttime      - time when server was started
789           uptime         - uptime of the server
790           my clients     - number of locally connected clients
791           my channels    - number of locally created channels
792           my server ops  - number of local server operators
793           my router ops  - number of local router operators
794           cell clients   - number of clients in local cell
795           cell channels  - number of channels in local cell
796           cell servers   - number of servers in local cell
797           clients        - number of client in SILC network
798           channels       - number of channels in SILC network
799           servers        - number of servers in SILC network
800           routers        - number of routers in SILC network
801           server ops     - number of server operators in SILC network
802           router ops     - number of router operators in SILC network
803
804         If some value is unknown it is set to zero (0) value.  The
805         "starttime" is the start time of the server, and is seconds
806         since Epoch (POSIX.1).  The "uptime" is time difference of
807         current time and "starttime" in the server, and is seconds
808         in value.
809
810         Status messages:
811
812             SILC_STATUS_OK
813             SILC_STATUS_ERR_NOT_REGISTERED
814             SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
815             SILC_STATUS_ERR_TOO_MANY_PARAMS
816             SILC_STATUS_ERR_NO_SUCH_SERVER_ID
817             SILC_STATUS_ERR_NO_SUCH_SERVER
818             SILC_STATUS_ERR_NO_SERVER_ID
819
820
821    12   SILC_COMMAND_PING
822
823         Max Arguments:  1
824             Arguments:  (1) <Server ID>
825
826         This command is used by client and server to test the communication
827         channel to its server if one suspects that the communication is not
828         working correctly.  The <Server ID> is the ID of the server the
829         sender is connected to.
830
831         Reply messages to the command:
832
833         Max Arguments:  1
834             Arguments:  (1) <Status Payload>
835
836         This command replies only with Status Payload.  Server returns
837         SILC_STATUS_OK in Status Payload if pinging was successful.
838
839
840
841         Status messages:
842
843             SILC_STATUS_OK
844             SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
845             SILC_STATUS_ERR_TOO_MANY_PARAMS
846             SILC_STATUS_ERR_NO_SERVER_ID
847             SILC_STATUS_ERR_NO_SUCH_SERVER
848             SILC_STATUS_ERR_NOT_REGISTERED
849
850
851    13   SILC_COMMAND_OPER
852
853         Max Arguments:  2
854             Arguments:  (1) <username>  (2) <authentication payload>
855
856         This command is used by normal client to obtain server operator
857         privileges on some server or router.  Note that router operator
858         has router privileges that supersedes the server operator
859         privileges and this does not obtain those privileges.  Client
860         MUST use SILCOPER command to obtain router level privileges.
861
862         The <username> is the username set in the server configurations
863         as operator.  The <authentication payload> is the data that the
864         client is authenticated against.  It may be passphrase prompted
865         for user on client's screen or it may be public key authentication
866         based on digital signatures.  The public key used to verify the
867         signature should be locally saved in the server, and server should
868         not use public key received during the SKE to verify this signature.
869
870         After changing the mode the server MUST send the notify type
871         SILC_NOTIFY_TYPE_UMODE_CHANGE to its primary router.
872
873         Reply messages to the command:
874
875         Max Arguments:  1
876             Arguments:  (1) <Status Payload>
877
878         This command replies only with Status Payload.
879
880         Status messages:
881
882             SILC_STATUS_OK
883             SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
884             SILC_STATUS_ERR_TOO_MANY_PARAMS
885             SILC_STATUS_ERR_NOT_REGISTERED
886             SILC_STATUS_ERR_AUTH_FAILED
887
888
889    14   SILC_COMMAND_JOIN
890
891         Max Arguments:  6
892             Arguments:  (1) <channel>       (2) <Client ID>
893                         (3) [<passphrase>]  (4) [<cipher>]
894                         (5) [<hmac>]        (6) [<founder auth>]
895
896         Join to channel/create new channel.  This command is used to
897         join to a channel.  If the channel does not exist the channel is
898         created.  If server is normal server this command MUST be sent
899         to router which will create the channel.  The channel MAY be
900         protected with passphrase.  If this is the case the passphrase
901         MUST be sent along the join command.
902
903         The name of the <channel> MUST NOT include any spaces (` '),
904         non-printable characters, commas (`,') or any wildcard characters.
905
906         The second argument <Client ID> is the Client ID of the client
907         which is joining to the client.  When client sends this command
908         to the server the <Client ID> MUST be the client's own ID.
909
910         Cipher to be used to secure the traffic on the channel MAY be
911         requested by sending the name of the requested <cipher>.  This
912         is used only if the channel does not exist and is created.  If
913         the channel already exists the cipher set previously for the
914         channel will be used to secure the traffic.  The computed MACs
915         of the channel message are produced by the default HMAC or by
916         the <hmac> provided for the command.
917
918         The <founder auth> is Authentication Payload providing the
919         authentication for gaining founder privileges on the channel
920         when joining the channel.  The client may provide this if it
921         knows that it is the founder of the channel and that the 
922         SILC_CMODE_FOUNDER_AUTH mode is set on the channel.  The server
923         MUST verify whether the client is able to gain the founder
924         privileges the same way as the client had given the
925         SILC_COMMAND_CUMODE command to gain founder privileges.  The
926         client is still able to join the channel even if the founder
927         privileges could not be gained.  The hash function used with
928         the <founder payload> MUST be sha1.
929
930         The server MUST check whether the user is allowed to join to
931         the requested channel.  Various modes set to the channel affect
932         the ability of the user to join the channel.  These conditions
933         are:
934
935             o  The user MUST be invited to the channel if the channel
936                is invite-only channel.
937
938             o  The Client ID/nickname/username/host name MUST NOT match
939                any active bans.
940
941             o  The correct passphrase MUST be provided if passphrase 
942                is set to the channel.
943
944             o  The user count limit, if set, MUST NOT be reached.
945
946         If the client provided correct <founder auth> payload it can
947         override these conditions, except the condition for the passphrase.
948         The correct passphrase MUST be provided even if <founder auth>
949         payload is provided.
950
951         Reply messages to the command:
952
953         Max Arguments:  15
954             Arguments:  (1) <Status Payload>        (2) <channel> 
955                         (3) <Channel ID>            (4) <Client ID>
956                         (5) <channel mode mask>     (6) <created>
957                         (7) [<Channel Key Payload>] (8) [<ban list>]
958                         (9) [<invite list>]         (10) [<topic>]
959                         (11) [<hmac>]               (12) <list count>
960                         (13) <Client ID list>       (14) <client mode list>
961                         (15) [<founder pubkey>]
962
963         This command replies with the channel name requested by the
964         client, channel ID of the channel and topic of the channel
965         if it exists.  The <Client ID> is the Client ID which was joined
966         to the channel.  It also replies with the channel mode mask
967         which tells all the modes set on the channel.  If the
968         channel is created the mode mask is zero (0).  If ban mask
969         and/or invite list is set they are sent as well.
970
971         The <list count>, <Client ID list> and <client mode list> are
972         the clients currently on the channel and their modes on the
973         channel.  The <Client ID list> is formed by adding the ID Payloads
974         one after the other.  The <client mode list> is formed by adding
975         32 bit MSB first order values one after the other.  The <founder
976         pubkey> is the public key (or certificate) of the channel founder.
977
978         Client receives the channel key in the reply message as well
979         inside <Channel Key Payload>.
980
981         Status messages:
982
983             SILC_STATUS_OK
984             SILC_STATUS_ERR_WILDCARDS
985             SILC_STATUS_ERR_NOT_REGISTERED
986             SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
987             SILC_STATUS_ERR_TOO_MANY_PARAMS
988             SILC_STATUS_ERR_BAD_PASSWORD
989             SILC_STATUS_ERR_CHANNEL_IS_FULL
990             SILC_STATUS_ERR_NOT_INVITED
991             SILC_STATUS_ERR_BANNED_FROM_CHANNEL
992             SILC_STATUS_ERR_BAD_CHANNEL
993             SILC_STATUS_ERR_USER_ON_CHANNEL
994
995
996    15   SILC_COMMAND_MOTD
997
998         Max Arguments:  1
999             Arguments:  (1) <server>
1000
1001         This command is used to query the Message of the Day of the server.
1002
1003         Reply messages to the command:
1004
1005         Max Arguments:  3
1006             Arguments:  (1) <Status Payload>  (2) <Server ID>
1007                         (3) [<motd>]
1008
1009         This command replies with the motd message if it exists.
1010
1011         Status messages:
1012
1013             SILC_STATUS_OK
1014             SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
1015             SILC_STATUS_ERR_TOO_MANY_PARAMS
1016             SILC_STATUS_ERR_NOT_REGISTERED
1017             SILC_STATUS_ERR_NO_SUCH_SERVER
1018
1019
1020    16   SILC_COMMAND_UMODE
1021
1022         Max Arguments:  2
1023             Arguments:  (1) <Client ID>  (2) [<client mode mask>]
1024
1025         This command is used by client to set/unset modes for itself.
1026         However, there are some modes that the client MUST NOT set itself,
1027         but they will be set by server.  However, client MAY unset any
1028         mode.  Modes may be masked together ORing them thus having
1029         several modes set.  Client MUST keep its client mode mask
1030         locally so that the mode setting/unsetting would work without
1031         problems.  Client may change only its own modes.
1032
1033         After changing the mode server MUST send the notify type
1034         SILC_NOTIFY_TYPE_UMODE_CHANGE to its primary router.
1035
1036         The following client modes are defined:
1037
1038            0x00000000    SILC_UMODE_NONE
1039
1040               No specific mode for client.  This is the initial
1041               setting when new client is created.  The client is
1042               normal client and is present in the network.
1043
1044
1045            0x00000001    SILC_UMODE_SERVER_OPERATOR
1046
1047               Marks the user as server operator.  Client MUST NOT
1048               set this mode itself.  Server sets this mode to the
1049               client when client attains the server operator
1050               privileges by SILC_COMMAND_OPER command.  Client
1051               MAY unset the mode itself.
1052
1053
1054            0x00000002    SILC_UMODE_ROUTER_OPERATOR
1055
1056               Marks the user as router (SILC) operator.  Client
1057               MUST NOT set this mode itself.  Router sets this mode
1058               to the client when client attains the router operator
1059               privileges by SILC_COMMAND_SILCOPER command.  Client
1060               MAY unset the mode itself.
1061
1062
1063            0x00000004    SILC_UMODE_GONE
1064
1065               Marks that the user is not currently present in the
1066               SILC Network.  Client MAY set and unset this mode.
1067
1068
1069            0x00000008    SILC_UMODE_INDISPOSED
1070
1071               Marks that the user is currently indisposed and may
1072               not be able to receive any messages, and that user may
1073               not be present in the network.  Client MAY set and
1074               unset this mode.
1075
1076
1077            0x00000010    SILC_UMODE_BUSY
1078
1079               Marks that the user is currently busy and may not
1080               want to receive any messages, and that user may not
1081               be present in the network.  Client MAY set and unset
1082               this mode.
1083
1084
1085            0x00000020    SILC_UMODE_PAGE
1086
1087               User is not currently present or is unable to receive
1088               messages, and prefers to be paged in some mechanism
1089               if the user needs to be reached.  Client MAY set and
1090               unset this mode.
1091
1092
1093            0x00000040    SILC_UMODE_HYPER
1094
1095               Marks that the user is hyper active and is eager to
1096               receive and send messages.   Client MAY set and unset
1097               this mode.
1098
1099
1100            0x00000080    SILC_UMODE_ROBOT
1101
1102               Marks that the client is actually a robot program.
1103               Client MAY set and unset this mode.
1104
1105
1106            0x00000100    SILC_UMODE_ANONYMOUS
1107
1108               Marks that the client is anonymous client.  Server
1109               that specifically is designed for anonymous services
1110               can set and unset this mode.  Client MUST NOT set or
1111               unset this mode itself.  A client with this mode set
1112               would have the username and the hostname information
1113               scrambled by the server which set this mode.
1114
1115
1116            0x00000200    SILC_UMODE_BLOCK_PRIVMSG
1117
1118               Marks that the client wishes to block private
1119               messages sent to the client, unless the Private
1120               Message Key flag is set in the SILC packet header.
1121               If this mode is set server MUST NOT deliver private
1122               messages to the client without the Private Message
1123               Key flag being set.  The Private Message Key flag set
1124               indicates that the private message is protected with
1125               a key shared between the sender and the recipient.
1126
1127               A separate service could provide additional filtering
1128               features for accepting private messages from certain
1129               sender.  However, this document does not specify such
1130               service.
1131
1132               The client MAY set and unset this mode.
1133
1134
1135            0x00000400    SILC_UMODE_DETACHED
1136
1137               Marks that the client is detached from the SILC network.
1138               This means that the actual network connection to the
1139               client is lost but the client entry is still valid.  The
1140               detached client can be resumed at a later time.  This
1141               mode MUST NOT be set by client.  It can only be set when
1142               client has issued command SILC_COMMAND_DETACH.  The server
1143               sets this mode.  This mode cannot be unset with this
1144               command.  It is unset when the client is resuming back to
1145               the network and SILC_PACKET_RESUME_CLIENT packet is
1146               received.
1147
1148               This flag MUST NOT be used to determine whether a packet
1149               can be sent to the client or not.  Only the server that
1150               had the original client connection can make the decision
1151               by knowing that the network connection is not active.
1152               In this case the default case is to discard the packet.
1153
1154
1155            0x00000800    SILC_UMODE_REJECT_WATCHING
1156
1157               Marks that the client rejects that it could be watched
1158               by someone else.  If this mode is set notifications about
1159               this client is not send, even if someone is watching the
1160               same nickname this client has.  Client MAY set and unset
1161               this mode.  Any changes for this client MUST NOT be
1162               notified to any watcher when this mode is set.
1163
1164               A separate service could provide additional filtering
1165               features for rejecting and accepting the watching from
1166               certain users.  However, this document does not specify
1167               such service.
1168
1169
1170            0x00001000    SILC_UMODE_BLOCK_INVITE
1171
1172               Marks that the client wishes to block incoming invite
1173               notifications.  Client MAY set and unset this mode.
1174               When set server does not deliver invite notifications
1175               to the client.  Note that this mode may make it harder
1176               to join invite-only channels.
1177
1178         If the <client mode mask> was not provided this command merely
1179         returns the mode mask to the client.
1180
1181
1182         Reply messages to the command:
1183
1184         Max Arguments:  2
1185             Arguments:  (1) <Status Payload>  (2) <client mode mask>
1186
1187         This command replies with the changed client mode mask that
1188         the client MUST to keep locally.
1189
1190
1191         Status messages:
1192
1193             SILC_STATUS_OK
1194             SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
1195             SILC_STATUS_ERR_TOO_MANY_PARAMS
1196             SILC_STATUS_ERR_NOT_REGISTERED
1197             SILC_STATUS_ERR_NO_SUCH_CLIENT_ID
1198             SILC_STATUS_ERR_BAD_CLIENT_ID
1199             SILC_STATUS_ERR_NOT_YOU
1200             SILC_STATUS_ERR_PERM_DENIED
1201             SILC_STATUS_ERR_UNKNOWN_MODE
1202             SILC_STATUS_ERR_NO_CLIENT_ID
1203
1204
1205    17   SILC_COMMAND_CMODE
1206
1207         Max Arguments:  7
1208             Arguments:  (1) <Channel ID>      (2) [<channel mode mask>]
1209                         (3) [<user limit>]    (4) [<passphrase>]
1210                         (5) [<cipher>]        (6) [<hmac>]
1211                         (7) [<auth payload>]
1212
1213         This command is used by client to set or change channel flags on
1214         a channel.  Channel has several modes that set various properties
1215         of a channel.  Modes may be masked together by ORing them thus
1216         having several modes set.  The <Channel ID> is the ID of the
1217         target channel.  The client changing channel mode MUST be on
1218         the same channel and posses sufficient privileges to be able to
1219         change the mode.
1220
1221         When the mode is changed SILC_NOTIFY_TYPE_CMODE_CHANGE notify
1222         type MUST be distributed to the channel.
1223
1224         The following channel modes are defined:
1225
1226            0x00000000    SILC_CMODE_NONE
1227
1228               No specific mode on channel.  This is the default when
1229               channel is created.  This means that channel is just plain
1230               normal channel.
1231
1232
1233            0x00000001    SILC_CMODE_PRIVATE
1234
1235               Channel is private channel.  Private channels are shown
1236               in the channel list listed with SILC_COMMAND_LIST command
1237               with indication that the channel is private.  Also,
1238               client on private channel will no be detected to be on
1239               the channel as the channel is not shown in the client's
1240               currently joined channel list.  Channel founder and 
1241               channel operator MAY set/unset this mode.
1242
1243               Typical implementation would use [+|-]p on user interface
1244               to set/unset this mode.
1245
1246
1247            0x00000002    SILC_CMODE_SECRET
1248
1249               Channel is secret channel.  Secret channels are not shown
1250               in the list listed with SILC_COMMAND_LIST command.  Secret
1251               channels can be considered to be invisible channels.
1252               Channel founder and channel operator MAY set/unset this
1253               mode.
1254
1255               Typical implementation would use [+|-]s on user interface
1256               to set/unset this mode.
1257
1258
1259            0x00000004    SILC_CMODE_PRIVKEY
1260
1261               Channel uses private channel key to protect the traffic
1262               on the channel.  When this mode is set the client will be
1263               responsible to set the key it wants to use to encrypt and
1264               decrypt the traffic on channel.  Server generated channel
1265               keys are not used at all.  This mode provides additional
1266               security as clients on channel may agree to use private
1267               channel key that even servers do not know.  Naturally,
1268               this requires that every client on the channel knows
1269               the key before hand (it is considered to be pre-shared-
1270               key).  The key material is RECOMMENDED to be processed
1271               as stated in the [SILC3] in the section Processing the
1272               Key Material.
1273
1274               As it is local setting it is possible to have several
1275               private channel keys on one channel.  In this case several
1276               clients can talk on same channel but only those clients
1277               that share the key with the message sender will be able
1278               to hear the talking.  Client SHOULD NOT display those
1279               message for the end user that it is not able to decrypt
1280               when this mode is set.
1281
1282               Only channel founder MAY set/unset this mode.  If this
1283               mode is unset the server will distribute new channel
1284               key to all clients on the channel which will be used
1285               thereafter.
1286
1287               Typical implementation would use [+|-]k on user interface
1288               to set/unset this mode.
1289
1290
1291            0x00000008    SILC_CMODE_INVITE
1292
1293               Channel is invite only channel.  Client may join to this
1294               channel only if it is invited to the channel.  Channel
1295               founder and channel operator MAY set/unset this mode.
1296
1297               Typical implementation would use [+|-]i on user interface
1298               to set/unset this mode.
1299
1300
1301            0x00000010    SILC_CMODE_TOPIC
1302
1303               The topic of the channel may only be set by client that
1304               is channel founder or channel operator.  Normal clients
1305               on channel will not be able to set topic when this mode
1306               is set.  Channel founder and channel operator MAY set/
1307               unset this mode.
1308
1309               Typical implementation would use [+|-]t on user interface
1310               to set/unset this mode.
1311
1312
1313            0x00000020    SILC_CMODE_ULIMIT
1314
1315               User limit has been set to the channel.  New clients
1316               may not join to the channel when the limit set is
1317               reached.  Channel founder and channel operator MAY set/
1318               unset the limit.  The <user limit> argument is the
1319               number of limited users.
1320
1321               Typical implementation would use [+|-]l on user interface
1322               to set/unset this mode.
1323
1324
1325            0x00000040    SILC_CMODE_PASSPHRASE
1326
1327               Passphrase has been set to the channel.  Client may
1328               join to the channel only if it is able to provide the
1329               correct passphrase.  Setting passphrases to channel
1330               is entirely safe as all commands are protected in the
1331               SILC network.  Only channel founder MAY set/unset
1332               the passphrase.  The <passphrase> argument is the
1333               set passphrase.
1334
1335               Typical implementation would use [+|-]a on user interface
1336               to set/unset this mode.
1337
1338
1339            0x00000080    SILC_CMODE_CIPHER
1340
1341               Sets specific cipher to be used to protect channel
1342               traffic.  The <cipher> argument is the requested cipher.
1343               When set or unset the server must re-generate new
1344               channel key.  Only channel founder MAY set the cipher of 
1345               the channel.  When unset the new key is generated using
1346               default cipher for the channel.
1347
1348               Typical implementation would use [+|-]c on user interface
1349               to set/unset this mode.
1350
1351
1352            0x00000100    SILC_CMODE_HMAC
1353
1354               Sets specific hmac to be used to compute the MACs of the
1355               channel message.  The <hmac> argument is the requested hmac.
1356               Only channel founder may set the hmac of the channel.
1357
1358               Typical implementation would use [+|-]h on user interface
1359               to set/unset this mode.
1360
1361
1362            0x00000200    SILC_CMODE_FOUNDER_AUTH
1363
1364               Channel founder may set this mode to be able to regain
1365               channel founder rights even if the client leaves the 
1366               channel.  The <auth payload> is the Authentication Payload
1367               consisting of the public key authentication method and the
1368               authentication data for that method.  The passphrase
1369               method cannot be used with this mode.  The server MUST NOT
1370               accept NONE authentication method.  The server does not
1371               save <auth payload> but MUST verify it.  The public key
1372               used to verify the payload is the public key of the
1373               client sending this command.  The mode may be set only
1374               if the <auth payload> was verified successfully.  The
1375               server also MUST save the founder's public key.  The
1376               hash function used with the <auth payload> MUST be sha1.
1377
1378               The public key of the founder is sent in the
1379               SILC_NOTIFY_TYPE_CMODE_CHANGE notify type so that other
1380               routers and servers in the network may save the public key.
1381               This way the founder can reclaim the founder rights back
1382               to the channel from any server in the network.  The founder
1383               rights can be regained by the SILC_CUMODE_FOUNDER channel
1384               user mode, or during joining procedure with the command
1385               SILC_COMMAND_JOIN.
1386
1387               When this channel mode is set the channel also becomes
1388               permanent.  If all clients leave the channel while this
1389               mode is set the channel MUST NOT be destroyed.  The founder
1390               can reclaim the founder mode back on these empty channels
1391               at any time.  Implementations MAY limit the number of how
1392               many channels a user can own.
1393
1394               Typical implementation would use [+|-]f on user interface
1395               to set/unset this mode.
1396
1397
1398            0x00000400    SILC_CMODE_SILENCE_USERS
1399
1400               Channel founder may set this mode to silence normal users
1401               on the channel.  Users with operator privileges are not
1402               affected by this mode.  Messages sent by normal users
1403               are dropped by servers when this mode is set.  This mode
1404               can be used to moderate the channel.  Only channel founder
1405               may set/unset this mode.
1406
1407
1408            0x00000800    SILC_CMODE_SILENCE_OPERS
1409
1410               Channel founder may set this mode to silence operators
1411               on the channel.  When used with SILC_CMODE_SILENCE_USERS
1412               mode this can be used to set the channel in state where only
1413               the founder of the channel may send messages to the channel.
1414               Messages sent by operators are dropped by servers when this
1415               mode is set.  Only channel founder may set/unset this mode.
1416
1417
1418         To make the mode system work, client MUST keep the channel mode
1419         mask locally so that the mode setting and unsetting would work
1420         without problems.  The client receives the initial channel mode
1421         mask when it joins to the channel.  When the mode changes on
1422         channel the server MUST distribute the changed channel mode mask
1423         to all clients on the channel by sending the notify type
1424         SILC_NOTIFY_TYPE_CMODE_CHANGE.  The notify type MUST also be sent
1425         to the server's primary router.  If the <channel mode mask> was
1426         not provided this command merely returns the mode mask to the
1427         client.
1428
1429         Reply messages to the command:
1430
1431         Max Arguments:  3
1432             Arguments:  (1) <Status Payload>  (2) <Channel ID>
1433                         (3) <channel mode mask>
1434
1435         This command replies with the changed channel mode mask that
1436         client MUST keep locally.
1437
1438         Status messages:
1439
1440             SILC_STATUS_OK
1441             SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
1442             SILC_STATUS_ERR_TOO_MANY_PARAMS
1443             SILC_STATUS_ERR_NOT_REGISTERED
1444             SILC_STATUS_ERR_NOT_ON_CHANNEL
1445             SILC_STATUS_ERR_NO_SUCH_CHANNEL_ID
1446             SILC_STATUS_ERR_BAD_CHANNEL_ID
1447             SILC_STATUS_ERR_NO_CHANNEL_ID
1448             SILC_STATUS_ERR_NO_CHANNEL_PRIV
1449             SILC_STATUS_ERR_NO_CHANNEL_FOPRIV
1450             SILC_STATUS_ERR_UNKNOWN_MODE
1451             SILC_STATUS_ERR_NO_SUCH_CLIENT_ID
1452             SILC_STATUS_ERR_AUTH_FAILED
1453
1454
1455    18   SILC_COMMAND_CUMODE
1456
1457         Max Arguments:  4
1458             Arguments:  (1) <Channel ID>    (2) <mode mask>
1459                         (3) <Client ID>     (4) [<auth payload>]
1460
1461         This command is used by client to change channel user modes on
1462         channel.  Users on channel may have some special modes and this
1463         command is used by channel operators to set or change these modes.
1464         The <Channel ID> is the ID of the target channel.  The <mode mask>
1465         is OR'ed mask of modes.  The <Client ID> is the target client.
1466         The client changing channel user modes MUST be on the same channel
1467         as the target client and posses sufficient privileges to be able to
1468         change the mode.
1469
1470         When the mode is changed SILC_NOTIFY_TYPE_CUMODE_CHANGE notify
1471         type is distributed to the channel.
1472
1473         The following channel modes are defined:
1474
1475            0x00000000    SILC_CUMODE_NONE
1476
1477               No specific mode.  This is the normal situation for client.
1478               Also, this is the mode set when removing all modes from
1479               the target client.
1480
1481
1482            0x00000001    SILC_CUMODE_FOUNDER
1483
1484               The client is channel founder of the channel.  Usually this
1485               mode is set only by the server when the channel was created.
1486               However, if the SILC_CMODE_FOUNDER_AUTH channel mode has
1487               been set, the client can claim channel founder privileges
1488               by providing the <auth payload> that the server will use
1489               to authenticate the client.  The public key that server will
1490               use to verify the <auth payload> MUST the same public key
1491               that was saved when the SILC_CMODE_FOUNDER_AUTH channel
1492               mode was set.  The client MAY remove this mode at any time.
1493
1494
1495            0x00000002    SILC_CUMODE_OPERATOR
1496
1497               Sets channel operator privileges on the channel for a
1498               client on the channel.  Channel founder and channel operator
1499               MAY set/unset this mode.  The client MAY remove this mode
1500               at any time.
1501
1502
1503            0x00000004    SILC_CUMODE_BLOCK_MESSAGES
1504
1505               Marks that the client wishes not to receive any channel
1506               messages sent for the channel.  Client MAY set and unset
1507               this mode to itself.  Client MUST NOT set it to anyone else.
1508               When this mode is set server MUST NOT deliver channel
1509               messages to this client.  Other packets such as channel
1510               key packets are still sent to the client.
1511
1512               A separate service could provide additional filtering
1513               features for accepting channel messages from certain
1514               sender.  However, this document does not specify such
1515               service.
1516
1517
1518            0x00000008    SILC_CUMODE_BLOCK_MESSAGES_USERS
1519
1520               Marks that the client wishes not to receive any channel
1521               messages sent from normal users.  Only messages sent by
1522               channel founder or channel operator is accepted.  Client
1523               MAY set and unset this mode to itself.  Client MUST NOT
1524               set it to anyone else.  When this mode is set server MUST
1525               NOT deliver channel messages that are sent by normal users
1526               to this client.
1527
1528               A separate service could provide additional filtering
1529               features for accepting channel messages from certain
1530               sender.  However, this document does not specify such
1531               service.
1532
1533
1534            0x00000010    SILC_CUMODE_BLOCK_MESSAGES_ROBOTS
1535
1536               Marks that the client wishes not to receive any channel
1537               messages sent from robots.  Messages sent by users with
1538               the SILC_UMODE_ROBOT user mode set are not delivered.
1539               Client MAY set and unset this mode to itself.  Client MUST
1540               NOT set it to anyone else.  When this mode is set server
1541               MUST NOT deliver channel messages that are sent by robots
1542               to this client.
1543
1544
1545            0x00000020    SILC_CUMODE_QUIET
1546
1547               Marks that the client cannot talk on the channel.  This
1548               mode can be set by channel operator or channel founder to
1549               some other user that is not operator or founder.  The
1550               target client MUST NOT unset this mode.  When this mode
1551               is set the server MUST drop messages sent by this client
1552               to the channel.
1553
1554
1555         Reply messages to the command:
1556
1557         Max Arguments:  4
1558             Arguments:  (1) <Status Payload>  (2) <channel user mode mask>
1559                         (3) <Channel ID>      (4) <Client ID>
1560
1561         This command replies with the changed channel user mode mask that
1562         client MUST keep locally. The <Channel ID> is the specified
1563         channel.  The <Client ID> is the target client.
1564
1565         Status messages:
1566
1567             SILC_STATUS_OK
1568             SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
1569             SILC_STATUS_ERR_TOO_MANY_PARAMS
1570             SILC_STATUS_ERR_NOT_REGISTERED
1571             SILC_STATUS_ERR_NOT_ON_CHANNEL
1572             SILC_STATUS_ERR_NO_SUCH_CHANNEL_ID
1573             SILC_STATUS_ERR_BAD_CHANNEL_ID
1574             SILC_STATUS_ERR_NO_CHANNEL_ID
1575             SILC_STATUS_ERR_NO_CHANNEL_PRIV
1576             SILC_STATUS_ERR_NO_CHANNEL_FOPRIV
1577             SILC_STATUS_ERR_UNKNOWN_MODE
1578             SILC_STATUS_ERR_NO_SUCH_CLIENT_ID
1579             SILC_STATUS_ERR_AUTH_FAILED
1580
1581
1582    19   SILC_COMMAND_KICK
1583
1584         Max Arguments:  3
1585             Arguments:  (1) <Channel ID>  (2) <Client ID>  
1586                         (3) [<comment>]
1587
1588         This command is used by channel operators to remove a client from
1589         channel.  The <channel> argument is the channel the client to be
1590         removed is on currently.  Note that the "kicker" must be on the same
1591         channel.  If <comment> is provided it will be sent to the removed
1592         client.
1593
1594         After kicking the client the server MUST send the notify type
1595         SILC_NOTIFY_TYPE_KICKED to the channel and to its primary router.
1596         The channel key MUST also be re-generated after kicking, unless
1597         the SILC_CMODE_PRIVKEY mode is set.
1598
1599         Reply messages to the command:
1600
1601         Max Arguments:  1
1602             Arguments:  (1) <Status Payload>
1603
1604         This command replies only with Status Payload.
1605
1606         Status messages:
1607
1608             SILC_STATUS_OK
1609             SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
1610             SILC_STATUS_ERR_TOO_MANY_PARAMS
1611             SILC_STATUS_ERR_NOT_REGISTERED
1612             SILC_STATUS_ERR_NO_SUCH_CHANNEL
1613             SILC_STATUS_ERR_NO_SUCH_CLIENT_ID
1614             SILC_STATUS_ERR_NO_CHANNEL_PRIV
1615             SILC_STATUS_ERR_NO_CLIENT_ID
1616
1617
1618
1619
1620    20   SILC_COMMAND_BAN
1621
1622         Max Arguments:  3
1623             Arguments:  (1) <Channel ID>         (2) [<adding client>]
1624                         (3) [<removing client>]
1625
1626         This command is used to manage the ban list of the channel
1627         indicated by the <Channel ID>.  A client that is banned from
1628         channel is no longer able to join the channel.  The client which
1629         is executing this command MUST have at least channel operator
1630         privileges on the channel.
1631
1632         The <adding client> and <removing client> are used to add to and
1633         remove from the ban list.  The format of the <adding client> and
1634         the <removing client> is of following format:
1635
1636             [<nickname>[@<server>]!][<username>]@[<hostname>]
1637
1638         The server MUST send the notify type SILC_NOTIFY_TYPE_BAN to its
1639         primary router after adding to or removing from the ban list.
1640         The wildcards MAY be used with this command.  If adding or removing
1641         from than one clients then the lists are an comma (`,') separated.
1642
1643         If this command is executed without the ban arguments the command
1644         merely replies with the current ban list.
1645
1646
1647         Reply messages to the command:
1648
1649         Max Arguments:  3
1650             Arguments:  (1) <Status Payload>  (2) <Channel ID>
1651                         (3) [<ban list>]
1652
1653         This command replies with the <Channel ID> of the channel and
1654         the current <ban list> of the channel if it exists.
1655
1656         Status messages:
1657
1658             SILC_STATUS_OK
1659             SILC_STATUS_ERR_NOT_REGISTERED
1660             SILC_STATUS_ERR_TOO_MANY_PARAMS
1661             SILC_STATUS_ERR_NO_SUCH_CHANNEL_ID
1662             SILC_STATUS_ERR_NO_CHANNEL_ID
1663             SILC_STATUS_ERR_NOT_ON_CHANNEL
1664             SILC_STATUS_ERR_NO_CHANNEL_PRIV
1665             SILC_STATUS_ERR_RESOURCE_LIMIT
1666
1667
1668
1669
1670    21   SILC_COMMAND_DETACH
1671
1672         Max Arguments:  0
1673             Arguments:
1674
1675         This command is used to detach from the network.  Client can
1676         send this command to its server to indicate that it will be
1677         detached.  By detaching the client remains in the network but
1678         the actual network connection to the server is closed.  The
1679         client may then later resume the old session back.
1680
1681         When this command is received the server MUST check that the
1682         client is locally connected client, and set the user mode
1683         SILC_UMODE_DETACHED flag.  The SILC_NOTIFY_TYPE_UMODE_CHANGE
1684         MUST be also sent to routers.  The server then sends command
1685         reply to this command and closes the network connection.
1686         The server MUST NOT remove the client from its lists, or send
1687         any signoff notifications for this client.  See the [SILC1]
1688         for detailed information about detaching.
1689
1690         Reply messages to the command:
1691
1692         Max Arguments:  1
1693             Arguments:  (1) <Status Payload>
1694
1695         This command replies only with the status indication.
1696
1697         Status messages:
1698
1699             SILC_STATUS_OK
1700             SILC_STATUS_ERR_NOT_REGISTERED
1701
1702
1703    22   SILC_COMMAND_WATCH
1704
1705         Max Arguments:  3
1706             Arguments:  (1) <Client ID>       (2) [<add nickname>]
1707                         (3) [<del nickname>]
1708
1709         This command is used to set up a watch for <add nickname>
1710         nickname.  When a user in the network appears with the
1711         nickname, or signoffs the network or user's mode is changed
1712         the client which set up the watch will be notified about
1713         this change.  This can be used to watch for certain nicknames
1714         in the network and receive notifications when for example a
1715         friend appears in the network or leaves the network.
1716
1717         The <del nickname> is a nickname that has been previously
1718         added to watch list and is now removed from it.  Notifications
1719         for that nickname will not be delivered anymore.
1720
1721         The <Client ID> is the Client ID of the sender of this command.
1722
1723         The nickname set to watch MUST NOT include any wildcards.
1724         Note also that a nickname may match several users since
1725         nicknames are not unique.  Implementations MAY set limits
1726         for how many nicknames client can watch.
1727
1728         When normal server receives this command from client it
1729         MUST send it to its router.  Router will process the command
1730         and actually keeps the watch list.
1731
1732         Reply messages to the command:
1733
1734         Max Arguments:  1
1735             Arguments:  (1) <Status Payload>
1736
1737         This command replies only with the status indication.
1738
1739         Status messages:
1740
1741             SILC_STATUS_OK
1742             SILC_STATUS_ERR_NOT_REGISTERED
1743             SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
1744             SILC_STATUS_ERR_TOO_MANY_PARAMS
1745             SILC_STATUS_ERR_BAD_NICKNAME
1746             SILC_STATUS_ERR_WILDCARDS
1747             SILC_STATUS_ERR_RESOURCE_LIMIT
1748             SILC_STATUS_ERR_NO_SUCH_NICK
1749             SILC_STATUS_ERR_NICKNAME_IN_USE
1750
1751
1752    23   SILC_COMMAND_SILCOPER
1753
1754         Max Arguments:  2
1755             Arguments:  (1) <username>  (2) <authentication payload>
1756
1757         This command is used by normal client to obtain router operator
1758         privileges (also known as SILC operator) on the router.  Note
1759         that router operator has privileges that supersedes the server
1760         operator privileges.
1761
1762         The <username> is the username set in the server configurations
1763         as operator.  The <authentication payload> is the data that the
1764         client is authenticated against.  It may be passphrase prompted
1765         for user on client's screen or it may be public key or certificate
1766         authentication data (data signed with private key).  The public
1767         key that router will use to verify the signature found in the
1768         payload should be verified.  It is recommended that the public
1769         key is saved locally in the router and router would not use
1770         any public keys received during the SKE.
1771
1772         Difference between router operator and server operator is that
1773         router operator is able to handle cell level properties while
1774         server operator (even on router server) is able to handle only
1775         local properties, such as, local connections and normal server
1776         administration.  The router operator is also able to use the
1777         SILC_COMMAND_KILL command.
1778
1779         After changing the mode server MUST send the notify type
1780         SILC_NOTIFY_TYPE_UMODE_CHANGE to its primary router.
1781
1782         Reply messages to the command:
1783
1784         Max Arguments:  1
1785             Arguments:  (1) <Status Payload>
1786
1787         This command replies only with Status Payload.
1788
1789         Status messages:
1790
1791             SILC_STATUS_OK
1792             SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
1793             SILC_STATUS_ERR_TOO_MANY_PARAMS
1794             SILC_STATUS_ERR_NOT_REGISTERED
1795             SILC_STATUS_ERR_AUTH_FAILED
1796
1797
1798    24   SILC_COMMAND_LEAVE
1799
1800         Max Arguments:  1
1801             Arguments:  (1) <Channel ID>
1802
1803         This command is used by client to leave a channel the client is
1804         joined to. 
1805
1806         When leaving channel the server MUST send the notify type
1807         SILC_NOTIFY_TYPE_LEAVE to its primary router and to the channel.
1808         The channel key MUST also be re-generated when leaving the channel
1809         and distribute it to all clients still currently on the channel.
1810         The key MUST NOT be re-generated if the SILC_CMODE_PRIVKEY mode
1811         is set.
1812
1813         Reply messages to the command:
1814
1815         Max Arguments:  2
1816             Arguments:  (1) <Status Payload>  (2) <Channel ID>
1817
1818         The <Channel ID> is the ID of left channel.
1819
1820         Status messages:
1821
1822             SILC_STATUS_OK
1823             SILC_STATUS_ERR_NOT_REGISTERED
1824             SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
1825             SILC_STATUS_ERR_TOO_MANY_PARAMS
1826             SILC_STATUS_ERR_NO_SUCH_CHANNEL_ID
1827             SILC_STATUS_ERR_BAD_CHANNEL_ID
1828             SILC_STATUS_ERR_NO_CHANNEL_ID
1829
1830
1831    25   SILC_COMMAND_USERS
1832
1833         Max Arguments:  2
1834             Arguments:  (1) [<Channel ID>]  (2) [<channel name>]
1835
1836         This command is used to list user names currently on the requested
1837         channel; either the argument <Channel ID> or the <channel name>. 
1838         One of these arguments must be present.  The server MUST resolve
1839         the joined clients and reply with a lists of users on the channel
1840         and with list of user modes on the channel.
1841
1842         If the requested channel is a private or secret channel, this
1843         command MUST NOT send the list of users, but error is returned
1844         to the sender, except if the sender is on the channel, or the
1845         sender is server.
1846
1847         Reply messages to the command:
1848
1849         Max Arguments:  5
1850             Arguments:  (1) <Status Payload>  (2) <Channel ID>
1851                         (3) <list count>      (4) <Client ID list>
1852                         (5) <client mode list>
1853
1854         This command replies with the Channel ID of the requested channel
1855         Client ID list of the users on the channel and list of their modes.
1856         The Client ID list has Client ID's of all users in the list.  The 
1857         <Client ID list> is formed by adding Client ID's one after another.
1858         The <client mode list> is formed by adding client's user modes on
1859         the channel one after another (4 bytes (32 bits) each).  The <list 
1860         count> of length of 4 bytes (32 bits), tells the number of entries
1861         in the lists.  Both lists MUST have equal number of entries.
1862
1863         Status messages:
1864
1865             SILC_STATUS_OK
1866             SILC_STATUS_ERR_NOT_REGISTERED
1867             SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
1868             SILC_STATUS_ERR_TOO_MANY_PARAMS
1869             SILC_STATUS_ERR_NO_SUCH_CHANNEL_ID
1870             SILC_STATUS_ERR_BAD_CHANNEL_ID
1871             SILC_STATUS_ERR_NO_CHANNEL_ID
1872             SILC_STATUS_ERR_NOT_ON_CHANNEL
1873
1874
1875    26   SILC_COMMAND_GETKEY
1876
1877         Max Arguments:  1
1878             Arguments:  (1) <ID Payload>
1879
1880         This command is used to fetch the public key of the client or
1881         server indicated by the <ID Payload>.  The public key is fetched
1882         from the server where to the client is connected.
1883
1884         Reply messages to the command:
1885
1886         Max Arguments:  3
1887             Arguments:  (1) <Status Payload>      (2) <ID Payload>
1888                         (3) [<Public Key Payload>]
1889
1890         This command replies with the client's or server's ID and with
1891         the <Public Key Payload>.
1892
1893         Status messages:
1894
1895             SILC_STATUS_OK
1896             SILC_STATUS_ERR_NOT_REGISTERED
1897             SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
1898             SILC_STATUS_ERR_TOO_MANY_PARAMS
1899             SILC_STATUS_ERR_NO_SUCH_CLIENT_ID
1900             SILC_STATUS_ERR_NO_SUCH_SERVER_ID
1901
1902
1903    27   SILC_COMMAND_SERVICE
1904
1905         Max Arguments:  256
1906             Arguments:  (1) [<service name>]    (2) [<auth payload>]
1907                         (n) [...]
1908
1909         This command is used to negotiate a service agreement with a
1910         remote server.  If this command is given without arguments it
1911         MAY return the service list, if it is publicly available.  The
1912         <service name> is a service specific identifier, and the
1913         <auth payload> MAY be used to authenticate the requester to the
1914         remote service.  The authentication to a service may be based
1915         on previous agreement with the requester and the service
1916         provider.  The command MAY also take additional service
1917         specific arguments.
1918
1919         This document does not specify any services.  How the services
1920         are configured and put available in a server is also out of
1921         scope of this document.
1922
1923         This command MAY be used by client to start using some service
1924         in a server, but it also MAY be used by server to negotiate
1925         to start using a service in some other server or router.
1926
1927         After the negotiation is done both of the parties need to know
1928         from the service identifier how the service can be used.  The
1929         service can be considered to be a protocol which both of the
1930         parties need to support.
1931
1932         Reply messages to the command:
1933
1934         Max Arguments:  256
1935             Arguments:  (1) <Status Payload>      (2) [<service list>]
1936                         (3) [<service name>]      (n) [...]
1937
1938
1939         This command MAY reply with the <service list> when command is
1940         given without arguments, and the list is a comma separated list
1941         of service identifiers.  The <service name> is the service that
1942         the sender requested and this is provided when the server has
1943         accepted the sender to use the <service name>.  The command
1944         reply MAY also have additional service specific arguments.
1945
1946         Status messages:
1947
1948             SILC_STATUS_OK
1949             SILC_STATUS_ERR_NOT_REGISTERED
1950             SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
1951             SILC_STATUS_ERR_TOO_MANY_PARAMS
1952             SILC_STATUS_ERR_NO_SUCH_SERVICE
1953             SILC_STATUS_ERR_AUTH_FAILED
1954             SILC_STATUS_ERR_PERM_DENIED
1955
1956
1957
1958
1959    28 - 199
1960
1961         Currently undefined commands.
1962
1963
1964    200 - 254
1965
1966         These commands are reserved for private use and will not be defined
1967         in this document.
1968
1969
1970    255  SILC_COMMAND_MAX   
1971
1972         Reserved command.  This must not be sent.
1973 .in 3
1974
1975
1976 .ti 0
1977 2.4 SILC Command Status Payload
1978
1979 Command Status Payload is sent in command reply messages to indicate
1980 the status of the command.  The payload is one of argument in the
1981 command thus this is the data area in Command Argument Payload described
1982 in [SILC2].  The payload is only 2 bytes in length.  The following
1983 diagram represents the Command Status Payload (fields are always in
1984 MSB first order).
1985
1986
1987 .in 21
1988 .nf
1989                      1
1990  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
1991 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1992 |     Status    |     Error     |
1993 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1994 .in 3
1995
1996 .ce
1997 Figure 6:  SILC Command Status Payload
1998
1999
2000 .in 6
2001 o Status (1 byte) - Indicates the status message type,
2002   error, start of list, entry of list or end of list.
2003
2004 o Error (1 byte) - Indicates the error if the Status
2005   field is some list status, which means there are list
2006   of errors.
2007 .in 3
2008
2009 The values in Status and Error fields are set according
2010 the following rules:
2011
2012 .in 6
2013 o If there is single reply and error has not occurred
2014   then Status field includes value SILC_STATUS_OK, and
2015   the Error field MUST be ignored (and set to zero
2016   value).
2017
2018 o If there is single error, then Status field includes
2019   one of the error values, and the Error field MUST be
2020   ignored (and set to zero value).
2021
2022 o If there will be multiple successful command replies
2023   then Status field includes SILC_STATUS_LIST_START, 
2024   SILC_STATUS_LIST_ITEM or SILC_STATUS_LIST_END value,
2025   and Error field is set to SILC_STATUS_OK.
2026
2027 o If there are multiple error replies then Status field
2028   includes SILC_STATUS_LIST_START, SILC_STATUS_LIST_ITEM
2029   or SILC_STATUS_LIST_END value, and the Error field
2030   includes the error value.
2031 .in 3
2032
2033 This way it is possible to send single successful or
2034 single error reply, but also multiple successful and
2035 multiple error replies.  Note that it is possible to
2036 send both list of successful replies and list of error
2037 replies at the same time, however in this case the
2038 list of error replies MUST be sent after the successful
2039 replies.  This way the recipient may ignore the multiple
2040 errors if it wishes to do so.  Also note that in this
2041 case the successful and error replies belong to the
2042 same list.
2043
2044 All Status messages are described in the next section.
2045
2046
2047 .ti 0
2048 3 SILC Status Types
2049
2050 Status messages are returned in SILC protocol in command reply
2051 packet and in notify packet.  The SILC_PACKET_COMMAND_REPLY is
2052 the command reply packet and status types are sent inside the
2053 Status Payload as one of command reply argument, as defined in
2054 previous sections.  For SILC_PACKET_NOTIFY packet they can be sent
2055 as defined in [SILC2] for SILC_NOTIFY_TYPE_ERROR type.  The same
2056 types defined in this section are used in both cases.
2057
2058 When returning status messages in the command reply message they
2059 indicate whether the command was executed without errors.  If error
2060 occurred the status indicates which error occurred.
2061
2062 When sending status messages in SILC_NOTIFY_TYPE_ERROR notify type
2063 they always send some error status.  Usually they are sent to
2064 indicate that error occurred while processing some SILC packet.
2065 Please see the [SILC1] and [SILC2] for more information sending
2066 status types in SILC_NOTIFY_TYPE_ERROR notify.
2067
2068 The Status Types are only numeric values and the receiver must
2069 convert the numeric values into human readable messages if this
2070 is desired in the application.
2071
2072 List of all defined status types:
2073
2074 .in 0
2075    Generic status messages:
2076
2077    0    SILC_STATUS_OK
2078
2079         Ok status.  Everything went Ok.  The status payload maybe
2080         safely ignored in this case.
2081
2082    1    SILC_STATUS_LIST_START
2083
2084         Start of the list.  There will be several command replies and
2085         this reply is the start of the list.
2086
2087    2    SILC_STATUS_LIST_ITEM
2088
2089         Item in the list.  This is one of the item in the list but not the
2090         first or last one.
2091
2092    3    SILC_STATUS_LIST_END
2093
2094         End of the list.  There were several command replies and this
2095         reply is the last of the list.  There won't be other replies
2096         belonging to this list after this one.
2097
2098    4 - 9
2099
2100         Currently undefined and has been reserved for the future.
2101
2102
2103    Error status message:
2104
2105
2106
2107    10   SILC_STATUS_ERR_NO_SUCH_NICK
2108
2109         "No such nickname".  Requested nickname does not exist.
2110
2111    11   SILC_STATUS_ERR_NO_SUCH_CHANNEL
2112
2113         "No such channel".  Requested channel name does not exist.
2114
2115    12   SILC_STATUS_ERR_NO_SUCH_SERVER
2116
2117         "No such server".  Requested server name does not exist.
2118
2119    13   SILC_STATUS_ERR_INCOMPLETE_INFORMATION
2120
2121         "Incomplete registration information".  Information remote
2122         sent was incomplete.
2123
2124    14   SILC_STATUS_ERR_NO_RECIPIENT
2125
2126         "No recipient given".  Command required recipient which was
2127         not provided.
2128
2129    15   SILC_STATUS_ERR_UNKNOWN_COMMAND
2130
2131         "Unknown command".  Command sent to server is unknown by the
2132         server.
2133
2134    16   SILC_STATUS_ERR_WILDCARDS
2135
2136         "Wildcards cannot be used".  Wildcards were provided but they
2137         weren't permitted.
2138
2139    17   SILC_STATUS_ERR_NO_CLIENT_ID
2140
2141         "No Client ID given".  Client ID were expected as command
2142         parameter but were not found.
2143
2144    18   SILC_STATUS_ERR_NO_CHANNEL_ID
2145
2146         "No Channel ID given".  Channel ID were expected as command
2147         parameter but were not found.
2148
2149    19   SILC_STATUS_ERR_NO_SERVER_ID
2150
2151         "No Serve ID given".  Server ID were expected as command
2152         parameter but were not found.
2153
2154    20   SILC_STATUS_ERR_BAD_CLIENT_ID
2155
2156         "Bad Client ID".  Client ID provided were erroneous.
2157
2158    21   SILC_STATUS_ERR_BAD_CHANNEL_ID
2159
2160         "Bad Channel ID".  Channel ID provided were erroneous.
2161
2162    22   SILC_STATUS_ERR_NO_SUCH_CLIENT_ID
2163
2164         "No such Client ID".  Client ID provided does not exist.
2165         The unknown Client ID MUST be provided as next argument
2166         in the reply.
2167
2168    23   SILC_STATUS_ERR_NO_SUCH_CHANNEL_ID
2169
2170         "No such Channel ID".  Channel ID provided does not exist.
2171         The unknown Channel ID MUST be provided as next argument
2172         in the reply.
2173
2174    24   SILC_STATUS_ERR_NICKNAME_IN_USE
2175
2176         "Nickname already exists".  Nickname created could not be 
2177         registered because number of same nicknames were already set to
2178         maximum.  This is not expected to happen in real life but is
2179         possible to occur.
2180
2181    25   SILC_STATUS_ERR_NOT_ON_CHANNEL
2182
2183         "You are not on that channel".  The command were specified for
2184         channel user is not currently on.
2185
2186    26   SILC_STATUS_ERR_USER_NOT_ON_CHANNEL
2187
2188         "They are not on channel".  The requested target client is not
2189         on requested channel.
2190
2191    27   SILC_STATUS_ERR_USER_ON_CHANNEL
2192
2193         "User already on channel".  User were invited on channel they
2194         already are on.
2195
2196    28   SILC_STATUS_ERR_NOT_REGISTERED
2197
2198         "You have not registered".  User executed command that requires
2199         the client to be registered on the server before it may be
2200         executed.
2201
2202    29   SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
2203
2204         "Not enough parameters".  Command requires more parameters
2205         than provided.
2206
2207    30   SILC_STATUS_ERR_TOO_MANY_PARAMS
2208
2209         "Too many parameters".  Too many parameters were provided
2210         for the command.
2211
2212    31   SILC_STATUS_ERR_PERM_DENIED
2213
2214         "Permission denied".  Generic permission denied error status
2215         to indicate disallowed access.
2216
2217    32   SILC_STATUS_ERR_BANNED_FROM_SERVER
2218
2219         "You are banned from this server".  The client tried to register
2220         on server that has explicitly denied this host to connect.
2221
2222    33   SILC_STATUS_ERR_BAD_PASSWORD
2223
2224         "Cannot join channel. Incorrect password".  Password provided for 
2225         channel were not accepted.
2226
2227    34   SILC_STATUS_ERR_CHANNEL_IS_FULL
2228
2229         "Cannot join channel. Channel is full".  The channel is full
2230         and client cannot be joined to it.
2231
2232    35   SILC_STATUS_ERR_NOT_INVITED
2233
2234         "Cannot join channel. You have not been invited".  The channel
2235         is invite only channel and client has not been invited.
2236
2237    36   SILC_STATUS_ERR_BANNED_FROM_CHANNEL
2238
2239         "Cannot join channel. You have been banned".  The client has
2240         been banned from the channel.
2241
2242    37   SILC_STATUS_ERR_UNKNOWN_MODE
2243
2244         "Unknown mode".  Mode provided by the client were unknown to
2245         the server.
2246
2247    38   SILC_STATUS_ERR_NOT_YOU
2248
2249         "Cannot change mode for other users".  User tried to change
2250         someone else's mode.
2251
2252    39   SILC_STATUS_ERR_NO_CHANNEL_PRIV
2253
2254         "Permission denied. You are not channel operator".  Command may 
2255         be executed only by channel operator.
2256
2257    40   SILC_STATUS_ERR_NO_CHANNEL_FOPRIV
2258
2259         "Permission denied. You are not channel founder".  Command may 
2260         be executed only by channel operator.
2261
2262    41   SILC_STATUS_ERR_NO_SERVER_PRIV
2263
2264         "Permission denied. You are not server operator".  Command may
2265         be executed only by server operator.
2266
2267    42   SILC_STATUS_ERR_NO_ROUTER_PRIV
2268
2269         "Permission denied. You are not SILC operator".  Command may be
2270         executed only by router (SILC) operator.
2271
2272    43   SILC_STATUS_ERR_BAD_NICKNAME
2273
2274         "Bad nickname".  Nickname requested contained illegal characters
2275         or were malformed.
2276
2277    44   SILC_STATUS_ERR_BAD_CHANNEL
2278
2279         "Bad channel name".  Channel requested contained illegal characters
2280         or were malformed.
2281
2282    45   SILC_STATUS_ERR_AUTH_FAILED
2283
2284         "Authentication failed".  The authentication data sent as 
2285         argument were wrong and thus authentication failed.
2286
2287    46   SILC_STATUS_ERR_UNKOWN_ALGORITHM
2288
2289         "The algorithm was not supported."  The server does not support the
2290         requested algorithm.
2291
2292    47   SILC_STATUS_ERR_NO_SUCH_SERVER_ID
2293
2294         "No such Server ID".  Server ID provided does not exist.
2295         The unknown Server ID MUST be provided as next argument
2296         in the reply.
2297
2298    48   SILC_STATUS_ERR_RESOURCE_LIMIT
2299
2300         "No more resources available".  This can mean that server cannot
2301         or will not accept something due to resource limitations.
2302
2303    49   SILC_STATUS_ERR_NO_SUCH_SERVICE
2304
2305         "Service does not exist".  Requested service identifier is
2306         unknown.
2307
2308    50   SILC_STATUS_ERR_NOT_AUTHENTICATED
2309
2310         "You have not been authenticated".  Remote connection is not
2311         authenticated even though it is supposed to be.
2312
2313    51   SILC_STATUS_ERR_BAD_SERVER_ID
2314
2315         "Server ID is not valid".  Provided server ID is not valid.
2316
2317    52   SILC_STATUS_ERR_KEY_EXCHANGE_FAILED
2318
2319         "Key exchange failed".  Key Exchange protocol failed.
2320
2321    53   SILC_STATUS_ERR_BAD_VERSION
2322
2323         "Bad version".  Protocol or software version mismatch.
2324
2325    54   SILC_STATUS_ERR_TIMEDOUT
2326
2327         "Operation timed out".  Operation or service request timed
2328         out, and thus was not processed.
2329
2330    55   SILC_STATUS_ERR_UNSUPPORTED_PUBLIC_KEY
2331
2332         "Unsupported public key type".  The public key or certificate
2333         type is not supported in this implementation.
2334
2335    56   SILC_STATUS_ERR_OPERATION_ALLOWED
2336
2337         "Operation is not allowed".  A operation, for example a command,
2338         is not allowed or it's execution is not allowed.
2339
2340 .in 3
2341
2342
2343 .ti 0
2344 4 Security Considerations
2345
2346 Security is central to the design of this protocol, and these security
2347 considerations permeate the specification.  Common security considerations
2348 such as keeping private keys truly private and using adequate lengths for
2349 symmetric and asymmetric keys must be followed in order to maintain the
2350 security of this protocol.
2351
2352
2353 .ti 0
2354 5 References
2355
2356 [SILC1]      Riikonen, P., "Secure Internet Live Conferencing (SILC),
2357              Protocol Specification", Internet Draft, May 2002.
2358
2359 [SILC2]      Riikonen, P., "SILC Packet Protocol", Internet Draft,
2360              May 2002.
2361
2362 [SILC3]      Riikonen, P., "SILC Key Exchange and Authentication 
2363              Protocols", Internet Draft, May 2002.
2364
2365 [IRC]        Oikarinen, J., and Reed D., "Internet Relay Chat Protocol",
2366              RFC 1459, May 1993.
2367
2368 [IRC-ARCH]   Kalt, C., "Internet Relay Chat: Architecture", RFC 2810,
2369              April 2000.
2370
2371 [IRC-CHAN]   Kalt, C., "Internet Relay Chat: Channel Management", RFC
2372              2811, April 2000.
2373
2374 [IRC-CLIENT] Kalt, C., "Internet Relay Chat: Client Protocol", RFC
2375              2812, April 2000.
2376
2377 [IRC-SERVER] Kalt, C., "Internet Relay Chat: Server Protocol", RFC
2378              2813, April 2000.
2379
2380 [SSH-TRANS]  Ylonen, T., et al, "SSH Transport Layer Protocol", 
2381              Internet Draft.
2382
2383 [PGP]        Callas, J., et al, "OpenPGP Message Format", RFC 2440,
2384              November 1998.
2385
2386 [SPKI]       Ellison C., et al, "SPKI Certificate Theory", RFC 2693,
2387              September 1999.
2388
2389 [PKIX-Part1] Housley, R., et al, "Internet X.509 Public Key 
2390              Infrastructure, Certificate and CRL Profile", RFC 2459,
2391              January 1999.
2392
2393 [Schneier]   Schneier, B., "Applied Cryptography Second Edition",
2394              John Wiley & Sons, New York, NY, 1996.
2395
2396 [Menezes]    Menezes, A., et al, "Handbook of Applied Cryptography",
2397              CRC Press 1997.
2398
2399 [OAKLEY]     Orman, H., "The OAKLEY Key Determination Protocol",
2400              RFC 2412, November 1998.
2401
2402 [ISAKMP]     Maughan D., et al, "Internet Security Association and
2403              Key Management Protocol (ISAKMP)", RFC 2408, November
2404              1998.
2405
2406 [IKE]        Harkins D., and Carrel D., "The Internet Key Exchange
2407              (IKE)", RFC 2409, November 1998.
2408
2409 [HMAC]       Krawczyk, H., "HMAC: Keyed-Hashing for Message
2410              Authentication", RFC 2104, February 1997.
2411
2412 [PKCS1]      Kalinski, B., and Staddon, J., "PKCS #1 RSA Cryptography
2413              Specifications, Version 2.0", RFC 2437, October 1998.
2414
2415 [RFC2119]    Bradner, S., "Key Words for use in RFCs to Indicate
2416              Requirement Levels", BCP 14, RFC 2119, March 1997.
2417
2418 [RFC2279]    Yergeau, F., "UTF-8, a transformation format of ISO
2419              10646", RFC 2279, January 1998.
2420
2421 [ATTRS]      Riikonen, P., "User Online Presence and Information
2422              Attributes", Internet Draft, May 2002.
2423
2424
2425 .ti 0
2426 6 Author's Address
2427
2428 .nf
2429 Pekka Riikonen
2430 Snellmaninkatu 34 A 15
2431 70100 Kuopio
2432 Finland
2433
2434 EMail: priikone@iki.fi
2435
2436 This Internet-Draft expires XXX
2437
2438
2439 .ti 0
2440 Appendix A
2441
2442 This appendix defines the usage of the <Requested Attributes> argument in
2443 the SILC_COMMAND_WHOIS command.  The attributes are defined in [ATTRS], 
2444 and may be used to request additional information about the user.  Since
2445 the information that may be requested using the attributes is something 
2446 that server cannot deliver to the sender, it is possible to send the WHOIS
2447 command directly to the destination client whom will then provide the
2448 requested attributes.  This requires the servers to relay the WHOIS
2449 command to the client, and it requires capability for handling the WHOIS
2450 command in the client end.
2451
2452 The <Requested Attributes> MAY include several attributes that are
2453 requested.  The format and encoding of the <Requested Attributes> is as
2454 defined in [ATTRS].  When <Requested Attributes> argument is set the
2455 server MAY process the attributes to see whether it can narrow down
2456 the WHOIS search, for example when searching with a nickname.  The
2457 normal servers MUST process the WHOIS command as normal WHOIS command,
2458 that is to send the command directly to the router.  The router MAY
2459 process the attributes, but it MUST send the command to the server
2460 that owns the requested client.
2461
2462 The server that owns the client and receives the command MUST check
2463 whether the client is detached from the network.  If it is detached,
2464 that is the user mode has the SILC_UMODE_DETACHED mode set, it SHOULD
2465 process the attributes and provide as many of the requested attributes
2466 as possible and then send reply back to the sender.  If the client is
2467 active in the network it MUST send the command to the client for
2468 processing.
2469
2470 The client receiving WHOIS command SHOULD check whether the
2471 <Requested Attributes> argument is set.  If it is not set then the
2472 WHOIS command SHOULD be discarded.  The client processes the requested
2473 attributes and SHOULD reply to each of the requested attribute with
2474 either valid value, or with an indication that the requested attribute
2475 is not known or supported.  This is to be done as defined in [ATTRS].
2476 The client always MUST send a reply to the command when some attributes
2477 were requested.  The client MAY also add additional attributes to the
2478 reply even if they were not requested.  The client MAY also digitally
2479 sign the attributes with ATTRIBUTE_USER_DIGITAL_SIGNATURE as defined
2480 in [ATTRS].  Then the client sends the reply back to the sender of
2481 the command.  The command reply that client assembles does not need
2482 to include any other argument but the <Status Payload> (1), and the
2483 <Attributes> (11).  The server receiving reply from client MUST allow
2484 this sort of command reply for WHOIS command.
2485
2486 The information received from the client MAY be cached in the
2487 server's end.  The caching may be desired for example if the client
2488 can be detached from the network.  This way the server is then able
2489 to provide at least partial information for a requester.  The
2490 server MAY also process the command reply and verify whether the
2491 attributes provided in the reply are actually valid.  If it can do
2492 this, and verify that they indeed are valid values it MAY append
2493 a digital signature at the end of the attributes with the
2494 ATTRIBUTE_SERVER_DIGITAL_SIGNATURE as defined in [ATTRS].  The
2495 server then MUST provide valid WHOIS command reply to the sender
2496 of the command.   Other servers and routers that receive the command
2497 reply en route to the original sender MAY also cache the information.
2498
2499 The client which receives the command reply to the WHOIS command
2500 SHOULD verify the ATTRIBUTE_USER_DIGITAL_SIGNATURE and the
2501 ATTRIBUTE_SERVER_DIGITAL_SIGNATURE if they are provided.