1 <big><b>SilcStatus Arguments</b></big>
4 The <a href="silcstatus-SilcStatus.html">SilcStatus</a> is used to indicate
5 a status (usually error status) of command execution and command reply
6 status. It is also used to deliver disconnection status when server
7 disconnects client from the server. For application it is mainly important
8 in case of `command_reply' client operation, where the SilcStatus indicates
9 the error status of the command that was executed. If error occurred the
10 arguments returned by the `command_reply' are then dependent of the SilcStatus
11 type instead of the <a href="command_reply_args.html">SilcCommand
15 This documents describes how the application should interpret the SilcStatus
16 type in the `command_reply' client operation to be able to handle all
17 error conditions properly. Any status type can be returned for any
18 SilcCommand. For this reason application should be able to handle any
19 error with any command.
22 <br /> <br /> <br />
23 <b>Error Status In command_reply Client Operation</b>
26 When error occurs in execution of a command the `command_reply' client
27 operation is called with error status. In this case the 'success'
28 argument of the client operation is set to FALSE, to indicate that command
29 execution failed, and the 'status' argument indicates the error.
30 If the 'status' argument is SILC_STATUS_OK then error did not occur and the
31 arguments are as described in <a href="command_reply_args.html">SilcCommand
35 Application should handle the error status arguments by the SilcStatus
36 type for example in a <tt>switch</tt> statement. The SilcStatus values
37 are defined in lib/silccore/silcstatus.h header file. A short example.
41 switch(status)<br />
42 {<br />
43 case SILC_STATUS_ERR_NO_SUCH_NICK:<br />
44 ...<br />
45 nick = va_arg(va, char *);<br />
46 ...<br />
47 break;<br />
48 case SILC_STATUS_ERR_NO_SUCH_CHANNEL:<br />
49 ...<br />
50 break;<br />
51 case SILC_STATUS_ERR_NO_SUCH_SERVER:<br />
52 ...<br />
53 break;<br />
54 ...<br />
55 default:<br />
56 break;<br />
57 }
61 <br /> <br /> <br />
65 The following table describes all status values and arguments that the client
66 library sends in the 'command_reply' client operation to the application
67 in case of error. All arguments listed below are usually valid when
68 returned by the library. However applicationn must be able to handle that
69 any of those arguments may be NULL.
72 The 'command_reply' arguments in case of error are as follows:
75 <table border="1" width="100%" cellpadding="3" cellspacing="0">
79 <td><small>Description</td>
80 <td width="40%"><small>Error Arguments</td>
84 <td><small>SILC_STATUS_OK</td>
88 <td width="40%"><small>N/A
93 <td><small>SILC_STATUS_ERR_NO_SUCH_NICK</td>
95 Requested nickname does not exist. Argument is the unknown name.
97 <td width="40%"><small>const char *nickname
102 <td><small>SILC_STATUS_ERR_NO_SUCH_CHANNEL</td>
104 The requested channel does not exist. Argument is the unknown name.
106 <td width="40%"><small>const char *channel_name
111 <td><small>SILC_STATUS_ERR_NO_SUCH_SERVER</td>
113 The requested server does not exist. Argument is the unknown name.
115 <td width="40%"><small>const char *server_name
120 <td><small>SILC_STATUS_ERR_NO_RECIPIENT</td>
122 Command required recipient but none was provided. No arguments returned.
123 <td width="40%"><small>N/A
128 <td><small>SILC_STATUS_ERR_UNKNOWN_COMMAND</td>
130 Command sent to server is unknown or unsupported by the server. No
133 <td width="40%"><small>N/A
138 <td><small>SILC_STATUS_ERR_WILDCARDS</td>
140 Wildcards were provided by they were not permitted. No arguments returned.
142 <td width="40%"><small>N/A
147 <td><small>SILC_STATUS_ERR_NO_CLIENT_ID</td>
149 Client ID was expected as command parameter but was not found. No
152 <td width="40%"><small>N/A
157 <td><small>SILC_STATUS_ERR_NO_CHANNEL_ID</td>
159 Channel ID was expected as command parameter but was not found. No
162 <td width="40%"><small>N/A
167 <td><small>SILC_STATUS_ERR_NO_SERVER_ID</td>
169 Server ID was expected as command parameter but was not found. No
172 <td width="40%"><small>N/A
177 <td><small>SILC_STATUS_ERR_BAD_CLIENT_ID</td>
179 Client ID provided was malformed. Returns the malformed ID.
181 <td width="40%"><small>const SilcClientID *client_id
186 <td><small>SILC_STATUS_ERR_BAD_CHANNEL_ID</td>
188 Channel ID provided was malformed. Returns the malformed ID.
190 <td width="40%"><small>const SilcChannelID *channel_id
195 <td><small>SILC_STATUS_ERR_BAD_SERVER_ID</td>
197 Server ID provided was malformed. Returns the malformed ID.
199 <td width="40%"><small>const SilcServerID *server_id
204 <td><small>SILC_STATUS_ERR_NO_SUCH_CLIENT_ID</td>
206 Client ID provided does not exist. The unknown ID is returned.
208 <td width="40%"><small>const SilcClientID *client_id
213 <td><small>SILC_STATUS_ERR_NO_SUCH_CHANNEL_ID</td>
215 Channel ID provided does not exist. The unknown ID is returned.
217 <td width="40%"><small>const SilcChannelID *channel_id
222 <td><small>SILC_STATUS_ERR_NO_SUCH_SERVER_ID</td>
224 Server ID provided does not exist. The unknown ID is returned.
226 <td width="40%"><small>const SilcServerID *server_id
231 <td><small>SILC_STATUS_ERR_NOT_ON_CHANNEL</td>
233 The command required for you to be on channel but you were not.
234 The channel ID is returned.
236 <td width="40%"><small>const SilcChannelID *channel_id
241 <td><small>SILC_STATUS_ERR_USER_NOT_ON_CHANNEL</td>
243 The requested target client is not on requested channel. Returns the
244 target client ID and channel ID.
246 <td width="40%"><small>const SilcClientID *client_id,
247 const SilcChannelID *channel_id
252 <td><small>SILC_STATUS_ERR_USER_ON_CHANNEL</td>
254 User were invited on channel they already are on. Returns the
255 target client ID and channel ID.
257 <td width="40%"><small>const SilcClientID *client_id,
258 const SilcChannelID *channel_id
263 <td><small>SILC_STATUS_ERR_NOT_REGISTERED</td>
265 User executed command that requires the client to be registered on the
266 server before it may be executed. No arguments returned.
268 <td width="40%"><small>N/A
273 <td><small>SILC_STATUS_ERR_NOT_ENOUGH_PARAMS</td>
275 Command required more parameters than provided. No arguments returned.
277 <td width="40%"><small>N/A
282 <td><small>SILC_STATUS_ERR_TOO_MANY_PARAMS</td>
284 Too many parameters provided for the command. No arguments returned.
286 <td width="40%"><small>N/A
291 <td><small>SILC_STATUS_ERR_PERM_DENIED</td>
293 Generic permission denied error status, to indicat disallowed access.
294 No arguments returned.
296 <td width="40%"><small>N/A
301 <td><small>SILC_STATUS_ERR_BAD_PASSWORD</td>
303 Password provided for channel were not accepted. Returns the channel ID.
305 <td width="40%"><small>const SilcChannelID *channel_id
310 <td><small>SILC_STATUS_ERR_CHANNEL_IS_FULL</td>
312 The channel is full and client cannot join the channel. Returns the
315 <td width="40%"><small>const SilcChannelID *channel_id
320 <td><small>SILC_STATUS_ERR_NOT_INVITED</td>
322 The channel is invite only channel and client has not been invited.
323 Returns the channel ID.
325 <td width="40%"><small>const SilcChannelID *channel_id
330 <td><small>SILC_STATUS_ERR_BANNED_FROM_CHANNEL</td>
332 The client has been banned from the channel. Returns the channel ID.
334 <td width="40%"><small>const SilcChannelID *channel_id
339 <td><small>SILC_STATUS_ERR_UNKNOWN_MODE</td>
341 Mode provided by the client was unknown to or unsupported by the server.
342 No arguments returned.
344 <td width="40%"><small>N/A
349 <td><small>SILC_STATUS_ERR_NOT_YOU</td>
351 User tried to change someone else's mode which is not allowed.
352 No arguments returned.
354 <td width="40%"><small>N/A
359 <td><small>SILC_STATUS_ERR_NO_CHANNEL_PRIV</td>
361 Command may be executed only by channel operator. The next argument is
364 <td width="40%"><small>const SilcChannelID *channel_id
369 <td><small>SILC_STATUS_ERR_NO_CHANNEL_FOPRIV</td>
371 Command may be executed only by channel founder. The next argument is
374 <td width="40%"><small>const SilcChannelID *channel_id
379 <td><small>SILC_STATUS_ERR_NO_SERVER_PRIV</td>
381 Command may be executed only by server operator. No arguments returned.
383 <td width="40%"><small>N/A
388 <td><small>SILC_STATUS_ERR_NO_ROUTER_PRIV</td>
390 Command may be executed only by router (SILC) operator. No arguments returned.
392 <td width="40%"><small>N/A
397 <td><small>SILC_STATUS_ERR_BAD_NICKNAME</td>
399 Nickname requested contained illegal characters or was malformed. No
402 <td width="40%"><small>N/A
407 <td><small>SILC_STATUS_ERR_BAD_CHANNEL</td>
409 Channel name requested contained illegal characters or was malformed. No
412 <td width="40%"><small>N/A
417 <td><small>SILC_STATUS_ERR_AUTH_FAILED</td>
419 The authentication data (passphrase or digital signature) sent as argument
420 was wrong and thus authentication failed. No arguments returned.
422 <td width="40%"><small>N/A
427 <td><small>SILC_STATUS_ERR_UNKNOWN_ALGORITHM</td>
429 The server does not support requested algorithm. Returns the unknown
432 <td width="40%"><small>const char *alg_name
437 <td><small>SILC_STATUS_ERR_RESOURCE_LIMIT</td>
439 Server cannot or will not accept the action due to resource limitations.
440 No arguments returned.
442 <td width="40%"><small>N/A
447 <td><small>SILC_STATUS_ERR_NO_SUCH_SERVICE</td>
449 Requestes service identifier is unknown. Returns the unknown service
452 <td width="40%"><small>const char *service_identifier
457 <td><small>SILC_STATUS_ERR_TIMEDOUT</td>
459 Operation (command execution) or service request timed out, and thus was
460 not processed. This usually happens due to network failure between servers
461 and routers in the network. No arguments returned.
463 <td width="40%"><small>N/A
468 <td><small>SILC_STATUS_ERR_UNSUPPORTED_PUBLIC_KEY</td>
470 The public key or certificate type is not supported in ths implementation.
471 No arguments returned.
473 <td width="40%"><small>N/A
477 <td><small>SILC_STATUS_ERR_OPERATION_ALLOWED</td>
479 A operation, for example a command, is not allowed or it's execution is
480 not allowed. No arguments returned.
482 <td width="40%"><small>N/A
489 SILC protocol defines some additional status types but those status
490 types are not returned in `command_reply' client operation. Only
491 the status types listed above are delivered to application.