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