Merge commit 'origin/silc.1.1.branch'
[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 25 November 2002
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                     25 November 2002
20 Expires: 25 April 2003
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 ......................................  4
77   2.2 SILC Command Argument Idioms ..............................  4
78   2.3 SILC Commands List ........................................  4
79   2.4 SILC Command Status Payload ............................... 42
80 3 SILC Status Types ............................................. 43
81 4 Security Considerations ....................................... 49
82 5 References .................................................... 49
83 6 Author's Address .............................................. 51
84 Appendix A ...................................................... 51
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 listed 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, servers 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 most likely used
424         with private 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_NOTIFY_TYPE_NICK_CHANGE notify  to its primary route to 
487         notify about nickname and Client ID change.
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 replies 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) [<add | del>]      (4) [<invite list>]
599
600         This command can be used to invite other clients to join to a
601         channel, and to manage the channel's invite list.  The <Client
602         ID> argument is the target client's ID that is being invited.
603         The <Channel ID> is the Channel ID of the requested channel.
604         The sender of this command MUST be on the channel.  The server
605         MUST also send the notify type SILC_NOTIFY_TYPE_INVITE to its
606         primary router and then to the client indicated by the <Client
607         ID>.
608
609         The <add | del> is an argument of size of 1 byte where 0x00 means
610         adding a client to invite list, and 0x01 means deleting a client
611         from invite list.  The <invite list>, if present, indicates
612         the information to be added to or removed from the invite list.
613         It may include a string for matching clients, public key of a
614         client or Client ID of a client.  The <invite list> format is
615         as follows:
616
617           2 bytes         - Number of arguments in the list
618           variable length - Argument Payloads
619
620         The following Argument Types has been defined for invite list
621         Argument Payloads:
622
623           0x01 - Argument is an invite string of following format:
624
625             [<nickname>[@<server>]!][<username>]@[<hostname or IP/MASK>]
626
627             The <hostname> may also be in format of IP/MASK to indicate
628             a network.
629
630           0x02 - Argument is the public key of a client
631           0x03 - Argument is the Client ID of a client
632
633         If unknown type value is received or there is invalid amount of
634         Argument Payloads present in the list, the command MUST be
635         discarded.  When argument that is to be deleted from the invite
636         list does not exist in the list the argument is ignored.
637
638         When adding to or removing from the invite list the server MUST
639         send the notify type SILC_NOTIFY_TYPE_INVITE to its primary router.
640         The client which executes this command MUST have at least channel
641         operator privileges to be able to add to or remove from the invite
642         list.  The wildcards MAY be used with this command.  When this
643         command is used to invite explicit client with <Client ID> the
644         ID MUST be added to the invite list by the server.
645
646         When this command is given with only <Channel ID> argument then
647         the command merely returns the invite list of the channel.   This
648         command MUST fail if the requested channel does not exist, the
649         requested <Client ID> is already on the channel or if the channel
650         is invite only channel and the caller of this command does not
651         have at least channel operator privileges on the channel.
652
653         Reply messages to the command:
654
655         Max Arguments:  3
656             Arguments:  (1) <Status Payload>  (2) <Channel ID>
657                         (3) [<invite list>]
658
659         This command replies with the invite list of the channel if it
660         exists.
661
662         Status messages:
663
664             SILC_STATUS_OK
665             SILC_STATUS_ERR_NOT_REGISTERED
666             SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
667             SILC_STATUS_ERR_TOO_MANY_PARAMS
668             SILC_STATUS_ERR_NO_SUCH_CLIENT_ID
669             SILC_STATUS_ERR_NO_CLIENT_ID
670             SILC_STATUS_ERR_NO_SUCH_CHANNEL_ID
671             SILC_STATUS_ERR_NO_CHANNEL_ID
672             SILC_STATUS_ERR_NOT_ON_CHANNEL
673             SILC_STATUS_ERR_USER_ON_CHANNEL
674             SILC_STATUS_ERR_NO_CHANNEL_PRIV
675             SILC_STATUS_ERR_RESOURCE_LIMIT
676
677
678    8    SILC_COMMAND_QUIT
679
680         Max Arguments:  1
681             Arguments:  (1) [<quit message>]
682
683         This command is used by client to end SILC session.  The server
684         must close the connection to a client which sends this command.
685         if <quit message> is given it will be sent to other clients on
686         channel if the client is on channel when quitting.
687
688         Reply messages to the command:
689
690         This command does not reply anything.
691
692
693     9   SILC_COMMAND_KILL
694
695         Max Arguments:  3
696             Arguments:  (1) <Client ID>          (2) [<comment>]
697                         (3) [<auth payload>]
698
699         This command can be used by SILC operators to remove a client from
700         SILC network.  It also can be used by a normal client to remove
701         its own client from network by providing correct authentication
702         data.
703
704         Router operator killing a client:
705
706         The removing has temporary effects and client may reconnect to
707         SILC network.  The <Client ID> is the client to be removed from SILC.
708         The <comment> argument may be provided to give to the removed client
709         some information why it was removed from the network.  The killer
710         MUST have SILC operator privileges.
711
712         When killing a client the router MUST first send notify type
713         SILC_NOTIFY_TYPE_KILLED to all channels the client has joined.
714         The packet MUST NOT be sent to the killed client on the channels.
715         Then, the router MUST send the same notify type to its primary
716         router.  Finally, the router MUST send the same notify type 
717         directly to the client which was killed.  The killed client MUST
718         also be removed from the invite lists of joined channels if it
719         is explicitly added in the invite lists.
720
721         Normal client killing by authentication:
722
723         When normal client executes this command the <Client ID> is the
724         destination client to be removed from the network.  The client
725         MUST provide the <auth payload> which includes a digital signature
726         that MUST be verified with the public key of the client indicated
727         by <Client ID>.  The <Client ID> MUST be local client to the server.
728         If the signature verification is successful the server sends
729         SILC_NOTIFY_TYPE_SIGNOFF to network and to the destination client.
730         The SILC_NOTIFY_TYPE_KILLED MUST NOT be used in this case.  If the
731         verification fails the destination client remains in network.
732         The hash function used in <auth payload> computing is SHA1.
733
734         Reply messages to the command:
735
736         Max Arguments:  1
737             Arguments:  (1) <Status Payload>
738
739         This command replies only with Status Payload.
740
741         Status messages:
742
743             SILC_STATUS_OK
744             SILC_STATUS_ERR_WILDCARDS
745             SILC_STATUS_ERR_NOT_REGISTERED
746             SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
747             SILC_STATUS_ERR_TOO_MANY_PARAMS
748             SILC_STATUS_ERR_NO_SUCH_CLIENT_ID
749             SILC_STATUS_ERR_NO_CLIENT_ID
750             SILC_STATUS_ERR_NO_ROUTER_PRIV
751
752
753    10   SILC_COMMAND_INFO
754
755         Max Arguments:  2
756             Arguments:  (1) [<server>]  (2) [<Server ID>]
757
758         This command is used to fetch various information about a server.
759         If <server> argument is specified the command MUST be sent to
760         the requested server.
761
762         If the <Server ID> is specified the server information if fetched
763         by the provided Server ID.  One of the arguments must always be
764         present.
765
766         Reply messages to the command:
767
768         Max Arguments:  4
769             Arguments:  (1) <Status Payload>  (2) <Server ID>
770                         (3) <server name>     (4) <string>
771
772         This command replies with the Server ID of the server and a
773         string which tells the information about the server.
774
775         Status messages:
776
777             SILC_STATUS_OK
778             SILC_STATUS_ERR_WILDCARDS
779             SILC_STATUS_ERR_NOT_REGISTERED
780             SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
781             SILC_STATUS_ERR_TOO_MANY_PARAMS
782             SILC_STATUS_ERR_NO_SUCH_SERVER
783             SILC_STATUS_ERR_NO_SUCH_SERVER_ID
784             SILC_STATUS_ERR_NO_SERVER_ID
785
786
787    11   SILC_COMMAND_STATS
788
789         Max Arguments:  1
790             Arguments:  (1) <Server ID>
791
792         This command is used to fetch various statistical information
793         from the server indicated by <Server ID>, which is the ID of
794         server where sender is connected to.  Server receiving this
795         command MAY also send this further to its router for fetching
796         other cell and network wide statistics to accompany the reply.
797
798         Reply messages to the command:
799
800         Max Arguments:  3
801             Arguments:  (1) <Status Payload>          (2) <Server ID>
802                         (3) [<statistics structure>]
803
804         This command replies with the Server ID of the server and 
805         optional statistics structure which includes 32 bit MSB first
806         ordered integer values to represent various statistical
807         information.  The structure is as follows:
808
809           starttime      - time when server was started
810           uptime         - uptime of the server
811           my clients     - number of locally connected clients
812           my channels    - number of locally created channels
813           my server ops  - number of local server operators
814           my router ops  - number of local router operators
815           cell clients   - number of clients in local cell
816           cell channels  - number of channels in local cell
817           cell servers   - number of servers in local cell
818           clients        - number of client in SILC network
819           channels       - number of channels in SILC network
820           servers        - number of servers in SILC network
821           routers        - number of routers in SILC network
822           server ops     - number of server operators in SILC network
823           router ops     - number of router operators in SILC network
824
825         If some value is unknown it is set to zero (0) value.  The
826         "starttime" is the start time of the server, and is seconds
827         since Epoch (POSIX.1).  The "uptime" is time difference of
828         current time and "starttime" in the server, and is seconds
829         in value.
830
831         Status messages:
832
833             SILC_STATUS_OK
834             SILC_STATUS_ERR_NOT_REGISTERED
835             SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
836             SILC_STATUS_ERR_TOO_MANY_PARAMS
837             SILC_STATUS_ERR_NO_SUCH_SERVER_ID
838             SILC_STATUS_ERR_NO_SUCH_SERVER
839             SILC_STATUS_ERR_NO_SERVER_ID
840
841
842    12   SILC_COMMAND_PING
843
844         Max Arguments:  1
845             Arguments:  (1) <Server ID>
846
847         This command is used by client and server to test the communication
848         channel to its server if one suspects that the communication is not
849         working correctly.  The <Server ID> is the ID of the server the
850         sender is connected to.
851
852         Reply messages to the command:
853
854         Max Arguments:  1
855             Arguments:  (1) <Status Payload>
856
857         This command replies only with Status Payload.  Server returns
858         SILC_STATUS_OK in Status Payload if pinging was successful.
859
860
861
862         Status messages:
863
864             SILC_STATUS_OK
865             SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
866             SILC_STATUS_ERR_TOO_MANY_PARAMS
867             SILC_STATUS_ERR_NO_SERVER_ID
868             SILC_STATUS_ERR_NO_SUCH_SERVER
869             SILC_STATUS_ERR_NOT_REGISTERED
870
871
872    13   SILC_COMMAND_OPER
873
874         Max Arguments:  2
875             Arguments:  (1) <username>  (2) <authentication payload>
876
877         This command is used by normal client to obtain server operator
878         privileges on some server or router.  Note that router operator
879         has router privileges that supersedes the server operator
880         privileges and this does not obtain those privileges.  Client
881         MUST use SILCOPER command to obtain router level privileges.
882
883         The <username> is the username set in the server configurations
884         as operator.  The <authentication payload> is the data that the
885         client is authenticated against.  It may be passphrase prompted
886         for user on client's screen or it may be public key authentication
887         based on digital signatures.  The public key used to verify the
888         signature should be locally saved in the server, and server should
889         not use public key received during the SKE to verify this signature.
890
891         After changing the mode the server MUST send the notify type
892         SILC_NOTIFY_TYPE_UMODE_CHANGE to its primary router.
893
894         Reply messages to the command:
895
896         Max Arguments:  1
897             Arguments:  (1) <Status Payload>
898
899         This command replies only with Status Payload.
900
901         Status messages:
902
903             SILC_STATUS_OK
904             SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
905             SILC_STATUS_ERR_TOO_MANY_PARAMS
906             SILC_STATUS_ERR_NOT_REGISTERED
907             SILC_STATUS_ERR_AUTH_FAILED
908
909
910    14   SILC_COMMAND_JOIN
911
912         Max Arguments:  6
913             Arguments:  (1) <channel>       (2) <Client ID>
914                         (3) [<passphrase>]  (4) [<cipher>]
915                         (5) [<hmac>]        (6) [<founder auth>]
916
917         Join to channel/create new channel.  This command is used to
918         join to a channel.  If the channel does not exist the channel is
919         created.  If server is normal server this command MUST be sent
920         to router which will create the channel.  The channel MAY be
921         protected with passphrase.  If this is the case the passphrase
922         MUST be sent along the join command.
923
924         The name of the <channel> MUST NOT include any spaces (` '),
925         non-printable characters, commas (`,') or any wildcard characters.
926
927         The second argument <Client ID> is the Client ID of the client
928         which is joining to the client.  When client sends this command
929         to the server the <Client ID> MUST be the client's own ID.
930
931         Cipher to be used to secure the traffic on the channel MAY be
932         requested by sending the name of the requested <cipher>.  This
933         is used only if the channel does not exist and is created.  If
934         the channel already exists the cipher set previously for the
935         channel will be used to secure the traffic.  The computed MACs
936         of the channel message are produced by the default HMAC or by
937         the <hmac> provided for the command.
938
939         The <founder auth> is Authentication Payload providing the
940         authentication for gaining founder privileges on the channel
941         when joining the channel.  The client may provide this if it
942         knows that it is the founder of the channel and that the 
943         SILC_CMODE_FOUNDER_AUTH mode is set on the channel.  The server
944         MUST verify whether the client is able to gain the founder
945         privileges the same way as the client had given the
946         SILC_COMMAND_CUMODE command to gain founder privileges.  The
947         client is still able to join the channel even if the founder
948         privileges could not be gained.  The hash function used with
949         the <founder payload> MUST be sha1.
950
951         The server MUST check whether the user is allowed to join to
952         the requested channel.  Various modes set to the channel affect
953         the ability of the user to join the channel.  These conditions
954         are:
955
956             o  The user MUST be invited to the channel if the channel
957                is invite-only channel.
958
959             o  The Client ID/nickname/username/host name/public key
960                MUST NOT match any active bans.
961
962             o  The correct passphrase MUST be provided if passphrase 
963                is set to the channel.
964
965             o  The user count limit, if set, MUST NOT be reached.
966
967         If the client provided correct <founder auth> payload it can
968         override these conditions, except the condition for the passphrase.
969         The correct passphrase MUST be provided even if <founder auth>
970         payload is provided.
971
972         Reply messages to the command:
973
974         Max Arguments:  15
975             Arguments:  (1) <Status Payload>        (2) <channel> 
976                         (3) <Channel ID>            (4) <Client ID>
977                         (5) <channel mode mask>     (6) <created>
978                         (7) [<Channel Key Payload>] (8) [<ban list>]
979                         (9) [<invite list>]         (10) [<topic>]
980                         (11) [<hmac>]               (12) <list count>
981                         (13) <Client ID list>       (14) <client mode list>
982                         (15) [<founder pubkey>]
983
984         This command replies with the channel name requested by the
985         client, channel ID of the channel and topic of the channel
986         if it exists.  The <Client ID> is the Client ID which was joined
987         to the channel.  It also replies with the channel mode mask
988         which tells all the modes set on the channel.  If the
989         channel is created the mode mask is zero (0).  If ban mask
990         and/or invite list is set they are sent as well.
991
992         The <list count>, <Client ID list> and <client mode list> are
993         the clients currently on the channel and their modes on the
994         channel.  The <Client ID list> is formed by adding the ID Payloads
995         one after the other.  The <client mode list> is formed by adding
996         32 bit MSB first order values one after the other.  The <founder
997         pubkey> is the public key (or certificate) of the channel founder.
998
999         Client receives the channel key in the reply message as well
1000         inside <Channel Key Payload>.
1001
1002         Status messages:
1003
1004             SILC_STATUS_OK
1005             SILC_STATUS_ERR_WILDCARDS
1006             SILC_STATUS_ERR_NOT_REGISTERED
1007             SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
1008             SILC_STATUS_ERR_TOO_MANY_PARAMS
1009             SILC_STATUS_ERR_BAD_PASSWORD
1010             SILC_STATUS_ERR_CHANNEL_IS_FULL
1011             SILC_STATUS_ERR_NOT_INVITED
1012             SILC_STATUS_ERR_BANNED_FROM_CHANNEL
1013             SILC_STATUS_ERR_BAD_CHANNEL
1014             SILC_STATUS_ERR_USER_ON_CHANNEL
1015
1016
1017    15   SILC_COMMAND_MOTD
1018
1019         Max Arguments:  1
1020             Arguments:  (1) <server>
1021
1022         This command is used to query the Message of the Day of the server.
1023
1024         Reply messages to the command:
1025
1026         Max Arguments:  3
1027             Arguments:  (1) <Status Payload>  (2) <Server ID>
1028                         (3) [<motd>]
1029
1030         This command replies with the motd message if it exists.
1031
1032         Status messages:
1033
1034             SILC_STATUS_OK
1035             SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
1036             SILC_STATUS_ERR_TOO_MANY_PARAMS
1037             SILC_STATUS_ERR_NOT_REGISTERED
1038             SILC_STATUS_ERR_NO_SUCH_SERVER
1039
1040
1041    16   SILC_COMMAND_UMODE
1042
1043         Max Arguments:  2
1044             Arguments:  (1) <Client ID>  (2) [<client mode mask>]
1045
1046         This command is used by client to set/unset modes for itself.
1047         However, there are some modes that the client MUST NOT set itself,
1048         but they will be set by server.  However, client MAY unset any
1049         mode.  Modes may be masked together ORing them thus having
1050         several modes set.  Client MUST keep its client mode mask
1051         locally so that the mode setting/unsetting would work without
1052         problems.  Client may change only its own modes.
1053
1054         After changing the mode server MUST send the notify type
1055         SILC_NOTIFY_TYPE_UMODE_CHANGE to its primary router.
1056
1057         The following client modes are defined:
1058
1059            0x00000000    SILC_UMODE_NONE
1060
1061               No specific mode for client.  This is the initial
1062               setting when new client is created.  The client is
1063               normal client and is present in the network.
1064
1065
1066            0x00000001    SILC_UMODE_SERVER_OPERATOR
1067
1068               Marks the user as server operator.  Client MUST NOT
1069               set this mode itself.  Server sets this mode to the
1070               client when client attains the server operator
1071               privileges by SILC_COMMAND_OPER command.  Client
1072               MAY unset the mode itself.
1073
1074
1075            0x00000002    SILC_UMODE_ROUTER_OPERATOR
1076
1077               Marks the user as router (SILC) operator.  Client
1078               MUST NOT set this mode itself.  Router sets this mode
1079               to the client when client attains the router operator
1080               privileges by SILC_COMMAND_SILCOPER command.  Client
1081               MAY unset the mode itself.
1082
1083
1084            0x00000004    SILC_UMODE_GONE
1085
1086               Marks that the user is not currently present in the
1087               SILC Network.  Client MAY set and unset this mode.
1088
1089
1090            0x00000008    SILC_UMODE_INDISPOSED
1091
1092               Marks that the user is currently indisposed and may
1093               not be able to receive any messages, and that user may
1094               not be present in the network.  Client MAY set and
1095               unset this mode.
1096
1097
1098            0x00000010    SILC_UMODE_BUSY
1099
1100               Marks that the user is currently busy and may not
1101               want to receive any messages, and that user may not
1102               be present in the network.  Client MAY set and unset
1103               this mode.
1104
1105
1106            0x00000020    SILC_UMODE_PAGE
1107
1108               User is not currently present or is unable to receive
1109               messages, and prefers to be paged in some mechanism
1110               if the user needs to be reached.  Client MAY set and
1111               unset this mode.
1112
1113
1114            0x00000040    SILC_UMODE_HYPER
1115
1116               Marks that the user is hyper active and is eager to
1117               receive and send messages.   Client MAY set and unset
1118               this mode.
1119
1120
1121            0x00000080    SILC_UMODE_ROBOT
1122
1123               Marks that the client is actually a robot program.
1124               Client MAY set and unset this mode.
1125
1126
1127            0x00000100    SILC_UMODE_ANONYMOUS
1128
1129               Marks that the client is anonymous client.  Server
1130               that specifically is designed for anonymous services
1131               can set and unset this mode.  Client MUST NOT set or
1132               unset this mode itself.  A client with this mode set
1133               would have the username and the hostname information
1134               scrambled by the server which set this mode.
1135
1136
1137            0x00000200    SILC_UMODE_BLOCK_PRIVMSG
1138
1139               Marks that the client wishes to block private
1140               messages sent to the client, unless the Private
1141               Message Key flag is set in the SILC packet header.
1142               If this mode is set server MUST NOT deliver private
1143               messages to the client without the Private Message
1144               Key flag being set.  The Private Message Key flag set
1145               indicates that the private message is protected with
1146               a key shared between the sender and the recipient.
1147
1148               A separate service could provide additional filtering
1149               features for accepting private messages from certain
1150               sender.  However, this document does not specify such
1151               service.
1152
1153               The client MAY set and unset this mode.
1154
1155
1156            0x00000400    SILC_UMODE_DETACHED
1157
1158               Marks that the client is detached from the SILC network.
1159               This means that the actual network connection to the
1160               client is lost but the client entry is still valid.  The
1161               detached client can be resumed at a later time.  This
1162               mode MUST NOT be set by client.  It can only be set when
1163               client has issued command SILC_COMMAND_DETACH.  The server
1164               sets this mode.  This mode cannot be unset with this
1165               command.  It is unset when the client is resuming back to
1166               the network and SILC_PACKET_RESUME_CLIENT packet is
1167               received.
1168
1169               This flag MUST NOT be used to determine whether a packet
1170               can be sent to the client or not.  Only the server that
1171               had the original client connection can make the decision
1172               by knowing that the network connection is not active.
1173               In this case the default case is to discard the packet.
1174
1175
1176            0x00000800    SILC_UMODE_REJECT_WATCHING
1177
1178               Marks that the client rejects that it could be watched
1179               by someone else.  If this mode is set notifications about
1180               this client is not send, even if someone is watching the
1181               same nickname this client has.  Client MAY set and unset
1182               this mode.  Any changes for this client MUST NOT be
1183               notified to any watcher when this mode is set.
1184
1185               A separate service could provide additional filtering
1186               features for rejecting and accepting the watching from
1187               certain users.  However, this document does not specify
1188               such service.
1189
1190
1191            0x00001000    SILC_UMODE_BLOCK_INVITE
1192
1193               Marks that the client wishes to block incoming invite
1194               notifications.  Client MAY set and unset this mode.
1195               When set server does not deliver invite notifications
1196               to the client.  Note that this mode may make it harder
1197               to join invite-only channels.
1198
1199         If the <client mode mask> was not provided this command merely
1200         returns the mode mask to the client.
1201
1202
1203         Reply messages to the command:
1204
1205         Max Arguments:  2
1206             Arguments:  (1) <Status Payload>  (2) <client mode mask>
1207
1208         This command replies with the changed client mode mask that
1209         the client MUST to keep locally.
1210
1211
1212         Status messages:
1213
1214             SILC_STATUS_OK
1215             SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
1216             SILC_STATUS_ERR_TOO_MANY_PARAMS
1217             SILC_STATUS_ERR_NOT_REGISTERED
1218             SILC_STATUS_ERR_NO_SUCH_CLIENT_ID
1219             SILC_STATUS_ERR_BAD_CLIENT_ID
1220             SILC_STATUS_ERR_NOT_YOU
1221             SILC_STATUS_ERR_PERM_DENIED
1222             SILC_STATUS_ERR_UNKNOWN_MODE
1223             SILC_STATUS_ERR_NO_CLIENT_ID
1224
1225
1226    17   SILC_COMMAND_CMODE
1227
1228         Max Arguments:  8
1229             Arguments:  (1) <Channel ID>      (2) [<channel mode mask>]
1230                         (3) [<user limit>]    (4) [<passphrase>]
1231                         (5) [<cipher>]        (6) [<hmac>]
1232                         (7) [<auth payload>]  (8) [<founder pubkey>]
1233
1234         This command is used by client to set or change channel flags on
1235         a channel.  Channel has several modes that set various properties
1236         of a channel.  Modes may be masked together by ORing them thus
1237         having several modes set.  The <Channel ID> is the ID of the
1238         target channel.  The client changing channel mode MUST be on
1239         the same channel and posses sufficient privileges to be able to
1240         change the mode.
1241
1242         When the mode is changed SILC_NOTIFY_TYPE_CMODE_CHANGE notify
1243         type MUST be distributed to the channel.
1244
1245         The following channel modes are defined:
1246
1247            0x00000000    SILC_CMODE_NONE
1248
1249               No specific mode on channel.  This is the default when
1250               channel is created.  This means that channel is just plain
1251               normal channel.
1252
1253
1254            0x00000001    SILC_CMODE_PRIVATE
1255
1256               Channel is private channel.  Private channels are shown
1257               in the channel list listed with SILC_COMMAND_LIST command
1258               with indication that the channel is private.  Also,
1259               client on private channel will no be detected to be on
1260               the channel as the channel is not shown in the client's
1261               currently joined channel list.  Channel founder and 
1262               channel operator MAY set/unset this mode.
1263
1264               Typical implementation would use [+|-]p on user interface
1265               to set/unset this mode.
1266
1267
1268            0x00000002    SILC_CMODE_SECRET
1269
1270               Channel is secret channel.  Secret channels are not shown
1271               in the list listed with SILC_COMMAND_LIST command.  Secret
1272               channels can be considered to be invisible channels.
1273               Channel founder and channel operator MAY set/unset this
1274               mode.
1275
1276               Typical implementation would use [+|-]s on user interface
1277               to set/unset this mode.
1278
1279
1280            0x00000004    SILC_CMODE_PRIVKEY
1281
1282               Channel uses private channel key to protect the traffic
1283               on the channel.  When this mode is set the client will be
1284               responsible to set the key it wants to use to encrypt and
1285               decrypt the traffic on channel.  Server generated channel
1286               keys are not used at all.  This mode provides additional
1287               security as clients on channel may agree to use private
1288               channel key that even servers do not know.  Naturally,
1289               this requires that every client on the channel knows
1290               the key before hand (it is considered to be pre-shared-
1291               key).  The key material SHOULD be processed as stated
1292               in the [SILC3] in the section Processing the Key Material.
1293
1294               As it is local setting it is possible to have several
1295               private channel keys on one channel.  In this case several
1296               clients can talk on same channel but only those clients
1297               that share the key with the message sender will be able
1298               to hear the talking.  Client SHOULD NOT display those
1299               message for the end user that it is not able to decrypt
1300               when this mode is set.
1301
1302               Only channel founder MAY set/unset this mode.  If this
1303               mode is unset the server will distribute new channel
1304               key to all clients on the channel which will be used
1305               thereafter.
1306
1307               Typical implementation would use [+|-]k on user interface
1308               to set/unset this mode.
1309
1310
1311            0x00000008    SILC_CMODE_INVITE
1312
1313               Channel is invite only channel.  Client may join to this
1314               channel only if it is invited to the channel.  Channel
1315               founder and channel operator MAY set/unset this mode.
1316
1317               Typical implementation would use [+|-]i on user interface
1318               to set/unset this mode.
1319
1320
1321            0x00000010    SILC_CMODE_TOPIC
1322
1323               The topic of the channel may only be set by client that
1324               is channel founder or channel operator.  Normal clients
1325               on channel will not be able to set topic when this mode
1326               is set.  Channel founder and channel operator MAY set/
1327               unset this mode.
1328
1329               Typical implementation would use [+|-]t on user interface
1330               to set/unset this mode.
1331
1332
1333            0x00000020    SILC_CMODE_ULIMIT
1334
1335               User limit has been set to the channel.  New clients
1336               may not join to the channel when the limit set is
1337               reached.  Channel founder and channel operator MAY set/
1338               unset the limit.  The <user limit> argument is the
1339               number of limited users.
1340
1341               Typical implementation would use [+|-]l on user interface
1342               to set/unset this mode.
1343
1344
1345            0x00000040    SILC_CMODE_PASSPHRASE
1346
1347               Passphrase has been set to the channel.  Client may
1348               join to the channel only if it is able to provide the
1349               correct passphrase.  Setting passphrases to channel
1350               is entirely safe as all commands are protected in the
1351               SILC network.  Only channel founder MAY set/unset
1352               the passphrase.  The <passphrase> argument is the
1353               set passphrase.
1354
1355               Typical implementation would use [+|-]a on user interface
1356               to set/unset this mode.
1357
1358
1359            0x00000080    SILC_CMODE_CIPHER
1360
1361               Sets specific cipher to be used to protect channel
1362               traffic.  The <cipher> argument is the requested cipher.
1363               When set or unset the server must re-generate new
1364               channel key.  Only channel founder MAY set the cipher of 
1365               the channel.  When unset the new key is generated using
1366               default cipher for the channel.
1367
1368               Typical implementation would use [+|-]c on user interface
1369               to set/unset this mode.
1370
1371
1372            0x00000100    SILC_CMODE_HMAC
1373
1374               Sets specific hmac to be used to compute the MACs of the
1375               channel message.  The <hmac> argument is the requested hmac.
1376               Only channel founder may set the hmac of the channel.
1377
1378               Typical implementation would use [+|-]h on user interface
1379               to set/unset this mode.
1380
1381
1382            0x00000200    SILC_CMODE_FOUNDER_AUTH
1383
1384               Channel founder may set this mode to be able to regain
1385               channel founder rights even if the client leaves the 
1386               channel.  The <auth payload> is the Authentication Payload
1387               consisting of the public key authentication method and the
1388               digital signature for that method.  The passphrase or NONE
1389               authentication methods MUST NOT be accepted.
1390
1391               The server does not save <auth payload> but MUST verify it.
1392               The public key used to verify the payload is the <founder
1393               pubkey> if present, or the public key of the client sending
1394               this command.  If <founder pubkey> is present also that
1395               public key MUST be saved as founder's public key.  This
1396               mode may be set only if the <auth payload> was verified
1397               successfully.  The hash function used with the <auth
1398               payload> MUST be sha1.
1399
1400               The public key of the founder is sent in the
1401               SILC_NOTIFY_TYPE_CMODE_CHANGE notify type so that other
1402               routers and servers in the network may save the public key.
1403               This way the founder can reclaim the founder rights back
1404               to the channel from any server in the network.  The founder
1405               rights can be regained by the SILC_CUMODE_FOUNDER channel
1406               user mode, or during joining procedure with the command
1407               SILC_COMMAND_JOIN.
1408
1409               If this mode is already set but the <founder pubkey> is
1410               different the new key will replace the old founder key and
1411               the new key is distributed in the network with the
1412               SILC_NOTIFY_TYPE_CMODE_CHANGE notify.  Only the original
1413               founder may set this mode multiple times and the client
1414               MUST have SILC_CUMODE_FOUNDER mode on the channel.
1415
1416               When this channel mode is set the channel also becomes
1417               permanent.  If all clients leave the channel while this
1418               mode is set the channel MUST NOT be destroyed.  The founder
1419               can reclaim the founder mode back on these empty channels
1420               at any time.  Implementations MAY limit the number of how
1421               many channels a user can own and how long they remain
1422               persistent.
1423
1424               Typical implementation would use [+|-]f on user interface
1425               to set/unset this mode.
1426
1427
1428            0x00000400    SILC_CMODE_SILENCE_USERS
1429
1430               Channel founder may set this mode to silence normal users
1431               on the channel.  Users with operator privileges are not
1432               affected by this mode.  Messages sent by normal users
1433               are dropped by servers when this mode is set.  This mode
1434               can be used to moderate the channel.  Only channel founder
1435               may set/unset this mode.
1436
1437
1438            0x00000800    SILC_CMODE_SILENCE_OPERS
1439
1440               Channel founder may set this mode to silence operators
1441               on the channel.  When used with SILC_CMODE_SILENCE_USERS
1442               mode this can be used to set the channel in state where only
1443               the founder of the channel may send messages to the channel.
1444               Messages sent by operators are dropped by servers when this
1445               mode is set.  Only channel founder may set/unset this mode.
1446
1447
1448         To make the mode system work, client MUST keep the channel mode
1449         mask locally so that the mode setting and unsetting would work
1450         without problems.  The client receives the initial channel mode
1451         mask when it joins to the channel.  When the mode changes on
1452         channel the server MUST distribute the changed channel mode mask
1453         to all clients on the channel by sending the notify type
1454         SILC_NOTIFY_TYPE_CMODE_CHANGE.  The notify type MUST also be sent
1455         to the server's primary router.  If the <channel mode mask> was
1456         not provided this command merely returns the mode mask to the
1457         client.
1458
1459         Reply messages to the command:
1460
1461         Max Arguments:  4
1462             Arguments:  (1) <Status Payload>    (2) <Channel ID>
1463                         (3) <channel mode mask> (4) [<founder pubkey>]
1464
1465         This command replies with the changed channel mode mask that
1466         client MUST keep locally.  It may also return the channel
1467         founder's public key if it is set.
1468
1469         Status messages:
1470
1471             SILC_STATUS_OK
1472             SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
1473             SILC_STATUS_ERR_TOO_MANY_PARAMS
1474             SILC_STATUS_ERR_NOT_REGISTERED
1475             SILC_STATUS_ERR_NOT_ON_CHANNEL
1476             SILC_STATUS_ERR_NO_SUCH_CHANNEL_ID
1477             SILC_STATUS_ERR_BAD_CHANNEL_ID
1478             SILC_STATUS_ERR_NO_CHANNEL_ID
1479             SILC_STATUS_ERR_NO_CHANNEL_PRIV
1480             SILC_STATUS_ERR_NO_CHANNEL_FOPRIV
1481             SILC_STATUS_ERR_UNKNOWN_MODE
1482             SILC_STATUS_ERR_NO_SUCH_CLIENT_ID
1483             SILC_STATUS_ERR_AUTH_FAILED
1484
1485
1486    18   SILC_COMMAND_CUMODE
1487
1488         Max Arguments:  4
1489             Arguments:  (1) <Channel ID>    (2) <mode mask>
1490                         (3) <Client ID>     (4) [<auth payload>]
1491
1492         This command is used by client to change channel user modes on
1493         channel.  Users on channel may have some special modes and this
1494         command is used by channel operators to set or change these modes.
1495         The <Channel ID> is the ID of the target channel.  The <mode mask>
1496         is OR'ed mask of modes.  The <Client ID> is the target client.
1497         The client changing channel user modes MUST be on the same channel
1498         as the target client and posses sufficient privileges to be able to
1499         change the mode.
1500
1501         When the mode is changed SILC_NOTIFY_TYPE_CUMODE_CHANGE notify
1502         type is distributed to the channel.
1503
1504         The following channel modes are defined:
1505
1506            0x00000000    SILC_CUMODE_NONE
1507
1508               No specific mode.  This is the normal situation for client.
1509               Also, this is the mode set when removing all modes from
1510               the target client.
1511
1512
1513            0x00000001    SILC_CUMODE_FOUNDER
1514
1515               The client is channel founder of the channel.  Usually this
1516               mode is set only by the server when the channel was created.
1517               However, if the SILC_CMODE_FOUNDER_AUTH channel mode has
1518               been set, the client can claim channel founder privileges
1519               by providing the <auth payload> that the server will use
1520               to authenticate the client.  The public key that server will
1521               use to verify the <auth payload> MUST be the same public key
1522               that was saved when the SILC_CMODE_FOUNDER_AUTH channel
1523               mode was set.  The client MAY remove this mode at any time.
1524
1525
1526            0x00000002    SILC_CUMODE_OPERATOR
1527
1528               Sets channel operator privileges on the channel for a
1529               client on the channel.  Channel founder and channel operator
1530               MAY set/unset this mode.  The client MAY remove this mode
1531               at any time.
1532
1533
1534            0x00000004    SILC_CUMODE_BLOCK_MESSAGES
1535
1536               Marks that the client wishes not to receive any channel
1537               messages sent for the channel.  Client MAY set and unset
1538               this mode to itself.  Client MUST NOT set it to anyone else.
1539               When this mode is set server MUST NOT deliver channel
1540               messages to this client.  Other packets such as channel
1541               key packets are still sent to the client.
1542
1543               A separate service could provide additional filtering
1544               features for accepting channel messages from certain
1545               sender.  However, this document does not specify such
1546               service.
1547
1548
1549            0x00000008    SILC_CUMODE_BLOCK_MESSAGES_USERS
1550
1551               Marks that the client wishes not to receive any channel
1552               messages sent from normal users.  Only messages sent by
1553               channel founder or channel operator is accepted.  Client
1554               MAY set and unset this mode to itself.  Client MUST NOT
1555               set it to anyone else.  When this mode is set server MUST
1556               NOT deliver channel messages that are sent by normal users
1557               to this client.
1558
1559               A separate service could provide additional filtering
1560               features for accepting channel messages from certain
1561               sender.  However, this document does not specify such
1562               service.
1563
1564
1565            0x00000010    SILC_CUMODE_BLOCK_MESSAGES_ROBOTS
1566
1567               Marks that the client wishes not to receive any channel
1568               messages sent from robots.  Messages sent by users with
1569               the SILC_UMODE_ROBOT user mode set are not delivered.
1570               Client MAY set and unset this mode to itself.  Client MUST
1571               NOT set it to anyone else.  When this mode is set server
1572               MUST NOT deliver channel messages that are sent by robots
1573               to this client.
1574
1575
1576            0x00000020    SILC_CUMODE_QUIET
1577
1578               Marks that the client cannot talk on the channel.  This
1579               mode can be set by channel operator or channel founder to
1580               some other user that is not operator or founder.  The
1581               target client MUST NOT unset this mode.  When this mode
1582               is set the server MUST drop messages sent by this client
1583               to the channel.
1584
1585
1586         Reply messages to the command:
1587
1588         Max Arguments:  4
1589             Arguments:  (1) <Status Payload>  (2) <channel user mode mask>
1590                         (3) <Channel ID>      (4) <Client ID>
1591
1592         This command replies with the changed channel user mode mask that
1593         client MUST keep locally. The <Channel ID> is the specified
1594         channel.  The <Client ID> is the target client.
1595
1596         Status messages:
1597
1598             SILC_STATUS_OK
1599             SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
1600             SILC_STATUS_ERR_TOO_MANY_PARAMS
1601             SILC_STATUS_ERR_NOT_REGISTERED
1602             SILC_STATUS_ERR_NOT_ON_CHANNEL
1603             SILC_STATUS_ERR_NO_SUCH_CHANNEL_ID
1604             SILC_STATUS_ERR_BAD_CHANNEL_ID
1605             SILC_STATUS_ERR_NO_CHANNEL_ID
1606             SILC_STATUS_ERR_NO_CHANNEL_PRIV
1607             SILC_STATUS_ERR_NO_CHANNEL_FOPRIV
1608             SILC_STATUS_ERR_UNKNOWN_MODE
1609             SILC_STATUS_ERR_NO_SUCH_CLIENT_ID
1610             SILC_STATUS_ERR_AUTH_FAILED
1611
1612
1613    19   SILC_COMMAND_KICK
1614
1615         Max Arguments:  3
1616             Arguments:  (1) <Channel ID>      (2) <Client ID>  
1617                         (3) [<comment>]
1618
1619         This command is used by channel operators to remove a client from
1620         channel.  The <channel> argument is the channel the client to be
1621         removed is on currently.  Note that the "kicker" must be on the same
1622         channel.  If <comment> is provided it will be sent to the removed
1623         client.
1624
1625         After kicking the client the server MUST send the notify type
1626         SILC_NOTIFY_TYPE_KICKED to the channel and to its primary router.
1627         The kicked client MUST be removed from the invite list of the
1628         channel if it is explicitly added in the list.  The channel key
1629         MUST also be re-generated after kicking, unless the
1630         SILC_CMODE_PRIVKEY mode is set.
1631
1632         Reply messages to the command:
1633
1634         Max Arguments:  1
1635             Arguments:  (1) <Status Payload>
1636
1637         This command replies only with Status Payload.
1638
1639         Status messages:
1640
1641             SILC_STATUS_OK
1642             SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
1643             SILC_STATUS_ERR_TOO_MANY_PARAMS
1644             SILC_STATUS_ERR_NOT_REGISTERED
1645             SILC_STATUS_ERR_NO_SUCH_CHANNEL
1646             SILC_STATUS_ERR_NO_SUCH_CLIENT_ID
1647             SILC_STATUS_ERR_NO_CHANNEL_PRIV
1648             SILC_STATUS_ERR_NO_CLIENT_ID
1649
1650
1651
1652
1653    20   SILC_COMMAND_BAN
1654
1655         Max Arguments:  3
1656             Arguments:  (1) <Channel ID>         (2) [<add | del>]
1657                         (3) [<ban list>]
1658
1659         This command is used to manage the ban list of the channel
1660         indicated by the <Channel ID>.  A client that is banned from
1661         channel is no longer able to join the channel.  The client which
1662         is executing this command MUST have at least channel operator
1663         privileges on the channel.
1664
1665         The <add | del> is an argument of size of 1 byte where 0x00 means
1666         adding a client to ban list, and 0x01 means deleting a client
1667         from ban list.  The <ban list>, if present, indicates the
1668         information to be added to or removed from the ban list.  It
1669         may include a string for matching clients, public key of a
1670         client or Client ID of a client.  The <ban list> format is
1671         as follows:
1672
1673           2 bytes         - Number of arguments in the list
1674           variable length - Argument Payloads
1675
1676         The following Argument Types has been defined for ban list
1677         Argument Payloads:
1678
1679           0x01 - Argument is an ban string of following format:
1680
1681             [<nickname>[@<server>]!][<username>]@[<hostname or IP/MASK>]
1682
1683             The <hostname> may also be in format of IP/MASK to indicate
1684             a network.
1685
1686           0x02 - Argument is the public key of a client
1687           0x03 - Argument is the Client ID of a client
1688
1689         If unknown type value is received or there is invalid amount of
1690         Argument Payloads present in the list, the command MUST be
1691         discarded.  When argument that is to be deleted from the ban
1692         list does not exist in the list the argument is ignored.
1693
1694         The server MUST send the notify type SILC_NOTIFY_TYPE_BAN to its
1695         primary router after adding to or removing from the ban list.
1696         The wildcards MAY be used with this command.  If this command
1697         is executed without the ban arguments the command merely replies
1698         with the current ban list.
1699
1700         Reply messages to the command:
1701
1702         Max Arguments:  3
1703             Arguments:  (1) <Status Payload>  (2) <Channel ID>
1704                         (3) [<ban list>]
1705
1706         This command replies with the <Channel ID> of the channel and
1707         the current <ban list> of the channel if it exists.
1708
1709         Status messages:
1710
1711             SILC_STATUS_OK
1712             SILC_STATUS_ERR_NOT_REGISTERED
1713             SILC_STATUS_ERR_TOO_MANY_PARAMS
1714             SILC_STATUS_ERR_NO_SUCH_CHANNEL_ID
1715             SILC_STATUS_ERR_NO_CHANNEL_ID
1716             SILC_STATUS_ERR_NOT_ON_CHANNEL
1717             SILC_STATUS_ERR_NO_CHANNEL_PRIV
1718             SILC_STATUS_ERR_RESOURCE_LIMIT
1719
1720
1721
1722
1723    21   SILC_COMMAND_DETACH
1724
1725         Max Arguments:  0
1726             Arguments:
1727
1728         This command is used to detach from the network.  Client can
1729         send this command to its server to indicate that it will be
1730         detached.  By detaching the client remains in the network but
1731         the actual network connection to the server is closed.  The
1732         client may then later resume the old session back.
1733
1734         When this command is received the server MUST check that the
1735         client is locally connected client, and set the user mode
1736         SILC_UMODE_DETACHED flag.  The SILC_NOTIFY_TYPE_UMODE_CHANGE
1737         MUST be also sent to routers.  The server then sends command
1738         reply to this command and closes the network connection.
1739         The server MUST NOT remove the client from its lists, or send
1740         any signoff notifications for this client.  See the [SILC1]
1741         for detailed information about detaching.
1742
1743         Reply messages to the command:
1744
1745         Max Arguments:  1
1746             Arguments:  (1) <Status Payload>
1747
1748         This command replies only with the status indication.
1749
1750         Status messages:
1751
1752             SILC_STATUS_OK
1753             SILC_STATUS_ERR_NOT_REGISTERED
1754
1755
1756    22   SILC_COMMAND_WATCH
1757
1758         Max Arguments:  3
1759             Arguments:  (1) <Client ID>       (2) [<add nickname>]
1760                         (3) [<del nickname>]
1761
1762         This command is used to set up a watch for <add nickname>
1763         nickname.  When a user in the network appears with the
1764         nickname, or signoffs the network or user's mode is changed
1765         the client which set up the watch will be notified about
1766         this change.  This can be used to watch for certain nicknames
1767         in the network and receive notifications when for example a
1768         friend appears in the network or leaves the network.
1769
1770         The <del nickname> is a nickname that has been previously
1771         added to watch list and is now removed from it.  Notifications
1772         for that nickname will not be delivered anymore.
1773
1774         The <Client ID> is the Client ID of the sender of this command.
1775
1776         The nickname set to watch MUST NOT include any wildcards.
1777         Note also that a nickname may match several users since
1778         nicknames are not unique.  Implementations MAY set limits
1779         for how many nicknames client can watch.
1780
1781         When normal server receives this command from client it
1782         MUST send it to its router.  Router will process the command
1783         and actually keeps the watch list.
1784
1785         Reply messages to the command:
1786
1787         Max Arguments:  1
1788             Arguments:  (1) <Status Payload>
1789
1790         This command replies only with the status indication.
1791
1792         Status messages:
1793
1794             SILC_STATUS_OK
1795             SILC_STATUS_ERR_NOT_REGISTERED
1796             SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
1797             SILC_STATUS_ERR_TOO_MANY_PARAMS
1798             SILC_STATUS_ERR_BAD_NICKNAME
1799             SILC_STATUS_ERR_WILDCARDS
1800             SILC_STATUS_ERR_RESOURCE_LIMIT
1801             SILC_STATUS_ERR_NO_SUCH_NICK
1802             SILC_STATUS_ERR_NICKNAME_IN_USE
1803
1804
1805    23   SILC_COMMAND_SILCOPER
1806
1807         Max Arguments:  2
1808             Arguments:  (1) <username>  (2) <authentication payload>
1809
1810         This command is used by normal client to obtain router operator
1811         privileges (also known as SILC operator) on the router.  Note
1812         that router operator has privileges that supersedes the server
1813         operator privileges.
1814
1815         The <username> is the username set in the server configurations
1816         as operator.  The <authentication payload> is the data that the
1817         client is authenticated against.  It may be passphrase prompted
1818         for user on client's screen or it may be public key or certificate
1819         authentication data (data signed with private key).  The public
1820         key that router will use to verify the signature found in the
1821         payload should be verified.  It is recommended that the public
1822         key is saved locally in the router and router would not use
1823         any public keys received during the SKE.
1824
1825         Difference between router operator and server operator is that
1826         router operator is able to handle cell level properties while
1827         server operator (even on router server) is able to handle only
1828         local properties, such as, local connections and normal server
1829         administration.  The router operator is also able to use the
1830         SILC_COMMAND_KILL command.
1831
1832         After changing the mode server MUST send the notify type
1833         SILC_NOTIFY_TYPE_UMODE_CHANGE to its primary router.
1834
1835         Reply messages to the command:
1836
1837         Max Arguments:  1
1838             Arguments:  (1) <Status Payload>
1839
1840         This command replies only with Status Payload.
1841
1842         Status messages:
1843
1844             SILC_STATUS_OK
1845             SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
1846             SILC_STATUS_ERR_TOO_MANY_PARAMS
1847             SILC_STATUS_ERR_NOT_REGISTERED
1848             SILC_STATUS_ERR_AUTH_FAILED
1849
1850
1851    24   SILC_COMMAND_LEAVE
1852
1853         Max Arguments:  1
1854             Arguments:  (1) <Channel ID>
1855
1856         This command is used by client to leave a channel the client is
1857         joined to. 
1858
1859         When leaving channel the server MUST send the notify type
1860         SILC_NOTIFY_TYPE_LEAVE to its primary router and to the channel.
1861         The channel key MUST also be re-generated when leaving the channel
1862         and distribute it to all clients still currently on the channel.
1863         The key MUST NOT be re-generated if the SILC_CMODE_PRIVKEY mode
1864         is set.
1865
1866         Reply messages to the command:
1867
1868         Max Arguments:  2
1869             Arguments:  (1) <Status Payload>  (2) <Channel ID>
1870
1871         The <Channel ID> is the ID of left channel.
1872
1873         Status messages:
1874
1875             SILC_STATUS_OK
1876             SILC_STATUS_ERR_NOT_REGISTERED
1877             SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
1878             SILC_STATUS_ERR_TOO_MANY_PARAMS
1879             SILC_STATUS_ERR_NO_SUCH_CHANNEL_ID
1880             SILC_STATUS_ERR_BAD_CHANNEL_ID
1881             SILC_STATUS_ERR_NO_CHANNEL_ID
1882
1883
1884    25   SILC_COMMAND_USERS
1885
1886         Max Arguments:  2
1887             Arguments:  (1) [<Channel ID>]  (2) [<channel name>]
1888
1889         This command is used to list user names currently on the requested
1890         channel; either the argument <Channel ID> or the <channel name>. 
1891         One of these arguments must be present.  The server MUST resolve
1892         the joined clients and reply with a lists of users on the channel
1893         and with list of user modes on the channel.
1894
1895         If the requested channel is a private or secret channel, this
1896         command MUST NOT send the list of users, except if the sender is 
1897         on the channel, or the sender is a server.  Otherwise, error is
1898         returned to the sender.
1899
1900         Reply messages to the command:
1901
1902         Max Arguments:  5
1903             Arguments:  (1) <Status Payload>  (2) <Channel ID>
1904                         (3) <list count>      (4) <Client ID list>
1905                         (5) <client mode list>
1906
1907         This command replies with the Channel ID of the requested channel
1908         Client ID list of the users on the channel and list of their modes.
1909         The Client ID list has Client ID's of all users in the list.  The 
1910         <Client ID list> is formed by adding Client ID's one after another.
1911         The <client mode list> is formed by adding client's user modes on
1912         the channel one after another (4 bytes (32 bits) each).  The <list 
1913         count> of length of 4 bytes (32 bits), tells the number of entries
1914         in the lists.  Both lists MUST have equal number of entries.
1915
1916         Status messages:
1917
1918             SILC_STATUS_OK
1919             SILC_STATUS_ERR_NOT_REGISTERED
1920             SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
1921             SILC_STATUS_ERR_TOO_MANY_PARAMS
1922             SILC_STATUS_ERR_NO_SUCH_CHANNEL_ID
1923             SILC_STATUS_ERR_BAD_CHANNEL_ID
1924             SILC_STATUS_ERR_NO_CHANNEL_ID
1925             SILC_STATUS_ERR_NOT_ON_CHANNEL
1926
1927
1928    26   SILC_COMMAND_GETKEY
1929
1930         Max Arguments:  1
1931             Arguments:  (1) <ID Payload>
1932
1933         This command is used to fetch the public key of the client or
1934         server indicated by the <ID Payload>.  The public key is fetched
1935         from the server where to the client is connected.
1936
1937         Reply messages to the command:
1938
1939         Max Arguments:  3
1940             Arguments:  (1) <Status Payload>      (2) <ID Payload>
1941                         (3) [<Public Key Payload>]
1942
1943         This command replies with the client's or server's ID and with
1944         the <Public Key Payload>.
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_CLIENT_ID
1953             SILC_STATUS_ERR_NO_SUCH_SERVER_ID
1954
1955
1956    27   SILC_COMMAND_SERVICE
1957
1958         Max Arguments:  256
1959             Arguments:  (1) [<service name>]    (2) [<auth payload>]
1960                         (n) [...]
1961
1962         This command is used to negotiate a service agreement with a
1963         remote server.  If this command is given without arguments it
1964         MAY return the service list, if it is publicly available.  The
1965         <service name> is a service specific identifier, and the
1966         <auth payload> MAY be used to authenticate the requester to the
1967         remote service.  The authentication to a service may be based
1968         on previous agreement with the requester and the service
1969         provider.  The command MAY also take additional service
1970         specific arguments.
1971
1972         This document does not specify any services.  How the services
1973         are configured and put available in a server is also out of
1974         scope of this document.
1975
1976         This command MAY be used by client to start using some service
1977         in a server, but it also MAY be used by server to negotiate
1978         to start using a service in some other server or router.
1979
1980         After the negotiation is done both of the parties need to know
1981         from the service identifier how the service can be used.  The
1982         service can be considered to be a protocol which both of the
1983         parties need to support.
1984
1985         Reply messages to the command:
1986
1987         Max Arguments:  256
1988             Arguments:  (1) <Status Payload>      (2) [<service list>]
1989                         (3) [<service name>]      (n) [...]
1990
1991
1992         This command MAY reply with the <service list> when command is
1993         given without arguments, and the list is a comma separated list
1994         of service identifiers.  The <service name> is the service that
1995         the sender requested and this is provided when the server has
1996         accepted the sender to use the <service name>.  The command
1997         reply MAY also have additional service specific arguments.
1998
1999         Status messages:
2000
2001             SILC_STATUS_OK
2002             SILC_STATUS_ERR_NOT_REGISTERED
2003             SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
2004             SILC_STATUS_ERR_TOO_MANY_PARAMS
2005             SILC_STATUS_ERR_NO_SUCH_SERVICE
2006             SILC_STATUS_ERR_AUTH_FAILED
2007             SILC_STATUS_ERR_PERM_DENIED
2008
2009
2010
2011
2012    28 - 199
2013
2014         Currently undefined commands.
2015
2016
2017    200 - 254
2018
2019         These commands are reserved for private use and will not be defined
2020         in this document.
2021
2022
2023    255  SILC_COMMAND_MAX   
2024
2025         Reserved command.  This must not be sent.
2026 .in 3
2027
2028
2029 .ti 0
2030 2.4 SILC Command Status Payload
2031
2032 Command Status Payload is sent in command reply messages to indicate
2033 the status of the command.  The payload is one of argument in the
2034 command thus this is the data area in Command Argument Payload described
2035 in [SILC2].  The payload is only 2 bytes in length.  The following
2036 diagram represents the Command Status Payload (fields are always in
2037 MSB first order).
2038
2039
2040 .in 21
2041 .nf
2042                      1
2043  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
2044 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2045 |     Status    |     Error     |
2046 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2047 .in 3
2048
2049 .ce
2050 Figure 6:  SILC Command Status Payload
2051
2052
2053 .in 6
2054 o Status (1 byte) - Indicates the status message type,
2055   error, start of list, entry of list or end of list.
2056
2057 o Error (1 byte) - Indicates the error if the Status
2058   field is some list status, which means there are list
2059   of errors.
2060 .in 3
2061
2062 The values in Status and Error fields are set according
2063 the following rules:
2064
2065 .in 6
2066 o If there is single reply and error has not occurred
2067   then Status field includes value SILC_STATUS_OK, and
2068   the Error field MUST be ignored (and set to zero
2069   value).
2070
2071 o If there is single error, then Status field includes
2072   one of the error values, and the Error field MUST be
2073   ignored (and set to zero value).
2074
2075 o If there will be multiple successful command replies
2076   then Status field includes SILC_STATUS_LIST_START, 
2077   SILC_STATUS_LIST_ITEM or SILC_STATUS_LIST_END value,
2078   and Error field is set to SILC_STATUS_OK.
2079
2080 o If there are multiple error replies then Status field
2081   includes SILC_STATUS_LIST_START, SILC_STATUS_LIST_ITEM
2082   or SILC_STATUS_LIST_END value, and the Error field
2083   includes the error value.
2084 .in 3
2085
2086 This way it is possible to send single successful or
2087 single error reply, but also multiple successful and
2088 multiple error replies.  Note that it is possible to
2089 send both list of successful replies and list of error
2090 replies at the same time, however in this case the
2091 list of error replies MUST be sent after the successful
2092 replies.  This way the recipient may ignore the multiple
2093 errors if it wishes to do so.  Also note that in this
2094 case the successful and error replies belong to the
2095 same list.
2096
2097 All Status messages are described in the next section.
2098
2099
2100 .ti 0
2101 3 SILC Status Types
2102
2103 Status messages are returned in SILC protocol in command reply
2104 packet and in notify packet.  The SILC_PACKET_COMMAND_REPLY is
2105 the command reply packet and status types are sent inside the
2106 Status Payload as one of command reply argument, as defined in
2107 previous sections.  For SILC_PACKET_NOTIFY packet they can be sent
2108 as defined in [SILC2] for SILC_NOTIFY_TYPE_ERROR type.  The same
2109 types defined in this section are used in both cases.
2110
2111 When returning status messages in the command reply message they
2112 indicate whether the command was executed without errors.  If error
2113 occurred the status indicates which error occurred.
2114
2115 When sending status messages in SILC_NOTIFY_TYPE_ERROR notify type
2116 they always send some error status.  Usually they are sent to
2117 indicate that error occurred while processing some SILC packet.
2118 Please see the [SILC1] and [SILC2] for more information sending
2119 status types in SILC_NOTIFY_TYPE_ERROR notify.
2120
2121 The Status Types are only numeric values and the receiver must
2122 convert the numeric values into human readable messages if this
2123 is desired in the application.
2124
2125 List of all defined status types:
2126
2127 .in 0
2128    Generic status messages:
2129
2130    0    SILC_STATUS_OK
2131
2132         Ok status.  Everything went Ok.  The status payload maybe
2133         safely ignored in this case.
2134
2135    1    SILC_STATUS_LIST_START
2136
2137         Start of the list.  There will be several command replies and
2138         this reply is the start of the list.
2139
2140    2    SILC_STATUS_LIST_ITEM
2141
2142         Item in the list.  This is one of the item in the list but not the
2143         first or last one.
2144
2145    3    SILC_STATUS_LIST_END
2146
2147         End of the list.  There were several command replies and this
2148         reply is the last of the list.  There won't be other replies
2149         belonging to this list after this one.
2150
2151    4 - 9
2152
2153         Currently undefined and has been reserved for the future.
2154
2155
2156    Error status message:
2157
2158
2159
2160    10   SILC_STATUS_ERR_NO_SUCH_NICK
2161
2162         "No such nickname".  Requested nickname does not exist.
2163
2164    11   SILC_STATUS_ERR_NO_SUCH_CHANNEL
2165
2166         "No such channel".  Requested channel name does not exist.
2167
2168    12   SILC_STATUS_ERR_NO_SUCH_SERVER
2169
2170         "No such server".  Requested server name does not exist.
2171
2172    13   SILC_STATUS_ERR_INCOMPLETE_INFORMATION
2173
2174         "Incomplete registration information".  Information remote
2175         sent was incomplete.
2176
2177    14   SILC_STATUS_ERR_NO_RECIPIENT
2178
2179         "No recipient given".  Command required recipient which was
2180         not provided.
2181
2182    15   SILC_STATUS_ERR_UNKNOWN_COMMAND
2183
2184         "Unknown command".  Command sent to server is unknown by the
2185         server.
2186
2187    16   SILC_STATUS_ERR_WILDCARDS
2188
2189         "Wildcards cannot be used".  Wildcards were provided but they
2190         weren't permitted.
2191
2192    17   SILC_STATUS_ERR_NO_CLIENT_ID
2193
2194         "No Client ID given".  Client ID were expected as command
2195         parameter but were not found.
2196
2197    18   SILC_STATUS_ERR_NO_CHANNEL_ID
2198
2199         "No Channel ID given".  Channel ID were expected as command
2200         parameter but were not found.
2201
2202    19   SILC_STATUS_ERR_NO_SERVER_ID
2203
2204         "No Serve ID given".  Server ID were expected as command
2205         parameter but were not found.
2206
2207    20   SILC_STATUS_ERR_BAD_CLIENT_ID
2208
2209         "Bad Client ID".  Client ID provided were erroneous.
2210
2211    21   SILC_STATUS_ERR_BAD_CHANNEL_ID
2212
2213         "Bad Channel ID".  Channel ID provided were erroneous.
2214
2215    22   SILC_STATUS_ERR_NO_SUCH_CLIENT_ID
2216
2217         "No such Client ID".  Client ID provided does not exist.
2218         The unknown Client ID MUST be provided as next argument
2219         in the reply.
2220
2221    23   SILC_STATUS_ERR_NO_SUCH_CHANNEL_ID
2222
2223         "No such Channel ID".  Channel ID provided does not exist.
2224         The unknown Channel ID MUST be provided as next argument
2225         in the reply.
2226
2227    24   SILC_STATUS_ERR_NICKNAME_IN_USE
2228
2229         "Nickname already exists".  Nickname created could not be 
2230         registered because number of same nicknames were already set to
2231         maximum.  This is not expected to happen in real life but is
2232         possible to occur.
2233
2234    25   SILC_STATUS_ERR_NOT_ON_CHANNEL
2235
2236         "You are not on that channel".  The command were specified for
2237         channel user is not currently on.
2238
2239    26   SILC_STATUS_ERR_USER_NOT_ON_CHANNEL
2240
2241         "They are not on channel".  The requested target client is not
2242         on requested channel.
2243
2244    27   SILC_STATUS_ERR_USER_ON_CHANNEL
2245
2246         "User already on channel".  User were invited on channel they
2247         already are on.
2248
2249    28   SILC_STATUS_ERR_NOT_REGISTERED
2250
2251         "You have not registered".  User executed command that requires
2252         the client to be registered on the server before it may be
2253         executed.
2254
2255    29   SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
2256
2257         "Not enough parameters".  Command requires more parameters
2258         than provided.
2259
2260    30   SILC_STATUS_ERR_TOO_MANY_PARAMS
2261
2262         "Too many parameters".  Too many parameters were provided
2263         for the command.
2264
2265    31   SILC_STATUS_ERR_PERM_DENIED
2266
2267         "Permission denied".  Generic permission denied error status
2268         to indicate disallowed access.
2269
2270    32   SILC_STATUS_ERR_BANNED_FROM_SERVER
2271
2272         "You are banned from this server".  The client tried to register
2273         on server that has explicitly denied this host to connect.
2274
2275    33   SILC_STATUS_ERR_BAD_PASSWORD
2276
2277         "Cannot join channel. Incorrect password".  Password provided for 
2278         channel were not accepted.
2279
2280    34   SILC_STATUS_ERR_CHANNEL_IS_FULL
2281
2282         "Cannot join channel. Channel is full".  The channel is full
2283         and client cannot be joined to it.
2284
2285    35   SILC_STATUS_ERR_NOT_INVITED
2286
2287         "Cannot join channel. You have not been invited".  The channel
2288         is invite only channel and client has not been invited.
2289
2290    36   SILC_STATUS_ERR_BANNED_FROM_CHANNEL
2291
2292         "Cannot join channel. You have been banned".  The client has
2293         been banned from the channel.
2294
2295    37   SILC_STATUS_ERR_UNKNOWN_MODE
2296
2297         "Unknown mode".  Mode provided by the client were unknown to
2298         the server.
2299
2300    38   SILC_STATUS_ERR_NOT_YOU
2301
2302         "Cannot change mode for other users".  User tried to change
2303         someone else's mode.
2304
2305    39   SILC_STATUS_ERR_NO_CHANNEL_PRIV
2306
2307         "Permission denied. You are not channel operator".  Command may 
2308         be executed only by channel operator.
2309
2310    40   SILC_STATUS_ERR_NO_CHANNEL_FOPRIV
2311
2312         "Permission denied. You are not channel founder".  Command may 
2313         be executed only by channel operator.
2314
2315    41   SILC_STATUS_ERR_NO_SERVER_PRIV
2316
2317         "Permission denied. You are not server operator".  Command may
2318         be executed only by server operator.
2319
2320    42   SILC_STATUS_ERR_NO_ROUTER_PRIV
2321
2322         "Permission denied. You are not SILC operator".  Command may be
2323         executed only by router (SILC) operator.
2324
2325    43   SILC_STATUS_ERR_BAD_NICKNAME
2326
2327         "Bad nickname".  Nickname requested contained illegal characters
2328         or were malformed.
2329
2330    44   SILC_STATUS_ERR_BAD_CHANNEL
2331
2332         "Bad channel name".  Channel requested contained illegal characters
2333         or were malformed.
2334
2335    45   SILC_STATUS_ERR_AUTH_FAILED
2336
2337         "Authentication failed".  The authentication data sent as 
2338         argument were wrong and thus authentication failed.
2339
2340    46   SILC_STATUS_ERR_UNKOWN_ALGORITHM
2341
2342         "The algorithm was not supported."  The server does not support the
2343         requested algorithm.
2344
2345    47   SILC_STATUS_ERR_NO_SUCH_SERVER_ID
2346
2347         "No such Server ID".  Server ID provided does not exist.
2348         The unknown Server ID MUST be provided as next argument
2349         in the reply.
2350
2351    48   SILC_STATUS_ERR_RESOURCE_LIMIT
2352
2353         "No more resources available".  This can mean that server cannot
2354         or will not accept something due to resource limitations.
2355
2356    49   SILC_STATUS_ERR_NO_SUCH_SERVICE
2357
2358         "Service does not exist".  Requested service identifier is
2359         unknown.
2360
2361    50   SILC_STATUS_ERR_NOT_AUTHENTICATED
2362
2363         "You have not been authenticated".  Remote connection is not
2364         authenticated even though it is supposed to be.
2365
2366    51   SILC_STATUS_ERR_BAD_SERVER_ID
2367
2368         "Server ID is not valid".  Provided server ID is not valid.
2369
2370    52   SILC_STATUS_ERR_KEY_EXCHANGE_FAILED
2371
2372         "Key exchange failed".  Key Exchange protocol failed.
2373
2374    53   SILC_STATUS_ERR_BAD_VERSION
2375
2376         "Bad version".  Protocol or software version mismatch.
2377
2378    54   SILC_STATUS_ERR_TIMEDOUT
2379
2380         "Operation timed out".  Operation or service request timed
2381         out, and thus was not processed.
2382
2383    55   SILC_STATUS_ERR_UNSUPPORTED_PUBLIC_KEY
2384
2385         "Unsupported public key type".  The public key or certificate
2386         type is not supported in this implementation.
2387
2388    56   SILC_STATUS_ERR_OPERATION_ALLOWED
2389
2390         "Operation is not allowed".  A operation, for example a command,
2391         is not allowed or it's execution is not allowed.
2392
2393 .in 3
2394
2395
2396 .ti 0
2397 4 Security Considerations
2398
2399 Security is central to the design of this protocol, and these security
2400 considerations permeate the specification.  Common security considerations
2401 such as keeping private keys truly private and using adequate lengths for
2402 symmetric and asymmetric keys must be followed in order to maintain the
2403 security of this protocol.
2404
2405
2406 .ti 0
2407 5 References
2408
2409 [SILC1]      Riikonen, P., "Secure Internet Live Conferencing (SILC),
2410              Protocol Specification", Internet Draft, May 2002.
2411
2412 [SILC2]      Riikonen, P., "SILC Packet Protocol", Internet Draft,
2413              May 2002.
2414
2415 [SILC3]      Riikonen, P., "SILC Key Exchange and Authentication 
2416              Protocols", Internet Draft, May 2002.
2417
2418 [IRC]        Oikarinen, J., and Reed D., "Internet Relay Chat Protocol",
2419              RFC 1459, May 1993.
2420
2421 [IRC-ARCH]   Kalt, C., "Internet Relay Chat: Architecture", RFC 2810,
2422              April 2000.
2423
2424 [IRC-CHAN]   Kalt, C., "Internet Relay Chat: Channel Management", RFC
2425              2811, April 2000.
2426
2427 [IRC-CLIENT] Kalt, C., "Internet Relay Chat: Client Protocol", RFC
2428              2812, April 2000.
2429
2430 [IRC-SERVER] Kalt, C., "Internet Relay Chat: Server Protocol", RFC
2431              2813, April 2000.
2432
2433 [SSH-TRANS]  Ylonen, T., et al, "SSH Transport Layer Protocol", 
2434              Internet Draft.
2435
2436 [PGP]        Callas, J., et al, "OpenPGP Message Format", RFC 2440,
2437              November 1998.
2438
2439 [SPKI]       Ellison C., et al, "SPKI Certificate Theory", RFC 2693,
2440              September 1999.
2441
2442 [PKIX-Part1] Housley, R., et al, "Internet X.509 Public Key 
2443              Infrastructure, Certificate and CRL Profile", RFC 2459,
2444              January 1999.
2445
2446 [Schneier]   Schneier, B., "Applied Cryptography Second Edition",
2447              John Wiley & Sons, New York, NY, 1996.
2448
2449 [Menezes]    Menezes, A., et al, "Handbook of Applied Cryptography",
2450              CRC Press 1997.
2451
2452 [OAKLEY]     Orman, H., "The OAKLEY Key Determination Protocol",
2453              RFC 2412, November 1998.
2454
2455 [ISAKMP]     Maughan D., et al, "Internet Security Association and
2456              Key Management Protocol (ISAKMP)", RFC 2408, November
2457              1998.
2458
2459 [IKE]        Harkins D., and Carrel D., "The Internet Key Exchange
2460              (IKE)", RFC 2409, November 1998.
2461
2462 [HMAC]       Krawczyk, H., "HMAC: Keyed-Hashing for Message
2463              Authentication", RFC 2104, February 1997.
2464
2465 [PKCS1]      Kalinski, B., and Staddon, J., "PKCS #1 RSA Cryptography
2466              Specifications, Version 2.0", RFC 2437, October 1998.
2467
2468 [RFC2119]    Bradner, S., "Key Words for use in RFCs to Indicate
2469              Requirement Levels", BCP 14, RFC 2119, March 1997.
2470
2471 [RFC2279]    Yergeau, F., "UTF-8, a transformation format of ISO
2472              10646", RFC 2279, January 1998.
2473
2474 [ATTRS]      Riikonen, P., "User Online Presence and Information
2475              Attributes", Internet Draft, May 2002.
2476
2477
2478 .ti 0
2479 6 Author's Address
2480
2481 .nf
2482 Pekka Riikonen
2483 Snellmaninkatu 34 A 15
2484 70100 Kuopio
2485 Finland
2486
2487 EMail: priikone@iki.fi
2488
2489 This Internet-Draft expires 25 April 2003
2490
2491
2492 .ti 0
2493 Appendix A
2494
2495 This appendix defines the usage of the <Requested Attributes> argument in
2496 the SILC_COMMAND_WHOIS command.  The attributes are defined in [ATTRS], 
2497 and may be used to request additional information about the user.  Since
2498 the information that may be requested using the attributes is something 
2499 that server cannot deliver to the sender, it is possible to send the WHOIS
2500 command directly to the destination client whom will then provide the
2501 requested attributes.  This requires the servers to relay the WHOIS
2502 command to the client, and it requires capability for handling the WHOIS
2503 command in the client end.
2504
2505 The <Requested Attributes> MAY include several attributes that are
2506 requested.  The format and encoding of the <Requested Attributes> is as
2507 defined in [ATTRS].  When <Requested Attributes> argument is set the
2508 server MAY process the attributes to see whether it can narrow down
2509 the WHOIS search, for example when searching with a nickname.  The
2510 normal servers MUST process the WHOIS command as normal WHOIS command,
2511 that is to send the command directly to the router.  The router MAY
2512 process the attributes, but it MUST send the command to the server
2513 that owns the requested client.
2514
2515 The server that owns the client and receives the command MUST check
2516 whether the client is detached from the network.  If it is detached,
2517 that is the user mode has the SILC_UMODE_DETACHED mode set, it SHOULD
2518 process the attributes and provide as many of the requested attributes
2519 as possible and then send reply back to the sender.  If the client is
2520 active in the network it MUST send the command to the client for
2521 processing.
2522
2523 The client receiving WHOIS command SHOULD check whether the
2524 <Requested Attributes> argument is set.  If it is not set then the
2525 WHOIS command SHOULD be discarded.  The client processes the requested
2526 attributes and SHOULD reply to each of the requested attribute with
2527 either valid value, or with an indication that the requested attribute
2528 is not known or supported.  This is to be done as defined in [ATTRS].
2529 The client always MUST send a reply to the command when some attributes
2530 were requested.  The client MAY also add additional attributes to the
2531 reply even if they were not requested.  The client MAY also digitally
2532 sign the attributes with ATTRIBUTE_USER_DIGITAL_SIGNATURE as defined
2533 in [ATTRS].  Then the client sends the reply back to the sender of
2534 the command.  The command reply that client assembles does not need
2535 to include any other argument but the <Status Payload> (1), and the
2536 <Attributes> (11).  The server receiving reply from client MUST allow
2537 this sort of command reply for WHOIS command.
2538
2539 The information received from the client MAY be cached in the
2540 server's end.  The caching may be desired for example if the client
2541 can be detached from the network.  This way the server is then able
2542 to provide at least partial information for a requester.  The
2543 server MAY also process the command reply and verify whether the
2544 attributes provided in the reply are actually valid.  If it can do
2545 this, and verify that they indeed are valid values it MAY append
2546 a digital signature at the end of the attributes with the
2547 ATTRIBUTE_SERVER_DIGITAL_SIGNATURE as defined in [ATTRS].  The
2548 server then MUST provide valid WHOIS command reply to the sender
2549 of the command.   Other servers and routers that receive the command
2550 reply en route to the original sender MAY also cache the information.
2551
2552 The client which receives the command reply to the WHOIS command
2553 SHOULD verify the ATTRIBUTE_USER_DIGITAL_SIGNATURE and the
2554 ATTRIBUTE_SERVER_DIGITAL_SIGNATURE if they are provided.