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